cosmicperl has asked for the wisdom of the Perl Monks concerning the following question:
Or:-my $string = 'start ' . $obj->middle() . ' end';
The latter obviously uses more memory, but is useful if parsing the variable into a lot of strings.my $return = $obj->middle(); my $string = "start $return end";
my $string = "start ${ \$obj->middle() }->{text} end";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Is there a clever way to stringify a method?
by GrandFather (Saint) on Mar 05, 2009 at 00:13 UTC | |
Re: Is there a clever way to stringify a method?
by Lawliet (Curate) on Mar 05, 2009 at 00:13 UTC | |
Re: Is there a clever way to stringify a method?
by johngg (Canon) on Mar 05, 2009 at 00:14 UTC | |
Re: Is there a clever way to interpolate a method?
by wfsp (Abbot) on Mar 05, 2009 at 03:47 UTC | |
Re: Is there a clever way to stringify a method?
by cosmicperl (Chaplain) on Mar 05, 2009 at 00:39 UTC | |
by perrin (Chancellor) on Mar 05, 2009 at 03:40 UTC | |
Re: Is there a clever way to interpolate a method?
by kyle (Abbot) on Mar 05, 2009 at 04:22 UTC |