in reply to passing delimiters on command line
As a one-liner:
>perl -wle"${\"} = eval qq[\"$ARGV[0]\"]; my @a = 1 .. 10; print \"@a\ +"" \t 1 2 3 4 5 6 7 8 9 + 10
Or more simply in a program:
#! perl -slw use strict; $" = eval qq["$ARGV[ 0 ]"]; my @a = 1 .. 10; print "@a"; __END__ P:\test>test.pl \t 1 2 3 4 5 6 7 8 9 + 10
Caveat: If you type in a dangerous command in place of the delimiter, it will do dangerous things!
Update: As a less dangeruos alternative you could do one of:
>perl -wle"${\"} = chr $ARGV[0]; my @a = 1 .. 10; print qq[@a]" 9 1 2 3 4 5 6 7 8 9 + 10 >perl -wle"${\"} = chr hex $ARGV[0]; my @a = 1 .. 10; print qq[@a]" 0x +9 1 2 3 4 5 6 7 8 9 + 10 >perl -wle"${\"} = chr oct $ARGV[0]; my @a = 1 .. 10; print qq[@a]" 11 1 2 3 4 5 6 7 8 9 + 10
|
|---|