in reply to Re^2: Trap in Test::Unit::Assert? Avoidance
in thread Trap in Test::Unit::Assert? Avoidance
Note that a failing regex in list context returning anything but an empty list would be very inconvenient, as this code is common:
If the failing match would return undef, 0, or the empty string, the result of the assignment becomes true (because a list assignment in scalar context returns the number of things on the RHS of the assignment).if (my @matches = $var =~ /PATTERN/) { # match } else { # did not match }
|
|---|