Hi,
I'm frustrate because I cannot imagine which makes in my code fails next sentence (which works fine until some points which I don't know):
if ($r =~ //) { xxx }
I was debugging my issue and find this, maybe there is relation:
Consider next simple program:
And then execute perl -d file or perl -e perl -d -e 'use CGI qw(:standard); $q=CGI->new' Then in the debugger:#!/usr/bin/perl -w use CGI qw(:standard); my $q=CGI->new ;
DB<1> w print "hola" if ("r" =~ //); DB<2> holac Watchpoint 0: print "hola" if ("r" =~ //); changed: old value: '1' new value: '' CGI::_compile(/usr/share/perl/5.12/CGI.pm:867): 867: ($pack,$func_name) = ($1,$2); DB<2> holaholaholaholaholaholaholaholaholaholaholaholaholaholaholaho +laholaholaholaholaholaholaholaholaholaholaholaholaholaholaholaholahol +aholaholaholaholaholaholaholaholahola DB<2> p print "hola" if ("r" =~ //); DB<3>
So, why "r" =~ // changes her semantics? (note DB<2> response and remember that it happens too in some moment inside my code (which is larger and I cannot post fully here))
Please see that "r" =~ // come from "$r" =~ /$r2/ in my real program. And too if I change $r2 to "." if it is empty my program works fine.
So, do you think I should report it as an CGI.pm bug or do you have any tip for me?
Thank you very much monks!
PD: I don't know if this go better to "Meditations" or it is ok in Seekers section.
In reply to Is this a bug ? by i5513
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |