in reply to passing of variables
When run, that prints out:use strict; use warnings; use Data::Dump; { my %toys = ( frisbee => 5 ); dd \%toys; play_around(\%toys); dd \%toys; } sub play_around { die "expected one arg" unless @_ == 1; die "expected hash arg" unless ref($_[0]) eq "HASH"; our %t; local *t = $_[0]; $t{leggo} = "yes"; }
See? Nice and easy!{ frisbee => 5 } { frisbee => 5, leggo => "yes" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing of variables
by itsscott (Sexton) on May 06, 2011 at 18:13 UTC | |
by John M. Dlugosz (Monsignor) on May 07, 2011 at 01:07 UTC | |
by itsscott (Sexton) on May 07, 2011 at 02:33 UTC | |
by John M. Dlugosz (Monsignor) on May 07, 2011 at 03:50 UTC | |
by GotToBTru (Prior) on May 06, 2011 at 20:47 UTC |