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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling File Data

Status
Not open for further replies.

xS73v3x

Programmer
Jan 31, 2003
11
US
Hey im just playing around with perl (ive made a poll and a crappy message board-type-thing) and right now when i make my data i spereate similar pieces of information with special characters and later split() it. like for example if this was my forum data it would go, subject, author, message like so:

Hi!`!
Me!`!
Whats up in the house
~=~
Whoa!`!
Bob!`!
Shut yo mouth

so if i wanted to split up the posts it would go like

@TheData = <MYFILE>;
$TheData = @TheData;
@Posts = split(/~=~/, $TheData);

and voila i have an array of posts, and if i want to split it up by subject author and message i just do it again to the @Posts array.

Does anyone know an easier way to seperate data and get it?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top