#!/usr/bin/perl # simple script to print out an HTML table. # Chris Seidel print "How many Rows? "; $_ = <>; unless (/\d/i) { print "I'm sorry to hear that!\n"; die; } $rows = $_; chop ($rows); print "How many Columns would you like?\n"; $_ = <>; unless (/\d/i) { print "I'm sorry to hear that!\n"; die; } $columns = $_; chop ($columns); open(RESULT, ">table.txt") ||die("can't open file"); print RESULT "\n"; &makeRows($rows, $columns); print RESULT "
\n"; print "Rows = $rows, Columns = $columns\tDone\n"; &MacPerl'Quit(1); sub makeRows { my($rows, $columns) = @_; for( $r=0, $r_label=1; $r < $rows; ++$r, ++$r_label){ print RESULT "\n"; print RESULT "\n"; for( $c=0; $c < $columns; ++$c){ print RESULT " \n"; print RESULT " \n"; } print RESULT "\n"; } }