radicalfix has asked for the wisdom of the Perl Monks concerning the following question:
When I print @age_r, it returns 2030KelvinTokyoAndrewNew York. I think it should be just 2030? Any problem with my coding? Thanks!#! /usr/bin/perl use strict; use warnings; sub user (\@\%) { my ($age, $home) = @_; return (@$age, %$home); } my @age = (20, 30); my %home = (Kelvin => "Tokyo", Andrew => "New York"); my (@age_r, %home_r) = user(@age,%home); print @age_r;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Subroutine Parameters
by GrandFather (Saint) on May 31, 2007 at 02:55 UTC | |
by radicalfix (Initiate) on May 31, 2007 at 06:37 UTC | |
|
Re: Subroutine Parameters
by Util (Priest) on May 31, 2007 at 03:34 UTC | |
|
Re: Subroutine Parameters
by graff (Chancellor) on May 31, 2007 at 03:45 UTC | |
by chargrill (Parson) on May 31, 2007 at 04:13 UTC | |
by GrandFather (Saint) on May 31, 2007 at 04:16 UTC |