August 1999 Return to the Perl Hardware Store Slide #22

Interpolation.pm

        use Eval;
        print "6 * 7 + 53 is $eval{6 * 7 + 53}.\n";
                (prints `6 * 7 + 53 is 95.')

or alternatively:

        use Eval ':';
        print "Brain D Foy in lowercase is $:{lc 'Brain D Foy'}.\n";
                (prints `Brain D Foy in lowercase is brain d foy.')
        sub FETCH {
          $_[1];
        }


Next Copyright © 1999 M-J. Dominus