* Dan Jacobson said:
Is this how the pros would do this?
$ perl -we 'print join ",", map($_*10,(1..10))'
10,20,30,40,50,60,70,80,90,100
Simpler ways would get an extra comma, or be meant for non gappy lists.
You could get rid of all those needless parentheses to shorten your line
a little bit.
$ perl -we'print+join",",map$_*10,1..10'
Alternatively, you could use grep() instead of map(). Sure, You need the
same number of characters to type -- it's just another way to doing the
same thing (remember, TIMTOWTDI ;-).
$ perl -we'print+join",",grep/0/,1..100'
But I think this is not as efficient as your first thought. My last idea
is to set $OUTPUT_FIELD_SEPARATOR (»$,«, look into `perldoc perlvar` for
details) to a suitable value, to save one more character ;-)
$ perl -we'$,=",";print+map$_*10,1..10'
$ perl -we'$,=",";print+grep/0/,1..100'
regards,
fabian