in reply to Optional parameter passing to a function??

I have written several subs that have optional parameters but have always put the at the end.
<pseudo-code>
sub foo { my ($p1, $p2, $p3, $p4, p5) = @_; do { #something } if $p4; do { #something } if $p5; #etc }
</pseudo-code>
Then you can call your sub with 3,4,5 (or any number) of parameters

or

you can call your sub like:

prog(1,"","",2,3)
or

prog(1,undef,undef,2,3)
HTH

Sweetblood