Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of Uninitialised Value In Split 1

Status
Not open for further replies.

sdslrn123

Technical User
Jan 17, 2006
78
GB
Hi again. For those who know me you'll be gald to know I solved the other problem.... :)
But, now I have a new one.

However, although the program works this line is giving me errors:
Code:
@host = split(';',$guests[0]);

"Use of uninitialised value in split"

What is wrong? I have declared my @host and @guests as well as trying $guests alongside.

Thanks for looking

 
Code:
@guests = split (/1/, $file);
Splits $file into two parts as 1 is the only number in a sequence of letters e.g
A B C D E F G 1 H I J K L
therefore $guests[0] = ABCEDEFG

Hope this helps
 
and if you print out $guests[0] does it contain what you expect?

Mike

I am not inscrutable. [orientalbow]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Yep, Prnts exactly what I want.
It's a bit of a puzzler?
 
If you are looping through an array or a file maybe there is a line without the 1 in it or a blank line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top