Skip to main content



Sorry I didn't get this out here earlier (and it's an xpost from Perlmonks), but Perl Community (parent org of the Science Perl Committee that is initiated the Science Track) is giving out a "peoples choice" award at the end of Conference Lightning Talks. It's sincere gesture from us and allows anyone to vote for anyone in the Perl community at large, as a "thank you" from us.

link to Google voting form

The Science Track talks have been great, some are even starting to come online. Thanks to everyone who made this happen, especially the TPRC Planning Committee.

submitted by /u/OODLER577
[link] [comments]



I am using Selenium to obtain a numeric value from a website with code such as:

my @divwrap = $driver->find_elements('whatever', 'id'); my $return_value = $driver->find_child_element($divwrap, 'changeValue', 'class')->get_text(); 

This works fine, and returns the correct expected value.

If the value is POSITIVE, it return the plus sign, such as "+64.43"

But if the value is NEGATIVE, it returns a "wide Character" string: "" instead of the minus sign.

So the return looks like "64.43"

Interestingly, I cannot do a substitution.

If I have explicit code, such as:

my $output = "64.43" ; $output =~ s/"/\-/ ; 

... then $output will print as "-64.43"

... but if I try to do the same substitution on the return from the find_child_element function:

$return_value =~ s/"/\-/ ; 

... the substitution does not take... and printing $return_value continues to output "64.43".

Any ideas why it doesn't... and how to solve it?

submitted by /u/AvWxA
[link] [comments]



I’m a dev with 20yoe in mostly Java and js but have various amounts of experience with other languages. I’ve decided that I need Perl in my toolkit because I find it on even the most minimal boxes preinstalled and I can’t always install Java or Js just to do admin things. Typically I use bash for these tasks but I just need a little more ability to abstract than what bash easily provides. What would you all recommend as the place to start? Most guides that I run into assume that I’m a beginner to programming and it feels slow. My normal method of learning a new language is to stumble through building a web server but I’m not sure that the way to go here.

submitted by /u/Jjabrahams567
[link] [comments]



I am working with the IP::Geolocation::MMDB module which replaces the deprecated modules for GeoIP databases.

I am having trouble understanding how to extract data.

my $ip = "8.8.8.8"; my $db = IP::Geolocation::MMDB->new(file => "$geolitecitydb"); my $geodata = $db->record_for_address($ip); print Dumper($geodata); 

Using Data::Dumper as above to show the results, I see something like (truncated):
Dumper...........$VAR1 = { 'continent' => { 'geoname_id' => 6255149, 'names' => { 'de' => 'Nordamerika', 'es' => "Norteam\x{e9}rica", 'zh-CN' => "\x{5317}\x{7f8e}\x{6d32}", 'ru' => "\x{421}\x{435}\x{432}\x{435}\x{440}\x{43d}\x{430}\x{44f} \x{410}\x{43c}\x{435}\x{440}\x{438}\x{43a}\x{430}", 'fr' => "Am\x{e9}rique du Nord", 'ja' => "\x{5317}\x{30a2}\x{30e1}\x{30ea}\x{30ab}", 'en' => 'North America', 'pt-BR' => "Am\x{e9}rica do Norte" }, 'code' => 'NA' 

Supposing I just want to grab the value of continent=>names=>en portion (value: 'North America') and write it to a value -- how would I do this? I'm having problems understanding the documentation I'm reading to deal with hashes of hashes.

Most examples I can find online involve looping through all of this; but in my case, I just want to make $somevar = 'North America.' I'd like to repeat it for other data as well, which is returned in this hash.

It feels like something like:

$geodata{city=>names=>en} should work, but it doesn't.

submitted by /u/SqualorTrawler
[link] [comments]