Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: a word of warning about /$pattern/

by dada (Chaplain)
on Dec 02, 2003 at 16:05 UTC ( #311664=note: print w/replies, xml ) Need Help??


in reply to Re: a word of warning about /$pattern/
in thread a word of warning about /$pattern/

To my limited understanding, it seems like an empty pattern will return true.

that's not true (or not accurate, at least). read carefully the italic lines in my previous message, in particular: if no match has previously succeded, this will (silently) act instead as a genuine empty pattern (which will always match).

If all patterns are empty, is the whole expression true? Did you test with all of the patterns being empty?

yes, and yes. and that was even worse, because it helped to hide the bug from my eyes. when all the patterns were empty, all the records did match. but this happened only because no match has previously succeded, so this is something subject to an action-at-a-distance (eg. a succesful pattern match 1000 lines before may very well alter the behaviour of the search).

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

  • Comment on Re: Re: a word of warning about /$pattern/

Replies are listed 'Best First'.
Re: Re: Re: a word of warning about /$pattern/
by Theo (Priest) on Dec 02, 2003 at 17:17 UTC
    (eg. a succesful pattern match 1000 lines before may very well alter the behaviour of the search)

    That's horrible! I'm sure I'll be hit with that one sooner or later. (Hope I remember this fact at that time).

    -theo-
    (so many nodes and so little time ... )

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-01-24 04:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (64 votes). Check out past polls.

    Notices?