Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Multi-dimensional constants

by navalned (Sexton)
on Nov 22, 2020 at 16:53 UTC ( #11124026=note: print w/replies, xml ) Need Help??


in reply to Multi-dimensional constants

I would recommend trying `Readonly'.

use Readonly; Readonly my @readonly => (['book', 'pen', 'pencil'], ['bat', 'ball', 'glove'], ['snake', 'rat', 'rabbit']); print $readonly[0][0], "\n"; $readonly[0][0] = "comicbook"; 1;

Outputs the following:
book
Modification of a read-only value attempted at ./readonly.pl line 11
Plus you should be able to fill in the array at runtime so that should give you more flexibility.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124026]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-01-19 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?