develooper Front page | perl.fwp | Postings from July 2003

Re: range operator for a condition in 2 steps

Thread Previous
From:
Jasper McCrea
Date:
July 31, 2003 08:29
Subject:
Re: range operator for a condition in 2 steps
Message ID:
3F2935B5.5B578A37@guideguide.com
"James E. Tilley" wrote:
> 
> Does
> 
>   if (/^BEGIN$/ .. (/^\s*$/ .. /^END$/) =~ /E/)
> 
> do what you want?
> 

Getting rid of the fourth match:

  /^START$/ .. (/^\s*$/ .. /^END$/) && $&

I'm not entirely sure this works for all cases.

Jasper
-- 
I'm not a robot like you. I don't like having disks crammed into me...
Unless they're Oreos, and then only in the mouth.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About