Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: splitting the scalar variables in an arrayby Athanasius (Archbishop) |
on Nov 16, 2013 at 06:55 UTC ( [id://1062858]=note: print w/replies, xml ) | Need Help?? |
split expects its second argument to be a string (i.e., a scalar), so using the array @TotalHosts here puts the array into scalar context, and split gets the number of elements in the array. You need to change this line:
to something like this:
which calls split on each element of the array in turn. This works provided that each of the array elements is a string. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|