in reply to immutable pos() inside regex
$\ = "\n"; $, = ","; print 'a string' =~ m/(.)(?{print "before mod, pos = ".pos();pos()+=4; +print "after mod, pos = ".pos();})/g; print pos(); #cause error, it is undef, as now we are inside any regex +p
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: immutable pos() inside regex
by diotalevi (Canon) on Dec 08, 2002 at 19:13 UTC | |
by pg (Canon) on Dec 08, 2002 at 19:34 UTC |