in reply to seeking piped STDIO
or something else to that extent..ls files.* | script.pl OR ./script.pl files.ext files.ext2 files.ext3
and in the script:./script.pl -d /my/dir/for/files -f files
then do what adamsj suggested, open each file in @FILES, check the first line, then send the file name or filehandle to the subroutine and have the subroutine open the file or seek to the beginning of the file handle..... $defaultdir = "/usual/place/to/look"; $dir = $opt_d; $dir = $defdir unless -e $dir; $defprefix = "files\."; $prefix = $opt_f; $prefix = $defprefix unless $prefix; opendir(LS, $dir) || die "couldn't open dir\n"; while(my $file = readdir(DIR)) { if($file =~ /^$prefix/) { push @FILES,$file; } } ....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: seeking piped STDIO
by adamsj (Hermit) on Nov 16, 2000 at 23:29 UTC |