more futzing with operators (and dumpster diving perlmonks about println func)

This commit is contained in:
Dan Buch 2011-01-04 21:41:55 -05:00
parent 63889cdac3
commit 80271d9649

View File

@ -1,5 +1,11 @@
#!/usr/bin/env perl
use strict;
use warnings;
sub println { sub println {
printf("%s\n", shift()); local $, = "";
print +(@_ ? @_ : $_), $/;
} }
@ -58,7 +64,7 @@ my $c = <STDIN>;
my $ncookies = 0; my $ncookies = 0;
sub printcookies { sub printcookies {
print "I like cookies " . $ncookies++ . "\n"; println("I like cookies " . $ncookies++);
} }