[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-AnyPerl] How to interpolate a function call in a string



On Tue, Jul 18, 2000 at 12:03:21PM +0900, Joel Rees wrote:

> my $refThing2 = \&thing2;
> print "A reference doesn't help: $refThing2(\"mustard gas\")\n";
> # print "Error (undefined sub): ${refThing2(\"mustard gas\")}\n";
> # print "Error (undefined sub): ${&refThing2(\"mustard gas\")}\n";

So close...  You need to make a reference for the dereference to operate
on.

"${\refThing2('mustard gas')}"
"@{[refThing2('mustard gas')}"

Ronald

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org