Loading ...
Sorry, an error occurred while loading the content.

Getting Arguments using Command Line

Expand Messages
  • srini vasan
    Hi All, Below is my perl script: use strict; use warnings; print First Argument: $ARGV[0] ; print n******************** n ; print Second Argument:
    Message 1 of 4 , Jan 30, 2007
    • 0 Attachment
      Hi All,

      Below is my perl script:


      use strict;
      use warnings;

      print "First Argument: $ARGV[0]";
      print "\n********************\n";
      print "Second Argument: $ARGV[1]";

      When I execute this with arguments
      perl test.pl "D:\First Folder\test\" "D:\Second
      Folder"

      The Output shown was:
      First Argument: D:\First Folder\test" D:\Second
      ********************
      Second Argument: Folder

      The Output what I expect is:
      First Argument: D:\First Folder\test
      ********************
      Second Argument: D:\Second Folder

      Is there any idea to get the output what i expect,
      without changing Backward slashes to Forward slashes
      or Deleting the Final slash in First argument

      My OS is Windows.

      Thanks in Advance
      Srinivasan



      __________________________________________________________
      Yahoo! India Answers: Share what you know. Learn something new
      http://in.answers.yahoo.com/
    • Abdul
      Run that like this --- perl test.pl D: First Folder test D: Second Folder value the quotes :)) srini vasan wrote:
      Message 2 of 4 , Jan 31, 2007
      • 0 Attachment
        Run that like this --->

        perl test.pl 'D:\First Folder\test\' 'D:\Second Folder'

        value the quotes :))

        srini vasan <ensrinivasan@...> wrote: Hi All,

        Below is my perl script:

        use strict;
        use warnings;

        print "First Argument: $ARGV[0]";
        print "\n********************\n";
        print "Second Argument: $ARGV[1]";

        When I execute this with arguments
        perl test.pl "D:\First Folder\test\" "D:\Second
        Folder"

        The Output shown was:
        First Argument: D:\First Folder\test" D:\Second
        ********************
        Second Argument: Folder

        The Output what I expect is:
        First Argument: D:\First Folder\test
        ********************
        Second Argument: D:\Second Folder

        Is there any idea to get the output what i expect,
        without changing Backward slashes to Forward slashes
        or Deleting the Final slash in First argument

        My OS is Windows.

        Thanks in Advance
        Srinivasan


        __________________________________________________________
        Yahoo! India Answers: Share what you know. Learn something new
        http://in.answers.yahoo.com/





        ---------------------------------
        Yahoo! Movies - Search movie info and celeb profiles and photos.

        [Non-text portions of this message have been removed]
      • Srinivasan Kumar
        Hi any one can tell me that how can i run perl script from Apache,and reffer me any books is there. thank u Abdul wrote: Run that like this
        Message 3 of 4 , Jan 31, 2007
        • 0 Attachment
          Hi
          any one can tell me that how can i run perl script from Apache,and reffer me any books is there.

          thank u


          Abdul <a22khan@...> wrote:
          Run that like this --->

          perl test.pl 'D:\First Folder\test\' 'D:\Second Folder'

          value the quotes :))

          srini vasan <ensrinivasan@...> wrote: Hi All,

          Below is my perl script:

          use strict;
          use warnings;

          print "First Argument: $ARGV[0]";
          print "\n********************\n";
          print "Second Argument: $ARGV[1]";

          When I execute this with arguments
          perl test.pl "D:\First Folder\test\" "D:\Second
          Folder"

          The Output shown was:
          First Argument: D:\First Folder\test" D:\Second
          ********************
          Second Argument: Folder

          The Output what I expect is:
          First Argument: D:\First Folder\test
          ********************
          Second Argument: D:\Second Folder

          Is there any idea to get the output what i expect,
          without changing Backward slashes to Forward slashes
          or Deleting the Final slash in First argument

          My OS is Windows.

          Thanks in Advance
          Srinivasan


          __________________________________________________________
          Yahoo! India Answers: Share what you know. Learn something new
          http://in.answers.yahoo.com/





          ---------------------------------
          Yahoo! Movies - Search movie info and celeb profiles and photos.

          [Non-text portions of this message have been removed]





          __________________________________________________
          Do You Yahoo!?
          Tired of spam? Yahoo! Mail has the best spam protection around
          http://mail.yahoo.com

          [Non-text portions of this message have been removed]
        • srini vasan
          The Following also not give me proper result. ... __________________________________________________________ Yahoo! India Answers: Share what you know. Learn
          Message 4 of 4 , Feb 2, 2007
          • 0 Attachment
            The Following also not give me proper result.


            --- Abdul <a22khan@...> wrote:

            > Run that like this --->
            >
            > perl test.pl 'D:\First Folder\test\' 'D:\Second
            > Folder'
            >
            > value the quotes :))
            >
            > srini vasan <ensrinivasan@...> wrote:
            > Hi All,
            >
            > Below is my perl script:
            >
            > use strict;
            > use warnings;
            >
            > print "First Argument: $ARGV[0]";
            > print "\n********************\n";
            > print "Second Argument: $ARGV[1]";
            >
            > When I execute this with arguments
            > perl test.pl "D:\First Folder\test\" "D:\Second
            > Folder"
            >
            > The Output shown was:
            > First Argument: D:\First Folder\test" D:\Second
            > ********************
            > Second Argument: Folder
            >
            > The Output what I expect is:
            > First Argument: D:\First Folder\test
            > ********************
            > Second Argument: D:\Second Folder
            >
            > Is there any idea to get the output what i expect,
            > without changing Backward slashes to Forward
            > slashes
            > or Deleting the Final slash in First argument
            >
            > My OS is Windows.
            >
            > Thanks in Advance
            > Srinivasan
            >
            >
            >
            >
            __________________________________________________________
            > Yahoo! India Answers: Share what you know. Learn
            > something new
            > http://in.answers.yahoo.com/
            >
            >
            >
            >
            >
            > ---------------------------------
            > Yahoo! Movies - Search movie info and celeb
            > profiles and photos.
            >
            > [Non-text portions of this message have been
            > removed]
            >
            >




            __________________________________________________________
            Yahoo! India Answers: Share what you know. Learn something new
            http://in.answers.yahoo.com/
          Your message has been successfully submitted and would be delivered to recipients shortly.