On Aug 4, Perl said:
>die "You must enter an argument. \n" if $#ARGV <0;
I'd suggest using:
die ... if @ARGV == 0;
because it's easier to read and understand.
>$logfile = chomp ($ARGV);
Is that really your code? That doesn't make any sense to me. I think you
meant:
$logfile = $ARGV[0];
The table is fairly complicated. I'll take a look at those modules
though. Thanks!
-Original Message-
From: Chris Devers [mailto:[EMAIL PROTECTED]
Posted At: Wednesday, August 04, 2004 5:03 PM
Posted To: Perl
Conversation: Sorting HTML tables
Subject: Re: Sorting HTML tables
On W
On Wed, 4 Aug 2004, Perl wrote:
I wrote some code to identify and print HTML tables below
Don't do that.
HTML is tremendously difficult to analyze properly with tools like
regular expressions.
You're much, much better off using a proper parser library that can
build up a tree model of the html t
I wrote some code to identify and print HTML tables below:
use strict;
my @table;
my $logfile;
my $counter;
my $inc;
my @array;
die "You must enter an argument. \n" if $#ARGV <0;
$logfile = chomp ($ARGV);
foreach my $line(<>){
if ($line =~ /(TABLE)(.+)/) {
$inc++;