in reply to MS-DOS search using globs

When it comes to the questions, you aren't calling your sub routines, so how could they? Adding
&dir; &name; &ext;
before you are trying to use the variables will at least ask the questions... but before anything else, you need to turn on strict and use -w. Please.

Then, decide which method you want to use. Either the combination opendir/readdir or glob. They don't have anything to do with each other (so scratch the opendir for now, and read up on glob, if that is your chosen way). That is one of the reasons it will not return any files from directory $dir.

I furthermore ask why you are doing:

$ext = <STDIN> ; $e = $ext ;
when
$e = <STDIN> ;
does the job? In reality, I see no use for such a small program to use subroutines at all, or at least use one, slightly bigger instead for this. I'd also consider returning values from them, if you have them, instead of setting global variables.

Hmm... that was a lot of complaining. :( Sorry about that, but well, you would have a lot easier time if you listened to some of it at least. :)


You have moved into a dark place.
It is pitch black. You are likely to be eaten by a grue.

Replies are listed 'Best First'.
Just a note..
by Android 18 (Novice) on May 13, 2002 at 03:04 UTC
    In reponse to dog and pony's suggestion to add:
    &dir; &name; &ext;
    Note that calling subs via '&' will pass @_ to the sub. If you don't want this behavior, I recommend using something more like:

    dir(); name(); ext();  #instead

    Not that he's wrong.. :) Just my two cents. Once bread becomes toast, it can never be bread again.