Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: **HomeWork** Printing the found input from an array

by trenchwar (Beadle)
on Apr 02, 2008 at 16:12 UTC ( [id://677991]=note: print w/replies, xml ) Need Help??


in reply to Re: **HomeWork** Printing the found input from an array
in thread **HomeWork** Printing the found input from an array

Makes perfect since... I was isolating $city inside the loop which is why it had no value, correct?
  • Comment on Re^2: **HomeWork** Printing the found input from an array

Replies are listed 'Best First'.
Re^3: **HomeWork** Printing the found input from an array
by CountZero (Bishop) on Apr 02, 2008 at 20:01 UTC
    which is why it had no value
    But it did have a value! But only within the loop and once you left the loop the variable got out scope and did not exist anymore.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2025-03-26 14:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (68 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.