August 1999 | Perl Hardware Store | Slide #16 |
What does this do?
use Evaluator; print "6 * 7 + 5 = $eval{6 * 7 + 5}\n";
# Prints ``6 * 7 + 5 = 47''
use Evaluator ':'; print "6 * 7 + 5 = $:{6 * 7 + 5}\n";
# Prints ``6 * 7 + 5 = 47''
My hilarious Interpolation module lets you define arbitrary string
interpolation semantics using this trick.
Next | Copyright © 1998 M-J. Dominus |