Using perl Syntax Highlighting
- #!/usr/bin/perl
- use strict;
- use Data::Dumper;
- my @linea;
- my $contador;
- my $i;
- my $j;
- my @long;
- open( FICHERO, "../ficheros/tabla" );
- open( HTML, ">../ficheros/tabla.html" );
- while (<FICHERO>) {
- my @columna;
- @columna = split;
- $linea[$contador] = \@columna;
- $contador++;
- }
- print HTML "<html><body><table border=\"1\">";
- for ( $i = 0; $i <= $#linea; $i++ ) {
- print HTML "<tr>";
- @long = @{ $linea[$i] };
- for ( $j = 0; $j <= $#long; $j++ ) {
- print HTML "<td>" . $linea[$i][$j] . "</td>";
- }
- print HTML "</tr>";
- }
- print HTML "</table></body></html>";
- close FICHERO;
- close HTML;
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4