Connecting Tech Pros Worldwide Help | Site Map

Quick question -- script issue

jack
Guest
 
Posts: n/a
#1: Jul 19 '05
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);
}

nobull@mail.com
Guest
 
Posts: n/a
#2: Jul 19 '05

re: Quick question -- script issue


jack <jack@raxo.net> wrote in message news:<BB6E7A1C.371%jack@raxo.net>...[color=blue]
> Subject: Quick question -- script issue[/color]

That contains _zero_ information. No, actually that's not true. It
contains the information "I'm to selfish/lazy/arrogant to bother
thinking about my subject lines". Is that really what you wanted to
tell us?
[color=blue]
> 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?[/color]

Manuals.

No less than half the manpage of one of the functions you are using is
devoted to forewarning you about the mistake you have just made.
Don't worry just about everyone makes the mistake the first time they
use this funtion - I know I did. The test of character is if you have
the self discipline to go RTFM when things go wrong.

Guessing which function I'm talking about is left as an execise for
the reader. (Hint, it is one that has something to do with
directories).

This newsgroup does not exist (see FAQ). Please do not start threads
here.
Closed Thread