P is for Practical | |
PerlMonks |
Re^3: Printing a Variable outside of the blockby olus (Curate) |
on Apr 15, 2008 at 16:48 UTC ( [id://680574]=note: print w/replies, xml ) | Need Help?? |
Aside from what moritz said, do you really need to have $part1 and $part2? Since you are parsing an array you'll have to go through the process of running all its values. There are quite a few ways to do that. You can use the for loop to build the final string to be printed, and print it outside the block
create the single string right from the array values by joining them
use a different kind of block
In Section
Seekers of Perl Wisdom
|
|