vladb has asked for the wisdom of the Perl Monks concerning the following question:
I wrote a cgi script to emulate SSI behaviour and it works fine for the latest versions of perl (5.6.1+). Now I'm having to port this script to run under perl 5.005_02. I know this one is outrageously old, but one particular server I have to run the cgi on doesn't run any better ;(.
The cgi in question is http://www.e-vris.com/ssi_cgi.txt (http://www.e-vris.com/ssi.tar.gz)
While porting, I ran into this one problem where a regular expression would return 1 (true) on an empty string, whereas in perl 5.6.1 it returns 0, as is expected. For example,
Any idea why the regexp operation evaluates to 1? There should be absolutely no match... Afterall, the query variable is undefined.. . . my $query = undef; if ($query =~ /^(([\w\d\-\_]+)[:,]|)(.*)$/) { # we get here! print "$`|$1|$2|$3|$4|$'|$query|"; } else { exit; } . . .
Your help is much appreciated ;-) Update: Gush... this was an obviously stupid question. Sorry for the trouble. I'll get on with porting (occassional brain farts are not pleasant, especially when exposed) ;-p
_____________________
"I'm always right and I can prove it, because to the best of my knowledge, I've never been wrong."