Quick question -- script issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jack

    Quick question -- script issue

    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.*\.tofo rmat/, readdir(DIR));
    closedir(DIR);

    foreach $file (@files) {
    open(FILE,"<$fi le");
    my($template)=< FILE>;
    print "$template" ;
    close(FILE);
    }

  • nobull@mail.com

    #2
    Re: Quick question -- script issue

    jack <jack@raxo.ne t> wrote in message news:<BB6E7A1C. 371%jack@raxo.n et>...[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.

    Comment

    Working...