in reply to Re: Re: Re: Re: backreference question.
in thread backreference question.
however that goes to an infinitely loop too and for the first time on windows I crash perl interpreter so fast (when i hit Ctrl^C).sub resp { $a="abcdefg";\$a } while (${&resp} =~ /(.)/g) { print $1; }
in the above code, I expect that &resp returns the 'value' of the subroutine and becomessub resp { "abcdefg" } while (&resp =~ /(.)/g) { # you forgot the &,didn't you? print $1; }
it would work if it were the case.while ("abcdefg" =~ /(.)/g) { print $1; }
so return by ref doesn't work either. what happens in while( &resp =~ /(.)/g ) ??
|
|---|