G'day proxie,
See the special variable $" (aka $LIST_SEPARATOR). Some examples:
$ perl -le 'print @ARGV' foo1 foo2 foo3 foo1foo2foo3 $ perl -le 'print "@ARGV"' foo1 foo2 foo3 foo1 foo2 foo3 $ perl -le 'local $" = "~"; print @ARGV' foo1 foo2 foo3 foo1foo2foo3 $ perl -le 'local $" = "~"; print "@ARGV"' foo1 foo2 foo3 foo1~foo2~foo3
If you want to change the value of $", or indeed any special variable, you'd be well advised to use local. It might be considered overkill in little one-liner such as I have there, but it's a good habit to get into. In an actual script, I'd recommend doing it always.
— Ken
In reply to Re: Take in command line arguments as an entire string?
by kcott
in thread Take in command line arguments as an entire string?
by proxie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |