Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: ranged conditional with variable

by diotalevi (Canon)
on Aug 22, 2006 at 00:04 UTC ( [id://568723]=note: print w/replies, xml ) Need Help??


in reply to ranged conditional with variable

You thought the second match would use $line because the first did. It didn't. You didn't provide a target for /PatternEnd/ so it bound to $_. Write it using the second example I've quoted.

# You wrote if ( $line =~ /PatternBegin/ .. $_ =~ /PatternEnd/ ) { # You wanted. if ( $line =~ /PatternBegin/ .. $line =~ /PatternEnd/ ) {

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://568723]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found