To start with, rename
print subroutine to something that wouldn't collide with the built in Perl method ;).
Secondly, why not pass arguments to that
print subroutine anyways? It's not a very good idea to keep global variables, especially in code larger than a few pages, which I assume your code is since here you only chose to present a stripped down portion of your entire program right?
As far as "the better way of doing this" goes, I think I don't have much to add to the first reply ;).
|
"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith
|