#!/usr/bin/perl # Line Count 2009 expanding head # Displays a local file line by line to # aid in debugging. Enter relative path # to the file you wish to view. my ($q, $file, @lines, $lines); use CGI qw(:standard); use strict; use warnings; print header,start_html(-title =>'Line Count', -author =>'expandinghead.net', -bgcolor => '#ffffff', -text => '#000000'), p,h1('Line Count'),p,'enter the relative file path',hr, start_form,table(Tr([ td(['File ',textfield(-size=>50,-name=>'file')]), td([submit(undef,' Submit '),reset]), ])),end_form; if (param()) { $file = param('file'); open(INFO, $file) or die "Could not find $file: $!"; @lines = ; close(INFO); $lines = @lines; print p,'File : ',$file,br,'Lines counted : ',b,$lines,p,ol; foreach $lines (@lines) { $lines =~ s//>/g; print li,$lines; } print ol,p; } print h5('expanding head'),end_html;