Why does $ARGV0 contains a newline? [doc://chop|chop] will remove the last character, no matter what it is. The following should be more reliable than chop:
my $arg = $ARGV[0]; $arg =~ s/\*$//; # Remove trailing '*', if any.
If there really is a newline, add chomp($arg) between those two lines.
Of course, you probably you could forget about removing the '*' and use File::Glob or File::DosGlob to interpret the argument (if you're trying to list the files matching the spec).
$ARGV[0] =~ s/\*.*$//;That should do it too.
perlmonks.org content © perlmonks.org and Anonymous Monk, bioMan, choedebeck, ikegami, suaveant
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03