Not sure whether this is the right forum to post in.
I would also like to preface this with the fact I know nothing about perl, so please keep it basic!
I have created the following script to download data from a website. It works fine but there are large gaps in the data (I want a nice neat table to go into Geektool on my desktop). I want to add
which worked fine when I used a mixture of curl and perl but wherever I try it in the script it either doesn't work or breaks things. I've been googling and reading perl tuts for about a week now but I just can't get a hook in anywhere. I would be very grateful if anyone could explain where I need to put the substitution. Thanks in advance.
I tried posting this to perl.beginners on usenet but I guess it must be too basic as the mods don't seem to be adding it :-S
I would also like to preface this with the fact I know nothing about perl, so please keep it basic!
I have created the following script to download data from a website. It works fine but there are large gaps in the data (I want a nice neat table to go into Geektool on my desktop). I want to add
Code:
s/\t||\r||\n||\f//g
Code:
#!/usr/bin/perl
use strict;
use warnings;
use HTML::TableExtract;
use WWW::Mechanize;
my $url = "http://www.example.com";
my $mech = WWW::Mechanize->new();
$mech->agent_alias( 'Mac Safari' );
$mech->get( $url );
my $te = HTML::TableExtract->new( headers => [qw(Company Salary)] );
$te->parse($mech->content);
foreach my $row ($te->rows) {
print join(' - ', @$row);
}
I tried posting this to perl.beginners on usenet but I guess it must be too basic as the mods don't seem to be adding it :-S