in reply to Re^11: Using pos() inside regexp (no /e)
in thread Using pos() inside regexp
1(one) is result of print# perl -e "\$_='qwerty';\$v='_MATCH_'; s/r/print \$v/; print \"\n\".\$ +_;"; qweprint _MATCH_ty # perl -e "\$_='qwerty';\$v='_MATCH_'; s/r/print \$v/e; print \"\n\".\ +$_;"; _MATCH_ qwe1ty # perl -e "\$_='qwerty';\$v='_MATCH_'; s/r/print \$v;\$v/e; print \"\n +\".\$_;"; _MATCH_ qwe_MATCH_ty
Does your statement that "1(one) is returned by print function and s/// insert it because it is last return at executed section" mean you believe that invoking print in the regex somehow assigns its return value to pos()?perldoc -f print print FILEHANDLE LIST print LIST print Prints a string or a list of strings. Returns true if successful. ...
|
|---|