Bret Goodfellow [BG], on Wednesday, June 22, 2005 at 15:55 (-0600)
wrote these comments:

>This is what I actually did to resolve my issue:
>@words = split(/ * /, $line)
>Print "the third word is: $words[2]\n";

this is not good, you don't know about regexpes much, eh?
first argument in split is //, where inside of those braces is regexp.
What you have will work, but it is possible, you have input
delimited with tabulators, and your example will not work. This is
better:
@words = split(/\s+/, $line);

this say, $line will split into @words, where delimiter is one or more
white characters (including tabs ofcoz)

-- 

How do you protect mail on web? I use http://www.2pu.net

[An android chaperone? * K'Ehleyr]



-- 
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