in reply to Polymorphism?
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" } } ---------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Polymorphism?
by Aighearach (Initiate) on Jul 10, 2000 at 06:08 UTC |