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

Re: Strange Behaviour of Two Hashes

by buckaduck (Chaplain)
on May 17, 2005 at 19:03 UTC ( [id://458032]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Strange Behaviour of Two Hashes

The error is on line 109: if ((my @gaps) = ($asstr =~ m/$regex/o)) The /o in your regex is telling Perl to compile the regular expression only once because the string $regex is never going to change. But it does change, because you call the subroutine more than once. Therefore, the regex gets compiled differently, depending on which call to the align() subroutine occurs first.

The way to fix it is to remove the /o from the regex: if ((my @gaps) = ($asstr =~ m/$regex/))

buckaduck

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://458032]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.