
lost
Deleted
Feb 9, 2001, 2:40 PM
Post #1 of 1
(210 views)
|
|
sorting and putting data in table
|
Can't Post
|
|
Hello. I need to some help to do the followings: I had created a form to collect data and save in a file separate by | open (INFO, "$file_name"); @data = <INFO>; foreach $data (@data) { ($1, $2, $3, $4, $5, $6, $7) = split(/\|/ , $data); } I want to open this file, pull out data and put them in the table as: if $2 eq 'C' && $6 eq 'G' then put $2 and $6 in the first table cell if $2 eq 'A' && $6 eq 'D' then put $2 and $6 in the second table cell if $7 eq 'E' then put it in the third table cell. I used: if ($2 eq 'C' && $6 eq 'G') { print "$2 and $6\n"; } But it does not display info if one of the 7 field is empty | | I have to have ALL 7 fields in order to work. Why is this? and how can I fix it. Any help is appreciated. I am tring to learn perl by writing cgi scripts.... THNX
|