in reply to Re^3: Best practice validating numerics with regex?
in thread Best practice validating numerics with regex?
Bitwise string assignment is another option.
Both do the same thing. The second is just a bit more structurally similar to the other cases since it's on one line.
my $str; $str |.= $_ for @strings; # more or'ing strings $longest = length $str; print "longest: $longest\n"; $longest = length do {my $s; $s |.= $_ for @strings; $s}; # more or'i +ng strings print "longest: $longest\n";
Edit - fixed typo.
|
|---|