in reply to Re: passing subroutine arguments directly into a hash
in thread passing subroutine arguments directly into a hash
I personally prefer this approach because it 1) tells me what parameters I am expecting and 2) it allows me to set defaults. Yes, it takes up a lot of space visually, but who the heck cares since it makes the code that much more readable. :-)sub sub1 { my %args = ( arg1 => 'default', arg2 => 0, arg3 => undef, @_ ); }
|
---|