Perl Help (possible split)
Hi, I have problems with the out of a script so i was wonder if anyone could help me
I m reading from a database that is set up by pipe only reading in persons name and favorite num
Jamie|8
Joe|45
Jessica|8
bob|7
like that for example
this is hte output of the script
Jamie|8
name: J
fav: a
Jamie|8
name: J
fav: a
Jamie|9
name: J
fav: a
Jamie|10
name: J
fav: a
this is the routine
sub readfile
{
open READ, "tst.db";
while ( $line = <READ>)
{
chomp;
print "$line<br>";
($nam1, $num1) = split (/|/, $line);
print "name: $nam1<br>";
print "fav: $num1<br>";
}
}
I dont understand why the spilt is splitting like that if someone could please help it would be grealy appeiacted
Jamie
|