Polymorphism???
Anyway,
what splinky or someone was talking about is the way to pass parameters to sub's in perl.
Within a subroutine the array @_ contains the parameters passed to that subroutine.
update: um, thanks, fixed it---------------- #!/usr/bin/perl -w &foo; # the function call to foo with no parameters &foo(1); &foo("How's about a piZza?!"); &foo("JAPH"); sub foo { if(@_) { my $varYouPassed=$_[0]; print "You passed the var $varYouPassed to foo."; } else { print "You passed no vars to foo" } } ---------------
In reply to (crazyinsomniac) Re: Polymorphism?
by crazyinsomniac
in thread Polymorphism?
by Cheburashka
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |