Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: I am stuck on how to print the largest and smallest numbers from user inputted values. Any help is appreciated.

by Loops (Curate)
on Nov 20, 2014 at 20:10 UTC ( #1107958=note: print w/replies, xml ) Need Help??


in reply to Re^2: I am stuck on how to print the largest and smallest numbers from user inputted values. Any help is appreciated.
in thread I am stuck on how to print the largest and smallest numbers from user inputted values. Any help is appreciated.

Yeah, then you don't even really need to set them to undef, since as others have shown in their code there is already a decent way to test if it's the first iteration. Or you can just prime the values from the first input to begin with and start iterating from the second value. What I was describing was a more general idea that has the benefit of simplicity and avoiding an extra conditional check in every iteration.

  • Comment on Re^3: I am stuck on how to print the largest and smallest numbers from user inputted values. Any help is appreciated.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-04-16 03:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?