On Thu, Mar 2, 2017, 19:32 Shawn H Corey wrote:
> On Thu, 2 Mar 2017 16:35:17 -0600
> Andy Bach wrote:
> > Hah! "undef" is an uninitialized value !
>
> $ perl -we 'if (not $interdest5) {$interdest5 = "";} print
> "|$interdest5|\n"'
> ||
> $ perl -we 'if (! $interdest5) {$interdest5 = "";} print
Take a look a WWW::Mechanize. The older web suite LWP is an
alternative and that may be enough if you only need a specific
item. LWP::Simple is a possibility to see if you can mine the info
from the page. If there's more complexity, then LWP::UserAgent
is a starting point.
A couple of books too:
On Thu, 2 Mar 2017 16:35:17 -0600
Andy Bach wrote:
> if ( not defined $interdest5 ) ...
>
> defined() is the built in function. "undef" is a value ... not sure
> why you don't get a syntax error there but, most likely, the if quits
> at seeing "undef" as it's "false"
>
> perl -we 'if (undef $
Hello,
Can you suggest some effective ways to parse multiple web pages from the
web site.
I cannot use web crawling as the format of the pages is not same. I am
interested in the data from specific table on each page.
Thanks in advance.
Kavita
On Thu, Mar 2, 2017 at 1:57 PM, Danny Spell wrote:
>
> So I'm like, a-ha!, I know I'll add this before the return in the routine.
> if (undef $interdest5) {$interdest5 = "";}
>
if ( not defined $interdest5 ) ...
defined() is the built in function. "undef" is a value ... not sure why
yo
On Thu, 2 Mar 2017 12:29:42 -0600
Danny Spell wrote:
> Line 57 is "last if ($interdest5 ne "");".
>
> Why does Perl say it is uninitialized ?
> I thought I took care of that in two places. Once when it was
> declared and and again within the loop.
Because you assign it a value in this statement
sub mexicoRouteCheck{
my $interdest5 = "";
($cc) = @_;
$sth_mex = $dbh->prepare("select interdest5 from mexicoRoutingCodes
where digits = ? ");
for($l=6; $l>3; $l--){
$interdest5 = "";
$sth_mex->execute( substr($cc,0, $l) );
On Thu, Mar 02, 2017 at 04:50:32PM +, mailing lists via beginners wrote:
>
>
> just to clarify, the real purpose of the script is output the hash to a json
> object, so the json output for the script:
So you have to "numify" your number:
https://metacpan.org/pod/JSON::PP#PERL-%3E-JSON
>
See docs https://metacpan.org/pod/JSON::PP#simple-scalars
You do print Dumper on hash, it stringifies all hash values, so you see
such an obscure result for encode_json.
If don't dump $hash before encode json you get what you want -
work_hours_to_float_try2 is json valid number
{"work_hours
On Thu, 2 Mar 2017 16:50:32 + (UTC)
mailing lists via beginners wrote:
> $VAR1 = {
> 'work_hours_to_float_try3' => '5.2',
> 'work_hours_to_float_try2' => '4.1',
> 'work_hours' => '4.1',
> 'work_hours_to_float_try1' => '4.10'
> };
> {"work_hours_to_float_try3":"5.2","work_hours_to_float_try2":
just to clarify, the real purpose of the script is output the hash to a json
object, so the json output for the script:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use JSON::PP;
my ($input_string, %job_task);
sub sanitize_data{
my $data = shift;
$data->{'work_hours'} = (split
This year we are holding the largest North-America Perl Conference in
Washington, DC, at the US Patent and Trademark Office. It's a high-quality,
inexpensive technical conference with its roots in the Perl Mongers user
groups. The conference celebrates the Perl programming language and
community, a
Helo all,
what I am trying to do is convert a value contained whitin a hash from string
to float, but I fail to find the error, this is that I have tried:
$ cat test.pl
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my ($input_string, %job_task);
sub sanitize_data{
my $data = sh
13 matches
Mail list logo