Jimmy wrote: > Hi all, Hello,
> Just start with perl, not so understood what's the range on using regex. > > Can I do something like : > > $x = /\.(jpg|jpeg|gif|bmp)$/i; That is interpreted by perl as: $x = $_ =~ /\.(jpg|jpeg|gif|bmp)$/i; So yes you can do that but it looks like you really want to use the qr// operator: my $x = qr/\.(jpg|jpeg|gif|bmp)$/i; > for (@filelist) > { push @result, $_ if $_ =~ $x } You can shorten that by using the match operator: { push @result, $_ if /$x/ } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>