in reply to Re^2: File open problem with "GLOB"
in thread File open problem with "GLOB"
Dear brethren, I had the good fortune yesterday to spot an unanswered Seeker query to which I knew the answer. As I wrote my reply, I strove to be helpful, correct, but above all quick.
There are details I might have done differently. The querent said
and when I converted to three-arg open I could have left the filename at'>C:\Program Files\cron\Cruise Ships\ship_data.csv'
or converted to'C:\Program Files\cron\Cruise Ships\ship_data.csv'
because (as all Windows Perl programmers should be told) forward slashes work just fine for telling Windows where to go, and can never be mistakenly parsed as escapes, and I'd rather not spend any time at all thinking about when a backslash is an escape and when it isn't.'C:/Program Files/cron/Cruise Ships/ship_data.csv'
I could also have changed $output to $output_fh and $input to $input_data, but chose instead to retain the querent's own variable names.
Others would certainly have made different choices. I'm still surprised that the particular nit that was picked was the pair of braces around the filehandle in
print {$output} $input;
|
|---|