
| Contents |
|||||||||||||||
| [an error occurred while processing this directive] |
5.3 Literals"Hash literals" per se do not exist. However, remember that when we evaluate a hash in the list context, we get the pairs of the hash unfolded into the list. We can exploit this to do hash literals. We simply write out the list pairs that we want placed into the hash. For example:
would give us the same hash we had in the previous example.use strict; my %table = qw/schmoe joe 7.5 1.6/; |