http://www.perlmonks.org?node_id=406854


in reply to Basic Perl passing a temp array

change this line:
addHost('aklia700',qw(carrot lunch));
to
addHost('aklia700',[qw(carrot lunch)]);
have a look at perldoc perlref (what you are wanting is an anonymous array)

-enlil