in reply to How to pass two arrays to a sub?
use strict; use warnings; use Data::Dumper; my @list1 = qw(a b c); my @list2 = qw(d e f); printem([@list1], [@list2]); sub printem { my $list1 = shift or die "no list1"; my $list2 = shift or die "no list2"; print "list1: " . Dumper($list1); print "list2: " . Dumper($list2); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to pass two lists to a sub?
by wazoox (Prior) on Oct 18, 2006 at 11:26 UTC | |
by sanjay nayak (Sexton) on Oct 18, 2006 at 13:36 UTC |