perl outrage
Oct. 23rd, 2003 05:04 pmnon-geeks, avert thine eyes.
I just had to rant somewhere about a very bad paragraph of perl:
opendir (DIR, $dir) || die "cannot open $dir\n";
while ($_ = readdir(DIR))
{
if(/^foo/){;} #OK
else{next;}
if(/^bar/){next;} # skip bar data
print STDERR "$_ ";
`csh -c "cat $dir/$_/* | $pipethrough >> $dir/temporary"`;
}
`csh -c "cat $dir/temporary | anonymize > $output"`;
print STDERR "\nDone\n";
closedir(DIR);
`rm $dir/temporary`;
exit;
# more code here...
Augh. I'll rewrite this when I have time.
Bonus question: How many processes are started by the following?
`csh -c "cat $dir/temporary | anonymize > $output"`;( my rewrite )