Leser: 1
2 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; sub multiply($$) { (pop)*(pop) } print multiply 4, 5; print "\n"; sub to ($) { (shift) } # just syntactic sugar sub on ($) { (shift) } # also syntactic sugar sub add { # currying my $op = shift; return sub { (shift) + $op } } print add(5)->(on add(3)->(to 4));
mache my $etwas, hallo each %myhash;
1 2 3 4 5 6 7 8
sub lock { my ($file) = @_; return flock $file, LOCK_SH; } sub link { my ($text) = @_; return "<a href=$text>$text</a>"; }
2 Einträge, 1 Seite |