--- Alok Bhatt <[EMAIL PROTECTED]> wrote:
> 
> --- Jason Dusek <[EMAIL PROTECTED]> wrote:
> > Hi List,
> > But if I have a long list of suffixes, then I
> would
> > like to store the 
> > suffixes in an array, and then evaluate the array
> in
> > my regular 
> > expression. What does this? I've tried:
> > 
> >    @SUFF = (fish,foul);
> >    foreach (@ARGV) {
> >      print if (/\.(@SUFFIXES)$/);
> >    }
> > 
> > and also:
> > 
> >    @SUFF = (fish,foul);
> >    foreach (@ARGV) {
> >      print if (/\.(@[EMAIL PROTECTED])$/);
> >    }
> Hi, 
> try this
> my @suffix=(txt, jpg, tif);
> my $pattern= join "|", @suffix;
> 
> foreach (@ARGV) {
>       print if /\.$pattern$/;

Forgot to add
you should use /o option

print if /\.$pattern$/o;

so that it runs fater
> }
>  
> HTH,
> Alok
> (BTW- Nice sig.)
> 
> > but I can't get it to work.
> > -- 
> > -- Jason Dusek      ("`-''-/").___..--''"`-._
> > -- |                 `6_ 6  )   `-.  (    
> > ).`-.__.`)
> > -- |                 (_Y_.)'  ._   )  `._ `.
> ``-..-'
> > -- |               _..`--'_..-_/  /--'_.' ,'
> > -- |              (il),-''  (li),'  ((!.-'
> > --
> > 
> > -- 
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > <http://learn.perl.org/>
> > <http://learn.perl.org/first-response>
> > 
> > 
> 
> 
> 
>       
>               
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> <http://learn.perl.org/>
> <http://learn.perl.org/first-response>
> 
> 



        
                
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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


Reply via email to