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

Re^3: Perl beginner's issue with hash

by AnomalousMonk (Archbishop)
on Apr 23, 2020 at 18:50 UTC ( [id://11115969]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl beginner's issue with hash
in thread Perl beginner's issue with hash

All I've changed is the 'if' for a 'while' ...

If all you've done is change
    if (CONDITION) { ... } else { ... }
to
    while (CONDITION) { ... } else { ... }
then yes, this is a syntax error because there is no  while ... else ... statement block structure in Perl. (The only  if statement | statement block I can see in the OPed code is  if (/$id/g) { ... } — is this the one you're referring to?)

I'm not sure what you were trying to accomplish with this change, so I'm not sure what to advise as the proper change.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found