Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: use strict

by Abigail-II (Bishop)
on Jun 01, 2004 at 12:58 UTC ( [id://358017]=note: print w/replies, xml ) Need Help??


in reply to use strict

You get errors because you are using symbolic references. If that is what you want, turn strictness off (at least in those blocks you are using them). Don't slab strictness on existing code if you don't know the implications. Don't dance to the pipes of strictness either - a programmer shouldn't be a slave of the language, at least not if the language is Perl.

A way of solving this while using strict:

my @interests = ("foo", "bar", "blah"); my %hash; foreach (@interest) { $hash {$_} = "My interest is $_"; } foreach (@interest) { print $hash {$_}, "\n"; }

Abigail

Replies are listed 'Best First'.
Re: Re: use strict
by rsiedl (Friar) on Jun 01, 2004 at 14:21 UTC
    Thanks for your post.
    I wasnt so much interested in solving this problem, more so in the how/why it doesnt work.
    I'll try and do a bit more research on symbolic references.
    Cheers,
    Reagen

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found