print "Do you have any images? "; chomp($image_answer = <STDIN>); if($image_answer eq "yes" || $image_answer eq "y") { print "How many? (1-4) "; chomp($numPics = <STDIN>); &makeTable($numPics); } elsif($image_answer eq "no" || $image_answer eq "n") {print "No soup for you!\n";} sub makeTable { if($numPics==1){ print NEWCONTENT "<TABLE><TR><TD>"; print "Name of image 1: "; chomp(<STDIN>=$name1); print NEWCONTENT "<IMG SRC=pics/$name1></TD>"; print NEWCONTENT "<TD><IMG SRC=pics/spacer.gif></TD</TR> \n"; print NEWCONTENT "</TABLE>"; print "Table for 1 created"; } elsif(numPics==2){ print NEWCONTENT "<TABLE><TR><TD>"; print "Name of image 1: "; chomp(<STDIN>=$name1); print "Name of image 2: "; chomp(<STDIN>=$name2); print NEWCONTENT "<IMG SRC=pics/$name1></TD>"; print NEWCONTENT "<TD><IMG SRC=pics/$name2></TD></TR> \n"; print NEWCONTENT "</TABLE>"; print "Table for 2 created"; } elsif(numPics==3){ print NEWCONTENT "<TABLE><TR><TD>"; print "Name of image 1: "; chomp(<STDIN>=$name1); print "Name of image 2: "; chomp(<STDIN>=$name2); print "Name of image 3: "; chomp(<STDIN>=$name3); print NEWCONTENT "<IMG SRC=pics/$name1></TD>"; print NEWCONTENT "<TD><IMG SRC=pics/$name2></TD></TR> \n"; print NEWCONTENT "<TR><TD><IMG SRC=pics/$name3></TD>"; print NEWCONTENT "<TD><IMG SRC=pics/spacer.gif></TD</TR> \n"; print NEWCONTENT "</TABLE>"; print "Table for 3 created"; } elsif(numPics==4){ print NEWCONTENT "<TABLE><TR><TD>"; print "Name of image 1: "; chomp(<STDIN>=$name1); print "Name of image 2: "; chomp(<STDIN>=$name2); print "Name of image 3: "; chomp(<STDIN>=$name3); print "Name of image 4: "; chomp(<STDIN>=$name4); print NEWCONTENT "<IMG SRC=pics/$name1></TD>"; print NEWCONTENT "<TD><IMG SRC=pics/$name2></TD></TR> \n"; print NEWCONTENT "<TR><TD><IMG SRC=pics/$name3></TD>"; print NEWCONTENT "<TD><IMG SRC=pics/$name4></TD</TR> \n"; print NEWCONTENT "</TABLE>"; print "Table for 4 created"; } else print "Number entered is not within accepted paramters. \n"; }
In reply to HTML and Perl by Kones
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |