On Wed, 09 Apr 2008 13:14:33 -0400
James Carman <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> Is it possible to do something like:
>
>
> ¶m_test("somestring", "another_string" $arrayref);
>
> sub param_test($tom; $george; @$array) {
> print $tom;
> ....;
> }
Hi James,
You can do:
sub param_test ($$$) {
my ( $tom, $george, $array_ref ) = @_;
}
That will ensure that three scalars are passed in. However, using
subroutine parameter checking like this isn't considered a best
practice.
Check out the Prototypes section of 'man perlsub' if you want
more info on it.
-------------------------------------------------------
Frank Wiles, Revolution Systems, LLC.
Personal : [EMAIL PROTECTED] http://www.wiles.org
Work : [EMAIL PROTECTED] http://www.revsys.com
_______________________________________________
kc mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/kc