However, $o and $n are both the same. I want to do a rename($o, $n) but it won't work if both variables are the same. So it seems that a reference is being made to $_instead of a copy being put in $o.ls | perl -lne '$o = $_; s/DOTX/DOT_TEST/; $n = $_; warn "***$o, $n"'
Any idea why?
In reply to [perlrun; perlre] $_ seems aliased instead of copied in assignment... why? by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |