in reply to function w complex args
Hi,
I like the way that is also recommended in the book Perl Best Practices by Damian Conway (O'Reilly).
It's passing a hashref to the subroutine, like:
blargh({ file => '/tmp/foo', email => 'pileofrogs@example.com', enable_squid => 1, squid_name => 'Bob', }); sub blargh { my $args = shift; ... }
And then you test for the existence or the required contraints on the arguments passed.
Regards,
|
|---|