http://qs321.pair.com?node_id=1107958


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.