Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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]
[choroba]: Corion Nice
[Corion]: Hi choroba! I'm somewhat fond of this picture - I think it is Breaking Bad-style even though I haven't watched the series at all ;)
[Corion]: Hmmm - and now that I look at it, the gallery I'm using doesn't produce non-Javascript compatible links in the sense that hotlinking to an image will only work for Javascript enabled...
[Corion]: On the other hand, maybe supporting non-Javascript isn't that much a priority, and I'm not exactly sure how I could make it work for both kinds of browsers without server-side magic

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-02-27 08:32 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (377 votes). Check out past polls.