in reply to Re^2: equivalent to Hash::Util for lists / arrays
in thread equivalent to Hash::Util for lists / arrays
We can only speculate about the use case, but IIRC it's possible to define readonly lists with the constant pragma and use them with indices like arrays.
UPDATE:
use constant WEEKDAYS => qw( Sunday Monday Tuesday Wednesday Thursday Friday Saturday ); print "Today is ", (WEEKDAYS)[ (localtime)[WDAY] ], ".\n";
and it's also possible to use read-only values for arrays.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: equivalent to Hash::Util for lists / arrays
by ikegami (Patriarch) on Dec 21, 2010 at 17:43 UTC |