Think about Loose Coupling | |
PerlMonks |
How to handle a variable number of results from split()?by Anonymous Monk |
on Jul 20, 2005 at 16:14 UTC ( [id://476553]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a file(s) with asimilar lines:
I want to split by /-/ but process each split separatly. So firstly $num1=1 and $num2=2 and do something with these. Then split the second set $num1=3 and $num2=4 and process these. The only problem here is that the number of splits is not consistent so i can not declare each variable. Is this possible? Edited by Arunbear: Changed title from 'split', as per Monastery guidelines
Back to
Seekers of Perl Wisdom
|
|