Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: looping through variables

by davidrw (Prior)
on Jul 04, 2006 at 02:55 UTC ( [id://559075]=note: print w/replies, xml ) Need Help??


in reply to looping through variables

yes, but you're probably better off using an array or a hash (i had a discussion on this topic earlier today)..
my @websites; print "Website = $_\n" for @websites;
How are your variables currently being declared & populated?

Replies are listed 'Best First'.
Re^2: looping through variables
by SadPenguin (Novice) on Jul 05, 2006 at 00:32 UTC
    Also, you might consider this node: Here for a good description of why it is common, but a bad idea to do this kind of thing. I would just use an array for this, since it will probably not always be, say, 5 websites, but probably n. And if not, then just to get a bit of practice in writing good code (good habits build themselves, after a while).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-19 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found