List Info

Thread: Getting Arguments using Command Line




Getting Arguments using Command Line
user name
2007-01-30 23:46:31
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 Foldertest"
"D:Second
Folder"

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

The Output what I expect is:
First Argument: D:First Foldertest
********************
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/


Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: Getting Arguments using Command Line
user name
2007-01-31 05:44:29
Run that like this --->

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

value the quotes )

srini vasan <ensrinivasanyahoo.co.in> 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 Foldertest"
"D:Second
 Folder"
 
 The Output shown was:
 First Argument: D:First Foldertest" D:Second
 ********************
 Second Argument: Folder
 
 The Output what I expect is:
 First Argument: D:First Foldertest
 ********************
 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]



Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )