develooper Front page | perl.beginners | Postings from January 2002

split and extraction

Thread Next
Dhiraj P Nilange
January 30, 2002 07:21
split and extraction
Message ID:

Hi there

I want to extract some word after space from some string.
Somebody from the mailing list had given me above

suppose I wanto extract 8th word...

#suppose $abc  has the string;
$abc=split[/\s+/]->[8];   #somebody told me like this.

but it doesnt work. if i use some array in the split function like:-

print $array[8];

this way it works. But I dont want to use array. Its newbie question actually.

pls help.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About