Perl subroutines

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Paul Mooring
Dátum:  
Címzett: Main PLUG discussion list
Tárgy: Perl subroutines
I'm working on a perl script, and I have a lot more experience in ruby
than I do in perl. As far as I can tell there is no way to explicitly
define arguments for a subroutine in perl, for example

sub addNums(number1, number2) {
sum = number1 + number2;

return sum;
}

rather than

sub addNums {
number1 = shift;
number2 = shift;
sum = number1 + number2;

return sum;
}

is there anyway to do this, and if not does anyone have some advice on
a way to make this a bit more readable in perl?
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss