kbfiles has asked for the wisdom of the Perl Monks concerning the following question:
I have some basic perl syntax questions from this beginner. I'm declaring an anonymous array in line 1, but I don't understand what the "0+" is doing in line 2? Also, in line 3, how is the assignment occurring for both $a and $b? As a scalar or an array element?
my $new = [$a, $b] $myhash1{0+ $new} = $new; $myhash2{$_} = $new for $a, $b;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Syntax
by davido (Cardinal) on Oct 30, 2013 at 21:19 UTC | |
by kbfiles (Initiate) on Oct 30, 2013 at 22:01 UTC | |
by davido (Cardinal) on Oct 31, 2013 at 00:24 UTC | |
by NetWallah (Canon) on Oct 30, 2013 at 23:22 UTC | |
|
Re: Perl Syntax
by SuicideJunkie (Vicar) on Oct 30, 2013 at 20:59 UTC | |
by kbfiles (Initiate) on Oct 30, 2013 at 21:04 UTC | |
by derby (Abbot) on Oct 30, 2013 at 21:20 UTC | |
by davido (Cardinal) on Oct 30, 2013 at 21:45 UTC | |
by tobyink (Canon) on Oct 30, 2013 at 22:36 UTC | |
|
Re: Perl Syntax
by talexb (Chancellor) on Oct 31, 2013 at 15:06 UTC |