in reply to Listglob

How about:

my @globlist = glob '*.{txt,aux}';
That is a shell glob expression, but we're assured it's portable.

After Compline,
Zaxo

Replies are listed 'Best First'.
•Re: Re: Listglob
by merlyn (Sage) on Apr 17, 2002 at 23:36 UTC
    my @globlist = glob '*.{txt,aux}';

    That is a shell glob expression, but we're assured it's portable.

    Actually, that's a csh or ksh glob expression, not a shell glob expression. And since Perl would actually run on machines that didn't have csh (gasp!), it's not completely portable in the same sense as Perl.

    However, the difference would probably be nil for most modern Perl users.

    -- Randal L. Schwartz, Perl hacker

      However, there's little reason to gratitutiously break portablity when (glob('*.txt'), glob('*.aux')) would work.


      We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book

      Doesn't the glob funtion use File::Glob now? If so I think it would be 100% portable. (I'm sure you'll let me know if I'm wrong ;)