Seanie wrote: > John W. Krahn wrote: >>>Your syntax for the open() statements is a bit dodgy too :-) >>Perl defines the syntax so you must mean something else? :-) > > As in "too much unnecessary typing and commas and such, which don't really > add clarity", rather than "incorrect"
The OP's open statements: > open $FILE,"<","$root/$_"; > > open $FILE,">","blah"; Can you explain where the "too much unnecessary typing and commas and such" exist in those statements? [ snip ] >>>for my $infile (qw|m.top.html m.mid.html m.arc.html m.bot.html|){ >>> die "$infile not found" unless -r "$root/$infile"; # or use next to >>>skip it >>$infile could exist and not be readable so the message "$infile not found" >>does not accurately describe the problem > > Ok, granted. s/found/readable/ > >>and if you are logged in as root then the file is readable reguardless. > Unless it doesn't exist. What's your point? > >>Also you have a race condition >>where the file could be made unreadable between that statement and the >>next one. > > And could be deleted entirely before (or during) the subsequent read by > another process. Still not sure of your point. I didn't think the OP wanted > a lecture about file locking. I said nothing about locking. I was making the point that the test for readability is redundant as the die() after open() will catch any existence or readability problems anyway. John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/