Since your job is to refactor, i recommend using named parameters with defaults:
sub ampNotify { my %args = @_; # set defaults $args{severity} = defined $args{severity} ? $args{severity} : 3; $args{othercontact} ||= 'None'; .... }
And then you can call like so:
ampNotify( message => join( "\n", "Server: $server", "File: $origfile", "Erro +r: foo" ), subject => "Error processing $filename", who => 'su_and_it', path => $work_dir, file => $missingdeptfilename, );
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Creating Variables Just to Pass into Subroutine?
by jeffa
in thread Creating Variables Just to Pass into Subroutine?
by mdskrzypczyk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |