Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Empty pattern in regex

by jo37 (Deacon)
on Oct 23, 2023 at 18:04 UTC ( [id://11155154] : note . print w/replies, xml ) Need Help??


in reply to Re: Empty pattern in regex
in thread Empty pattern in regex

It was not my intention to cause any troubles. $ff =~ /(?:^1|E0)$/ can be rewritten as $ff == 1 || $ff =~ /E0$/. When the second operand of the flip-flop operator becomes true, the return value gets an E0 appended. This does not change the value in numeric context as it is just one of its floating point representations. In string context it is distinguishable from all the other values, though.

HTH

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$