in reply to writing portable file processing scripts that use wildcards in filenames

If you want to do glob processing yourself, you must make sure you get the unexpanded string. But that's something you have to handle in the shell - when it gets to your program it's too late.

It's comparable with doing:

mysub ("foo$BAR");
in Perl. If you want mysub to deal with the interpolation, you shouldn't change mysub to prevent Perl doing the interpolation. Instead, you change the quotes, or escape the special symbols.

It's the same with a Unix shell. If you want your program to do the globbing, prevent the shell from expanding the *. Use quotes, or a backslash.

Perl --((8:>*
  • Comment on Re: writing portable file processing scripts that use wildcards in filenames
  • Download Code