Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^4: Running a script iteratively.by Fletch (Bishop) |
on Apr 24, 2008 at 16:18 UTC ( [id://682664]=note: print w/replies, xml ) | Need Help?? |
Robustness aside (as it suffers from the same lack of error checking the other proffered version below with system has :), it doesn't express the intent behind the code correctly. Backticks are for capturing the output from an external program; system is for starting an external program who's output you don't care about. It's like using map in void context to iterate over a list in place of for; yes it "works", but if the line of code is not building a new list of values from an existing list then you're using the wrong "phrasing" (by which I mean 'not the clearest') to express your intent (map is for expressing transformation, for is for expressing iteration). (And I won't go into the "PERL scripts" I've seen that basically consisted of a shebang line and then every line was shell commands in backticks . . . *shudder* :) Update: Tweaked for perldoc link somewhere more relevant per prodding from kyle.
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|