By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Quick question -- script issue

P: n/a
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);
}

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
jack <ja**@raxo.net> wrote in message news:<BB6E7A1C.371%ja**@raxo.net>...
Subject: Quick question -- script issue
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?
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?


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.
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.