[link] [comments]
(cdxcix) 11 great CPAN modules released last week
Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12. Ali...niceperl.blogspot.com
I know it is something of an obscure corner of everything that Perl can do, but Perl is excellent for "one-liners".
Has anyone developed a module of convenience functions for use with one-liners? I have something in progress but I'd like to see if there is established prior art.
submitted by /u/singe
[link] [comments]
Stack:
Nginx FCGI CGI::Fast HTML::Template::Compiled Redis CentOS Linux 7.9 spawn-fcgi
I have a Perl application that runs on the above stack.
On process init it does a lot of loading of big hashes and other data into global variables that are mostly preloaded and cached in a distributed Redis install.
To start the application spawn-fcgi creates 6-8 processes on a port nginx then connects to trhough their fcgi module.
The challenge:
— The init process is computing and time consuming; and doing that concurrently six times peaks CPU and overall leads to a ~20-25 second delay before the next web request can be served. And the initial request to each of the six processes has that delay.
I tried loading the content in question directly from Redis on demand but the performance keeping it in memory is naturally much better (minus the initial delay).
is there an architectural pattern that I am not considering here? I am thinking of things as eg. only spinning up one process, having it initialize and then clone(?) it a few times for serving more requests.
I could also think of a way where only 1 process is spawned at a time and once it completes initiation the next one starts; would need to verify that spawn-fcgi can support this.
So my question to this community is if I am missing an obvious better solution than what is in place right now / what I am considering.
Thanks in advance.
submitted by /u/kosaromepr
[link] [comments]
I am moving a pile of stuff off of an older Intel Mac Mini onto an M2. Have almost everything migrated, but am stuck on getting a Perl script that relies heavily on DBD::mysql to work. I finally got cpan to build the module, but when I try to use it in actual code, I get: dyld[82852]: missing symbol called. I go through this mess periodically with OS upgrades...and it's possible that this is (once again) OSX ignoring the module because it's not signed. But the given error sounds more like Perl not finding the dynamic library(s) the module was built with...if I just have a script containing "use DBD::mysql;", that doesn't throw an error, which suggests Perl found the module and loaded it. But chokes when it tries to use it.
I'd be fine with building this module with static libraries, if the process of doing so is easy. But have not seen an easy option to cpan to go that route. Suggestions?
submitted by /u/rlmalisz
[link] [comments]
my $result = $some_value / scalar(split(",", $some_array[0]));
submitted by /u/secreag
[link] [comments]
[link] [comments]
(cdxciii) 15 great CPAN modules released last week
Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12. App...niceperl.blogspot.com
Although Benchmark::DKbench is a good overall indicator for generic CPU performance for comparing different systems (especially when it comes to Perl software), the best benchmark is always your own code. Hence, the module now lets you incorporate your own custom benchmarks. You can either have them run together with the default benchmarks, or run only your own set, just taking advantage of the framework (reports, multi-threading, monotonic precision timing, configurable repeats with averages/stdev, calculation of thread scaling etc). Here's an example where I run a couple of custom benchmarks on their own with Benchmark::DKbench:
``` use Benchmark::DKbench;
A simplistic benchmark sub:
sub str_bench { for (1..1000) { my $str = join("", map { chr(97 + rand(26)) } 1..rand(15000)); $str =~ s/a/bd/g; $str =~ tr/b/c/; } }
my %stats = suiterun({ include => 'custom', # Run only my custom benchmarks iter => 5, # Iterations to get an average extra_bench => { custom_bench1 => [&str_bench], # Add one more, just inline this time: custom_bench2 => [sub {my @a=split(//, 'x'x$) for 1..5000}], } }); ``` This will produce a report in STDOUT and also return the results in a hash for a single-thread run. You can also run the benchmarks multi-treaded and then calculate & print the multi/single-thread scalability:
```
If you want to get a count of logical cores:
my $cores = system_identity(1);
my %statsmulti = suite_run({ include => 'custom', threads => $cores, iter => 5, extra_bench => { custom_bench1 => [&str_bench], custom_bench2 => [sub {my @a=split(//, 'x'x$) for 1..5000}], } });
my %scal = calc_scalability(\%stats, \%stats_multi); ```
The report prints results per iteration and also aggregates:
``` Aggregates (5 iterations): Benchmark Avg Time (sec) Min Time (sec) Max Time (sec) custom_bench1: 1.092 1.079 1.107 custom_bench2: 0.972 0.961 0.983 Overall Avg Time (sec): 2.065 2.048 2.080
Aggregates (5 iterations, 10 threads): Benchmark Avg Time (sec) Min Time (sec) Max Time (sec) custom_bench1: 1.534 1.464 1.651 custom_bench2: 1.278 1.225 1.345 Overall Avg Time (sec): 2.812 2.689 2.965 The scalability report summarizes as well:
Multi thread Scalability: Benchmark Multi perf xSingle Multi scalability % custom_bench1: 7.12 71
custom_bench2: 7.61 76
DKbench summary (2 benchmarks, 5 iterations, 10 threads): Single: 2.065s Multi: 2.812s Multi/Single perf: 7.36x (7.12 - 7.61) Multi scalability: 73.6% (71% - 76%) ```
The suite normally uses a scoring system which works better than times, so you can set that up by adding reference times to each benchmark, and you can also make the benchmarks return something (checksum etc) to verify results etc, see POD for more.
submitted by /u/dkech
[link] [comments]
From the tprc-general Slack channel, Todd Rinaldo wrote yesterday that "Talk Accept, Decline, Waitlist emails have been sent out." See tprc.us for more information about this year's Perl and Raku Conference in Las Vegas, NV.
submitted by /u/talexbatreddit
[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.
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 SortKey module
Changes for 0.001 - 2024-03-07
- First release.
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 ...".
I understand that many disagree with this statement, but it really makes it easier to build distributions for people who not monks. Wish the documentation was more detailed
submitted by /u/ReplacementSlight413
[link] [comments]
Sah schemas related to BCA (Bank Central Asia) bank
Changes for 0.002 - 2024-04-03
- Rename module/dist Sah-Schema{s,Bundle}-* following rename of Sah-Schema{s,Bundle} (for visual clarity and consistency with naming of other bundles).
search nested hashref/arrayref structures using JSONPath
Changes for 1.0.5 - 2024-04-22T16:10:46-05:00
simulating paper and pencil techniques for basic arithmetic operations
Changes for 0.01 - 2024-04
- First version, with the four basic operations, plus square-root, GCD and radix conversion. And HTML rendering
Use a type to validate values in a deep comparison.
Changes for 1.0.1 - 2024-04-22
- Add Test2::Tools::Type
submitted by /u/leejo [link] [comments] |
London Perl & Raku Workshop, 2024
London Perl & Raku Workshop. Perl & Raku Conference and training in London.act.yapc.eu
Pango style markup formatting
Changes for 0.036 - 2024-04-22
- Introducing struts. Update SYNOPOSIS example to modern PDF::API2 conventions. Fix/enhance drawing of brackgrounds. Fix problem with wrongly calculated underlining.
My environment is perl/5.18.2 on CentOs 7
I'm trying to use a SWIG generated module in perl, which has a c plus plus backend. The backend.cpp sets an environment variable, $MY_ENV_VAR =1
But when I try to access this in perl, using $ENV{MY_ENV_VAR} this is undef.
However doing something like print echo $MY_ENV_VAR
works
So the variable is set in the process, but it's not reflected automatically since nothing updates the $ENV data structure.
I'm assuming it may work using some getEnv like mechanism, but is there a way to reset/ refresh the $ENV that it rebuilds itself from the current environment?
submitted by /u/sarcasmwala
[link] [comments]
By default cpanm drops Perl modules into ~/perl5
. How do I tell cpanm to use a different location, such as ~/.local/share/perl5
instead?
submitted by /u/s-ro_mojosa
[link] [comments]
Get stock and mutual fund quotes from various exchanges
Changes for 1.61_01 - 2024-04-21T17:50:16-07:00
- YahooWeb.pm - Issue #377. Modified YahooWeb to account for changes from Yahoo.
Sah schemas related to SortKey
Changes for 0.002 - 2024-03-07
- Rename module/dist Sah-Schema{s,Bundle}-SortKey.
Perl Data Language
Changes for 2.088 - 2024-04-22
- Slatec::ch{ic,sp} work arrays now [t]
- add Slatec::bvalu
- add Func::{pchip,spline}, and a demo
- add Ufunc::diff2
- extra ) on end of Pars now an error
- PP dim sizes can be =CALC(...) instead of explicit RedoDimsCode
- PP add loop(n=start:end:inc) idiom to stop not at end and have non-1 inc
- updated README.md - thanks @falsifian
- support T_PTROBJ in typemap
an interactive plotting widget and library for PDL and Prima
Changes for 0.21 - 2024-04-22
- demo now only loads Prima when run, reducing perldl problems
demonstrate PDL::Graphics::PLplot capabilities
Changes for 0.84 - 2024-04-22
- add perldl demo
- fix plFreeGrid to use free that matches the allocator
- pl{Alloc,Free}{,2d}Grid error if not match allocating and freeing routine
- minimum PDL 2.083 due to output OtherPars
Fast Perl SSG: now with automatic Language Translation via OCI and translate.pl. Check it out at
https://github.com/SunStarSys/orion
submitted by /u/joesuf4
[link] [comments]
GitHub - SunStarSys/orion: SunStar Systems' Orion Enterprise Wiki SSG
SunStar Systems' Orion Enterprise Wiki SSG. Contribute to SunStarSys/orion development by creating an account on GitHub.GitHub
Tags helper for table view.
Changes for 0.06 - 2024-04-21T17:26:14+02:00
- Fix of setting of table data. Copy in this time.
Tags helper for CPAN::Changes object.
Changes for 0.04 - 2024-04-21T16:06:08+02:00
- Add trivial Changes file and test on it.
- Fix output on ex1.changes test file.
parses .pm file as PAUSE does
Changes for 0.47 - 2024-04-21
- Improve class detection
Plack application for running Tags::HTML objects.
Changes for 0.17 - 2024-04-21T12:34:17+02:00
- Add test for 'css_data'.
- Rewrite examples in doc to version with indented output.
Perl extension for finding the memory usage of Perl variables
Changes for 0.83_50 - 2024-04-21
- patch from Slaven:
- CvOUTSIDE is again set on all cloned subs [CPAN #149902]
Choose items from a list interactively.
Changes for 1.764 - 2024-04-20
- Code refactoring.
Tags helper class for image presentation.
Changes for 0.01 - 2024-04-20T15:31:29+02:00
- First version.
Data object for image.
Changes for 0.04 - 2024-04-20T15:30:30+02:00
- Add check location for url.
- Add test for author error.
- Improve doc.
- Improve test in constructor to full-fledged object.
- Update copyright years.
Tool to fetch module from CPAN archive.
Changes for 0.10 - 2024-04-20T14:51:38+02:00
- Add tests for App::CPAN::Get::MetaCPAN.
- Improve abstract.
- Improve check for LWP::UserAgent.
- Improve constructor tests of App::CPAN::Get.
- Rewrite from Menlo::Index::MetaCPAN to own implementation.
- Update copyright years.
Interaction with OpenExchangeRates API
Changes for 0.001 - 2024-04-20T11:44:47+00:00
- Initial Release