more futzing with operators (and dumpster diving perlmonks about println func)
This commit is contained in:
parent
63889cdac3
commit
80271d9649
@ -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++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user