in reply to Passing Empty/ Undefined values to a subroutine

Your example as given works fine here, maybe you should post the code you're actually using?

C.

Test:

perl -le'$ret_val = my_sub(1, "", 2, "", "", 3); sub my_sub{$arg1 = sh +ift;$undef1 = shift;$arg2 = shift;$undef2 = shift;$undef3 = shift;$ar +g3 = shift; print "Arg1:", $arg1, " Undef1:", $undef1, " Arg2:", $arg +2, " Undef2:", $undef2; }' Prints: Arg1:1 Undef1: Arg2:2 Undef2:
Oops, browser didnt refresh properly, honest!
  • Comment on Re: (dup; please do not reply) Passing null values to a subroutine
  • Download Code