in reply to What does a failed regular expression match actually return?
You don't say one way or the other, but I'm assuming you did not have warnings enabled in your code. Had you done so, Perl would have given you another clue as to what was going on.
The "Odd number of elements in anonymous hash ..." warning can be explained as follows:c:\@Work\Perl\monks>perl -Mstrict -le "use warnings; use Data::Dumper; warn Dumper( { a => 'a' =~ m/b/, b => 'asdf' } ); " Odd number of elements in anonymous hash at -e line 1. $VAR1 = { 'a' => 'b', 'asdf' => undef };
Bottom line: always use strict and warnings (if you weren't doing so already), even when you know you don't really need them! :)
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What does a failed regular expression match actually return?
by ikegami (Patriarch) on May 20, 2020 at 20:35 UTC |