Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: bash vs perl

by sh1tn (Priest)
on Jan 11, 2008 at 18:39 UTC ( #661948=note: print w/replies, xml ) Need Help??

in reply to bash vs perl

The shell scripts are almost always slower and the code is neither readable nor compact.

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| i.to_s, "w"}'
ruby -e '10.times{|i| %x[touch #{i}]}'

Replies are listed 'Best First'.
Re^2: bash vs perl
by ikegami (Pope) on Jan 12, 2008 at 09:28 UTC
    touch and open '>' are hardly the same. You want utime

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://661948]
Discipulus still has problem with 'until' beyond simplest cases
[choroba]: ;-)
[Discipulus]: and larry studied natural languages too
[choroba]: Czechs have problems with unless
[Lady_Aleena]: Are you all sick of me discussing my reorganization?
[Discipulus]: Untillian Headache or about the semantic of until
[Discipulus]: Lady_Aleena use Great::Flood really, start some little project with new eyes (and a DB)

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2017-05-27 20:25 GMT
Find Nodes?
    Voting Booth?