Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Using arrays of qr!! to simplify larger RE's for readability.

by sachmet (Scribe)
on May 01, 2001 at 20:39 UTC ( [id://77024]=note: print w/replies, xml ) Need Help??


in reply to Using arrays of qr!! to simplify larger RE's for readability (code).

#!/usr/bin/perl print isend("#---end"); print "\n"; sub isend { my $line = shift; my @terminators = ( qr!#=3D=3D=3D(?:END|end)!, qr!#===(?:END|end)!, qr![-]+_=_NextPart_!, qr!1===(?:END|end)!, qr!#---(?:END|end)! ); foreach my $ending (@terminators) { return undef if $line =~ $ending; } return 1; }
prints solely a newline.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-26 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found