I'm guessing you want to output this to a web page rather than the console then? If so, you'll want to put a tag before or after the in the print statement. Then there will be one item per line (e.g a vertical list). Newline characters don't count for much in HTML, you need to specify if you want to start a new line.
Of course, if this was outputting to the console, having floating around all over would be messy too... So I figured I could leave it to you to sort out the easy bit of how you wanted to lay it out! :-)
Comments
Loads of ways of doing this. Here's how I might go about it depending on the problem I wanted to solve.
[code]
#Open file.
open FILE, ") {
#Split up line into an array.
chop;
my @line = split(/|/);
#Suppose we want to print Mike and Dan...
print "$line[0]
";
}
#Close file.
close FILE;
[/code]
What you're looking for? I think you could also get it using a reg exp in the loop, maybe like this:-
[code]#Go through each line in the file.
while () {
#Extract bits we want.
m/(.*)|.*/is;
#Suppose we want to print Mike and Dan...
print "$1
";
}
[/code]
I'm pretty sure first will work, ain't tested the second or done it that way, but occurs to be it could be done like that.
TMTOWTDI... ;-)
Jonathan
-------------------------------------------
Count your downloads:
http://www.downloadcounter.com/
And host your site:
http://www.incrahost.com/
Don't say I never give you anything... ;-)
The way that you showd, gave a messy horizontal one...
Thanx ^_^
I'm guessing you want to output this to a web page rather than the console then? If so, you'll want to put a
tag before or after the
in the print statement. Then there will be one item per line (e.g a vertical list). Newline characters don't count for much in HTML, you need to specify if you want to start a new line.
Of course, if this was outputting to the console, having
floating around all over would be messy too... So I figured I could leave it to you to sort out the easy bit of how you wanted to lay it out! :-)
Hope this is what you meant anyway,
Jonathan
-------------------------------------------
Count your downloads:
http://www.downloadcounter.com/
And host your site:
http://www.incrahost.com/
Don't say I never give you anything... ;-)