Perl Programming | ||
---|---|---|
Declaring Subroutines | ||
sub ten { return wantarray() ? (1 .. 10) : 10; } @ten = ten(); # (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) $ten = ten(); # 10 ($ten) = ten(); # (1) ($one, $two) = ten(); # (1, 2) |
||
Previous | http://stuff.mit.edu/iap/perl/ | Next |