No such thing as a small change | |
PerlMonks |
Re: Substituting method from objectby elusion (Curate) |
on Dec 03, 2002 at 01:27 UTC ( [id://217100]=note: print w/replies, xml ) | Need Help?? |
In a substitution, the replace value isn't evaluated, it's treated as a string. If you want it to be evaluated, you need to use the /e modifier. $error_string =~ s/error/$user->get_error_string/e; This is also how you would replace something with the value returned by a function or any other code. elusion : http://matt.diephouse.com
In Section
Seekers of Perl Wisdom
|
|