in reply to Confused when reading Input within Perl and Shell Scripts
Now how do I read each filename in perl?Well, that depends on how your program is supposed to get the filenames. Is it all files from a certain directory? Use opendir and readdir. Are the filenames given through a pipe? Use <>. Are the filenames the command line arguments? Then they are found in @ARGV. Do you use command line options to communicate filenames? Use Getopt::Long (or some other Getopt:: module).
The way I have written the code, DSSPIN produces the error:My advice is to stop using bareword file handles. That's so last millennium. Use autovivifying filehandles:
Autovivifying filehandles have been there since March 2000 - when 5.6.0 got released.my $filename = "...."; open my $fh, "<", $filename or die; while (<$fh>) { ... }
|
|---|