Huh?!?
I think you misunderstood me! I do use very often the /g modifier in list context:
ormy $n =()= / \b aiutino \b /gix; warn "Argh, $n times";
warn "$_ => Argh!\n" for / \b aiutino \b /gix; # Ok: not that interesting with a fixed lenght string!
Update: in the code above I did s/smart/interesting/, as per Aristotle's remark: indeed the latter adjective better reflects my feeling - I meant that $_ saves me some typing but will always have the value 'aiutino', and it would be more interesting with a more complex regex. Well, thinking of it better, not quite always 'aiutino', because I used /i, but still there ought to be more interesting cases...
In reply to Re^2: /g matches not really global in scalar context!
by blazar
in thread /g matches not really global in scalar context!
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |