in reply to bash vs perl
The shell scripts are almost always slower and the code is neither readable nor compact.
bash
for i in `seq 1 10`; do touch $i; done
Perl and derivatives
perl -e 'open F, ">", $_ for 1..10'
perl -e 'qx[touch $_] for 1..10'
ruby -e '10.times{|i| File.new i.to_s, "w"}'
ruby -e '10.times{|i| %x[touch #{i}]}'
bash
for i in `seq 1 10`; do touch $i; done
Perl and derivatives
perl -e 'open F, ">", $_ for 1..10'
perl -e 'qx[touch $_] for 1..10'
ruby -e '10.times{|i| File.new i.to_s, "w"}'
ruby -e '10.times{|i| %x[touch #{i}]}'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: bash vs perl
by ikegami (Patriarch) on Jan 12, 2008 at 09:28 UTC |
In Section
Seekers of Perl Wisdom