praveenchappa has asked for the wisdom of the Perl Monks concerning the following question:
i had perl script that takes input from commandline arguments ,but tle problem is while passing srtings with \n contained in it ,it ignores \n and treats it like normal character squence why its loosing its significance , iwant \n to have its effect on string later on ....
perl program.pl "hai hello\nhow r y" "i am fine" $string1=$Argv[0]; $string1=$Argv[1]; print $string1 ; print $string2 ; ###output##### hai hello\nhow r y i am fine Now------------------------------------------ $string1="hai hello\nhow r y"; $string1="i am fine"; print $string1 ; print $string2 ; ###output##### hai hello how r y i am fine
here nothing to do with second string,but the problem is i want the string taken from arguments to behave line the string in secon scenario ....Please help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help regarding command line arguments
by roboticus (Chancellor) on Nov 18, 2014 at 12:35 UTC | |
|
Re: help regarding command line arguments
by rnewsham (Curate) on Nov 18, 2014 at 12:30 UTC | |
|
Re: help regarding command line arguments
by Anonymous Monk on Nov 18, 2014 at 13:22 UTC | |
|
Re: help regarding command line arguments
by Sathishkumar (Scribe) on Nov 19, 2014 at 08:21 UTC |