Your args as in the example are a hash, so in the absence of any indication of why you want to use prototypes the obvious works for me:
#!/usr/bin/perl -w use strict; my @aFieldHeaders; my %hFieldConfigs; sub ConfigRead (%); my $sConfigFile = 'mydata.csv'; ConfigRead(sFILE => $sConfigFile, apHEAD => \@aFieldHeaders, hpFIELDCONF => \%hFieldConfigs); # my array and hash now have some cool stuff in 'em! sub ConfigRead (%) { my %hArgs = ( sFILE => 'BAD', # lazy user alert! whine & die apHEAD => 'BAD', # ^^^ see comment above hpFIELDCONF => 'BAD', # by now you know the drill! @_, # user demands come from here ); # stick some cool stuff in their variables }
But as everyone else has said: don't do that unless you have a good reason.
In reply to Re: Function Prototypes
by hippo
in thread Function Prototypes
by KimberTLE
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |