Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by sachmet (Scribe)
on May 01, 2001 at 20:39 UTC ( #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
Node Status?
node history
Node Type: note [id://77024]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2021-04-20 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?