Hello. I wish to write a function that returns two values and can be used in a while loop or similar.
For example:
And this would print, eg,
until the function decided it had returned enough.
How would I return the two values and the end of the function?
How do I work out all my return values in the main part of the function and then return a list of lists (or whatever)??
It seems the "each" function does what I want when returning hash contents. But how to make my own function??
TIA
For example:
Code:
while( ($a, $b) = myfunc() ) {
print "a=$a\tb=$b\n"
}
And this would print, eg,
Code:
a=1 b=2
a=6 b=9
a=1 b=10
How would I return the two values and the end of the function?
How do I work out all my return values in the main part of the function and then return a list of lists (or whatever)??
It seems the "each" function does what I want when returning hash contents. But how to make my own function??
TIA