Your solution is succint and will most likely work as the OP intended. But, I would recommend the OP to use his/her version updated with the comments from other monks. Since the OP is new to perl, a more verbose solution instead of a succint solution may be better in terms of simplicity, understandability and maintainability.
Having said that, I would also strongly recommend the OP to try to understand the perl one-liner version - as a good learning exercise.
Regards,
Mahesh
In reply to Re^2: Defactor this code
by smahesh
in thread Defactor this code
by xerophyte
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |