22 Dec 2005 18:13
perlfaq4: How do I expand function calls in a string?
_brian_d_foy <comdog <at> panix.com>
2005-12-22 17:13:44 GMT
2005-12-22 17:13:44 GMT
* deleted an extra "of"
* added an example of the Interpolation module
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq4.pod,v
retrieving revision 1.71
diff -u -d -r1.71 perlfaq4.pod
--- perlfaq4.pod 23 Nov 2005 07:46:45 -0000 1.71
+++ perlfaq4.pod 22 Dec 2005 17:12:30 -0000
<at> <at> -589,7 +589,7 <at> <at>
This is documented in L<perlref>, and although it's not the easiest
thing to read, it does work. In each of these examples, we call the
-function inside the braces of used to dereference a reference. If we
+function inside the braces used to dereference a reference. If we
have a more than one return value, we can construct and dereference an
anonymous array. In this case, we call the function in list context.
<at> <at> -610,9 +610,17 <at> <at>
sub timestamp { my $t = localtime; \$t }
print "The time is ${ timestamp() }.\n";
+
+The C<Interpolation> module can also do a lot of magic for you. You can
+specify a variable name, in this case C<E>, to set up a tied hash that
+does the interpolation for you. It has several other methods to do this
+as well.
+
(Continue reading)
RSS Feed