in reply to asterisk problems, and more

Because the Wintendo shell doesn't expand globs; it's up to the receiving program to do so if it wants to understand them. Your options are to get a real shell, or preprocess @ARGV.

if( $^O eq 'MSWin32' ) { @ARGV = map glob( $_ ), @ARGV; }

Replies are listed 'Best First'.
Re^2: asterisk problems, and more
by radiantmatrix (Parson) on Jan 09, 2006 at 21:57 UTC

    I recommend doing this in your for loop. Instead of:

    for (@ARGV) { }

    Use:

    for ( grep {-f $_} map{ glob($_) } @ARGV ) { }

    This will, in a cross-platform way, return a list of all files in the directory. If you need things that aren't files (like directories), you can drop the grep {-f $_} piece.

    See glob, grep, and map for more.

    <-radiant.matrix->
    A collection of thoughts and links from the minds of geeks
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law