in reply to (Ovid - reading files) Re: File globbing to a different directory
in thread File globbing to a different directory

That did the trick...you are a Perl God in my book. I'll have to study those opendir and readdir functions. But I'm wondering: do you know why my approach failed?

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;

Replies are listed 'Best First'.
(Ovid) Re(3): File globbing to a different directory
by Ovid (Cardinal) on Apr 25, 2001 at 02:37 UTC
    I have no idea why your approach failed. It looked fine to me. Now that I stop to think about it, I can't see why mine would have worked when your's failed. The benefit of using opendir is that it assigns to $! when it fails. File globs and the glob function don't do that (at least, not that I'm aware of).

    Side note: it's considered cleaner to check for files using the glob function instead of the file globbing operator. I should have suggested that first.

    When you said that it failed, how did it fail? Was there anything populating your @photos array?

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Re: Re: (Ovid - reading files) Re: File globbing to a different directory
by nysus (Parson) on Apr 25, 2001 at 04:04 UTC
    Exactly, there was nothing in the array. I didn't get any errors either.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar";
    $nysus = $PM . $MCF;