my $repl = "--$1"; === my $repl = '--'.$1; my $repl = shift; === my $repl = '--$1'; my $repl = eval shift; === my $repl = --$1; === Modification of a read-only value my $repl = eval qq{"$temp"}; === my $repl = "--$1"; === my $repl = '--'.$1;
You should have checked if the eval succeeded.
And inside an a substitution:
s/.../eval qq{"$temp"}/e
I hate hiding an eval EXPR as /ee. It's too dangerous to hide, and it prevents you from checking if the eval succeeded.
In reply to Re: eval problem
by ikegami
in thread eval problem
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |