in reply to printing arrays
TIMTOWTDI again! You can use the default behaviour that separates array or list elements with a space in double-quoted strings. This construct, @{ [ ... ] }, allows you to interpolate bits of code inside double-quoted strings.
$ perl -e ' @ids = qw{ 123 456 789 }; @names = qw{ ann joe flo }; print qq{@{ [ map qq{$ids[ $_ ] $names[ $_ ]}, 0 .. $#ids ] }\n};' 123 ann 456 joe 789 flo $
I hope this is of interest.
Cheers,
JohnGG
|
|---|