use strict ;
package printAscii ;
sub main
{
my $table = "" ;
my $html = "" ;
for ( my $i = 0 ; $i< 128 ; $i ++ )
{
print "\$i is $i \n" ;
my $row = makeCell ( $i ) . makeCell (chr($i)) ;
$row = makeRow($row);
$table .= $row ;
} #eof for
$table = makeTable ($table ) ;
print $table ;
$html = makeHtml ( $table ) ;
PrintToFile ( "ascii.html" , $html ) ;
} #eof main
sub makeRow
{
my $row = shift ;
return "<tr> $row </tr> \n" ;
}
sub makeCell
{
my $cell = shift ;
return "<td> $cell </td> " ;
}
sub makeTable
{
my $table = shift ;
return "<table> $table </table> " ;
}
sub makeHtml
{
my $html = shift ;
$html = "<html> <head></head><body> $html </body></html>\n" ;
}
sub PrintToFile {
my $FileOutput = shift ;
my $StringToPrint = shift ;
open (FILEOUTPUT, ">$FileOutput") ||
print "could not open the \$FileOutput $FileOutput!\n";
print FILEOUTPUT $StringToPrint ;
close FILEOUTPUT ;
} #eof sub
# =========================================== eof sub PrintToFile
#Action !!!
main();
1 ;
__END__
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!