File: prep_files

package info (click to toggle)
covered 0.7.10-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,040 kB
  • sloc: ansic: 48,809; yacc: 11,650; xml: 8,838; tcl: 7,698; sh: 3,925; lex: 2,240; makefile: 362; perl: 329
file content (27 lines) | stat: -rwxr-xr-x 591 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

&transform( "example.v" );
&transform( "example.rptM" );
&transform( "example.rptI" );

sub transform {

  my $file = $_[0];

  open( IFILE, "${file}" ) || die "Cannot open ${file} for reading: $!\n";
  open( OFILE, ">${file}.html" ) || die "Cannot open ${file}.html for writing: $!\n";

  print OFILE "<html><body><pre><code>\n";
  $line_num = 1;
  while( <IFILE> ) {
    chomp;
    print OFILE sprintf( "<a name=\"%d\">%7d</a>  %s\n", $line_num, $line_num, $_ );
    $line_num++;
  }

  print OFILE "</code></pre></body></html>\n";

  close( IFILE );
  close( OFILE );

}