in reply to Re^2: Scalar Vs. List context
in thread Scalar Vs. List context
can be rewritten as this$_ = "1.0 and 2.4 and 310 and 4.7 and so on"; @a = m/([\d|\.]+)\D+/g; print "@a\n"; #result #1.0 2.4 310 4.7
without changing the meaning whatsoever. Your two examples only differ in that the first matches against a defined scalar, whereas the second matches against $_.$_ = "1.0 and 2.4 and 310 and 4.7 and so on"; @a = ($_ =~ m/([\d|\.]+)\D+/g); print "@a\n"; #result #1.0 2.4 310 4.7
|
|---|