This is my first post to this forum, because until now Perl has been one of the most convenient and intuitive programming languages I know. However, now I have an issue that I cannot resolve. I want to pass a string as a command line argument, and (for the purposes of this question) print the string. This works fine, except for the fact that escape characters are not parsed.
The code:
Expand|Select|Wrap|Line Numbers
- $output1 = $ARGV[0];
- $output2 = "line 1\nline 2";
- print $output1;
- print "\n";
- print $output2;
Expand|Select|Wrap|Line Numbers
- perl lines.pl "line 1\nline 2"
Expand|Select|Wrap|Line Numbers
- line 1\nline 2
- line 1
- line 2
Does anyone know how to parse the escape characters in @ARGV? Thanks in advance.