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]




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


German Perl/Raku Workshop 2024 recordings on YouTube submitted by /u/Adriaaaaaaaan
[link] [comments]


On this site: https://codegolf.stackexchange.com/questions/246845/convert-json-object-of-directories-to-list-of-paths

There is an interesting perl solution but I'm trying to wrap my head around it and am baffled.

map/}/?/{/&&say($s)..$s=~s|[^/]+/$||:($s.=s/"//gr."/"),/{?}|".+?"/g When I do a simple test: my $s = <some json string> .. the map above I don't get any output. Thanks in advance 

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


I have a bunch of files that I am parsing out a simple tag
<institution content-type="division">(.+?)?<\/institution>

Everything is going fine until I hit this result:
2) School of Chemical &amp; Biomolecular Engineering

This is complaining because it thinks the ) is unmatched. How do I get it to accept whatever is in the capture? I tried playing around with \Q and \E but that isn't working. For clarity, I won't know what is in this tag, it could be anything at all and the tag is simple enough that I don't want to use some XML parser.

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




Mo utilities for email.

Changes for 0.02 - 2024-04-26T23:02:53+02:00

  • Add tests for error parameters.
  • Rewrite the tests so that the functional tests are first and then the errors.






Perl profiling made simple to use.

Changes for 0.01 - 2024-04-26

  • First version.


Fork Based Promise with Asynchronous Execution, Async, Await and Shared Data

Changes for v0.4.11 - 2024-04-25T23:38:38Z

  • Minor corrections in resolve to pass the variable $_ to the sub routine called in then()
  • Improvements allowing embedded promises


Generic Module to inherit from

Changes for v0.35.4 - 2024-04-26T13:55:12Z

  • Minor improvements to Module::Generic::SharedMemXS



Hi! Asking for a wisdom here...

We have a module that modifies signal handler $SIG{__DIE__} to log information and to die afterwards. Hundreds of scripts relied on this module which worked fine in perl 5.10.1.

Recently we had the opportunity to install several Perl versions but unfortunately a large number of scripts that used to work with Perl 5.10.1 now behave differently:

  • Failed in 5.14.4: /home/dev/perl-5.14.4/bin/perl -wc test.pl RECEIVED SIGNAL - S_IFFIFO is not a valid Fcntl macro at /home/dev/perl-5.14.4/lib/5.14.4/File/stat.pm line 41
  • Worked without changes in 5.26.3: /home/dev/perl-5.26.3/bin/perl -wc test.pl test.pl syntax OK
  • Worked without changes in 5.38.2: /home/dev/perl-5.38.2/bin/perl -wc test.pl test.pl syntax OK

Many of the scripts can only be updated to 5.14.4 due to the huge jumps between 5.10 and 3.58; But we are stuck on that failures.

Was there an internal Perl change in 5.14 which cause the failures but works on other recent versions without any update on the scripts?

Cheerio!

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



Sanity-check calling context

Changes for 0.04

  • (no code changes)
  • Switched to MIT license.
  • Switched README from POD to Markdown.
  • Removed Travis CI.



Sort lines of text by a Comparer module

Changes for 0.002 - 2024-03-07

  • No functional changes.
  • [doc] Mention some related links.


An assortment of date-/time-related CLI utilities

Changes for 0.128 - 2024-03-07

  • [clis strftime, strftimeq] Use localtime() instead of gmtime(). We can still show UTC using "TZ=UTC strftime ...".