[Chicago-talk] scalar manipulation

Steven Lembark lembark at wrkhors.com
Fri Mar 31 15:19:45 PST 2006


tiger peng wrote:
 > Hi Perlists,
 >
 > I don't think it is good to mess up the "good time for
 > beer" when it is Friday )-:
 >
 > I am wandering if Perl can turn beer to champagne,
 > wine, brandy, or even vodka.

Certianly:

     my $drink = shift || 'water';

     s{ \b beer \b }{ $drink }ogx for @ARGV;

     print join "\n", @ARGV, '';

pick your drink :-)

-- 
Steven Lembark                                         85-09 90th Street
Workhorse Computing                                  Woodhaven, NY 11421
lembark at wrkhors.com                                      +1 888 359 3508


More information about the Chicago-talk mailing list