in reply to Re: Re: Re: when is a string not a string?
in thread when is a string not a string?

I've just returned to this problem today and, tada, it looks like it is $2 that is being passed! now why would I get this behaviour in this case?

Thanks for all the replies, I think we are about to crack this problem!
  • Comment on Re: Re: Re: Re: when is a string not a string?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: when is a string not a string?
by Sidhekin (Priest) on May 07, 2002 at 10:37 UTC

    tada, it looks like it is $2 that is being passed!

    That was a long shot! There is (or was?) a bug in perl, so that $2 was not properly bound, and would evaluate to undef if first evaluated outside the scope of the regex that set it. (And passing to a function did not, for the purposes of this bug, count as "evaluating" it.)

    I guess this is the bug that bit you. It is an easy bug to work around. All you need is to assign some dummy variable my $dummy = $2. Or maybe you could even get around it by passing "$2" instead of $2 to the function. I don't remember the details.

    The Sidhekin
    print "Just another Perl ${\(trickster and hacker)},"