I'm working on a new perl script thats giving me fits.

Ive never quite seen anything like this.

here is the command that is not giving me the results I want.

@domain = split(' ',$domainlist);

what should have happened was that if there was any whitespace in the file (including new lines, and such) thats where the split would have occurred


what happens is that the whitespace that is in the string is stripped out and only one array element is returned after the split even though there should have been several.

You should know that $domainlist is populated by a system call.

example:

$domainlist = "test.domain.com\n\ntest2.domain.com\n\n"

the system call that populates $domainlist returns two hex(0A) characters after each value, I've shown them in the sample as \n for clarity.

@domain becomes "test.domain.comtest2.domain.com" with just one element.

I'm not understanding why spliting on the whitespace doesn't split the way I want it too, none of the values have any whitespace in them except for the way the output is formatted.

could someone help me figure out why its not happening like I want it to.

Thanks

--
Rance Hall
System Administrator
Nebraska Turkey Growers
1-308-468-5711, ext. 106
[EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to