Is it possible to display an image to the user, without loading all the trappings of a whole widget / event-loop environment like Prima, Tk, Wx, Win32::GUI, etc?
Specifically, I want something simple that I can execute in a BEGIN block to display a splash image to the user while the rest of the application is compiled and initializes, which takes about 5-10 seconds. The program in question is a perl Wx application running under MS Windows.
submitted by /u/sue_d_nymme
[link] [comments]
I am making a script with multiple threads, and one of the threads I wish to make is a "cpu usage monitoring thread" that checks both "overall" cpu usage and the "current script cpu usage" or external PID cpu usage.
Then I can decide if any of my threads need to sleep for the moment while CPU is recovering from something (like maybe its executing something heavy) then my perl script needs to adjust.
I wish it will also be EFFICIENT and ACCURATE as much as possible. I don't want the perl script have high CPU usage. Cross Platform would be nice, but if a Windows Solution is more efficient. Please share.
For now I can't find any good solution. 🙁
submitted by /u/DemosaiDelacroix
[link] [comments]
Hey, I have a chance at getting an interview for a position through a connection (internship), and the position I was referred to said the job would mainly focus on PERL, how could I get ready for this interview? On my resume, I want to add a small portion where I say I'm developing my PERL skills. I saw some basic tutorials for making simple calculators and whatnot. What could I do to get ready and impress my interviewers? Also, should I add these simple projects like a calculator on my Git Hub just to show I have at least a little experience? If not, what other projects could I work on to develop my skills with PERL, I'd love any advice I could get, thanks!
Some background: I've only done Python and Java through my university and did a bit of webdev in my free time.
submitted by /u/SquareRaspberry3808
[link] [comments]
Vim highlights subs with a signature params as red/orange to alert you it's incorrect. Now that Perl actually supports signatures and this is no longer a syntax error I need to find a way to disable this. This is really a Vim question, but I'm sure some other Perl nerd out there has run into this before me.
Has anyone figured out how to disable this "warning" in Vim?
submitted by /u/scottchiefbaker
[link] [comments]
I threw together a quick proof of concept for myself writing out a very simple Entity Component System (ECS) and implementing the flocking simulation on top of it. I liked how it came together so well I wrote some prose around it and decided to share. Note: this is using features from the soon-to-be-released 5.40.0 (RC1 dropped last Friday). submitted by /u/perigrin |
Birds that Flock Together
So I’ve been prepping for my class on Game Development and one of the things I want to introduce to people is the concept of an ECS (Entity Component System).Chris Prather (The Room)
[link] [comments]
(cdxcvii) 8 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
I am hopeful someone has done this before as I'm stuck... I have a 3TB disk image file and I am trying to find all the different email addresses that I've used over the past 22 years.
I can use hex editor tools to find them but it takes days to look at the data and pick out even a handful of matches.
I use Perl regularly but I normally scan text files and do non binary file actions. That's easy since I can do a line by line search. But binary seems different.
If I want to search for zeropoint@ (no domain because I've used dozens of ISPs over the years and that's why I am trying to figure this out.) inside the entire 3TB file, what's the best way to do that? I can dump the results to a file and then clean it up but the search part has me stuck
Thank you
submitted by /u/zeropointlabs
[link] [comments]
[link] [comments]
PTS 2024: Lisbon
Almost exactly a year since the last Perl Toolchain Summit, it was time for the next one, this time in Lisbon. Last year, I wrote:Ricardo Signes (rjbs forgot what he was saying)
Benchmark::DKbench Perl benchmark suite now supports custom benchmarks.
submitted by /u/perlancar [link] [comments] |
List of new CPAN distributions – Apr 2024
dist author abstract date AI-Ollama-Client CORION Client for AI::Ollama 2024-04-05T09:15:33 Acme-CPANModules-BPOM-FoodRegistration PERLANCAR List of modules and utilities related to Food Registrati…perlancar's blog
PTS 2024 - Day 4 - here comes the sun... it's all right!
[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.
Use Data::Dump::HTML::Collapsible to stringify reference
Changes for 0.001 - 2024-03-12
- First release.
Perl CPU Benchmark
Changes for 2.6 - 2024-04-25
- Custom benchmark improvements.
- Fix BSD tar xattr.
Code coverage metrics for Perl
Changes for 1.41
- Spelling, linting and formatting changes
load Data::Dumper output, including self-references
Changes for 0.01 - 2024-04-25
Experimental features made easy
Changes for 0.032 - 2024-04-25T22:30:41+01:00
- Add the newly-stable features to stable.pm - extra_paired_delimiters, const_attr, for_list
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 ...".