in reply to Re: Printing to stdout an array of strings and scalar references
in thread Printing to stdout an array of strings and scalar references
Hi Ken
Thanks for your help,
To clarify I generally do pass variables into my subroutines, the use of global's in the sample code was for demonstration purposes, as was the newline feed at the end of the output line, it was purely intended to demonstrate the output without having to introduce delays.
I have never really understood the uses of anonymous blocks of code, your explanation and code sample has helped to clarify why I might need to use that method in the future, and I will also check out state as you recommend.
I have traditionally turned on Autoflush globally when I need it (as indeed I do for the purposes of the progress indication), I notice you are scoping it as a local to the subroutine, is there an advantage to this method? or alternatively a disadvantage to using autoflush globally?
sprintf is also something I have not used much, but I can see how your code could be adapted to achieve the variable output I require without resorting to references within the array so I will also put more effort into understanding how it works.
Thankyou for your assistance, it has been educational :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Printing to stdout an array of strings and scalar references
by kcott (Archbishop) on Oct 25, 2017 at 07:10 UTC |