carlriz has asked for the wisdom of the Perl Monks concerning the following question:
I was reading perldocs this morning and saw this code example. In particular, this: @sig_num{@names}. Sig_num is a hash, but what is the @ symbol doing?
use Config; use strict; my %sig_num; my @sig_name; unless($Config{sig_name} && $Config{sig_num}) { die "No sigs?"; } else { my @names = split ' ', $Config{sig_name}; @sig_num{@names} = split ' ', $Config{sig_num}; foreach (@names) { $sig_name[$sig_num{$_}] ||= $_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PerlDoc Code
by hazylife (Monk) on Mar 28, 2014 at 14:19 UTC | |
|
Re: PerlDoc Code ( Sig_num is a hash, but what is the @ symbol doing? )
by Anonymous Monk on Mar 28, 2014 at 19:07 UTC |