in reply to Passing Empty/ Undefined values to a subroutine
To see what is actually being passed to my_sub, you may want to try using Data::Dumper to see what @_ actually contains.
#!/usr/bin/perl -w use Data::Dumper; use strict; my ($arg1,$arg2,$arg3) = qw(arg1 arg2 arg3); my $ret_val = my_sub($arg1, "", $arg2, "", "", $arg3); sub my_sub{ print Dumper(\@_); my $arg1 = shift; my $undef1 = shift; my $arg2 = shift; my $undef2 = shift; my $undef3 = shift; my $arg3 = shift; ....... and so on }
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing Empty/ Undefined values to a subroutine
by bobn (Chaplain) on Jun 22, 2003 at 15:46 UTC |