in reply to I wanna customize qw()

btrott:

That is exactly what I needed to know. I am doing some R&D on the simplest (yet most flexible) way to access a library of custom-made functions that return HTML tags wrapped around the fed-in arguments.

I was settling for issuing a print statement for each and every returned value (I had also tried just printing within the subroutine itself, but the print-the-returned-value-outside-of-the-subroutine route seemed the more flexible way to go in the long run).

Then I hit upon the idea of packing each separate command into an array (but only if I could do it without having to wrap every line in quotes) and then printing out the array elements one by one. Assigning the array using qw() seemed like it would work early on but it ran out of steam when it came to making function calls with an argument that consisted of more than one word. Quotes seemed to cause problems too, as would be expected.

But I just swapped out the qw() call for the split() version that you recomended and it seems to be working... at least in my test case so far.

The big question I am facing is how deep I can nest function calls (function calls within function calls for example) because I am running each segment of the array through eval() before printing it out in order to get the subroutines processed. I suspect that either eval() will process all of my subroutine calls (even those embeded within other calls) or will only go one level deep. I can't wait to find out which it is.

Thanks again for your advice.