in reply to Function Prototypes
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Function Prototypes
by KimberTLE (Initiate) on Nov 24, 2015 at 18:19 UTC | |
by Your Mother (Archbishop) on Nov 24, 2015 at 18:32 UTC | |
by KimberTLE (Initiate) on Nov 25, 2015 at 02:21 UTC | |
by AnomalousMonk (Archbishop) on Nov 25, 2015 at 05:10 UTC |