On Sat, Jun 28, 2008 at 4:49 AM, Mike <[EMAIL PROTECTED]> wrote:

>
> I am able to pass regular arguments to perl but is it possible to get
> the * operator to work like it does in Linux?

No. Perl treats * as different as linux shell.

> Like typing in *.cpp to
> pass perl all .cpp files.

Try this instead:

use strict;

my $pattern = qr/\.cpp$/;
myfind($pattern);

sub myfind {
    my $x = shift;
    opendir DIR,"." or die $!;
    while(my $f = readdir DIR) {
        print $f,"\n" if $f=~/$x/;
    }
    close DIR;
}

-- 
Regards,
Jeff. - [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to