J
jack
I pulled this script out of a larger one to test, and I can't figure it out.
If I keep this script in the same directory as the files I want to read, it
works fine, but if I move the script out of it, no dice. Am I missing
something?
Thanks
Being script:
#!/usr/bin/perl
opendir(DIR, "/Users/jack/Sites/tempdir") || die "Can't open dir -- $!";
@files = grep(/article.*\.toformat/, readdir(DIR));
closedir(DIR);
foreach $file (@files) {
open(FILE,"<$file");
my($template)=<FILE>;
print "$template";
close(FILE);
}
If I keep this script in the same directory as the files I want to read, it
works fine, but if I move the script out of it, no dice. Am I missing
something?
Thanks
Being script:
#!/usr/bin/perl
opendir(DIR, "/Users/jack/Sites/tempdir") || die "Can't open dir -- $!";
@files = grep(/article.*\.toformat/, readdir(DIR));
closedir(DIR);
foreach $file (@files) {
open(FILE,"<$file");
my($template)=<FILE>;
print "$template";
close(FILE);
}