Perl Weekly
Issue #506 - 2021-04-05 - Perl Memory Management
latest | archive | edited by Mohammad Sajid Anwar
|
Hi there
One topic that is rarely talked about with reference to Perl is 'Memory Management'. Could it be that, being a developer, you don't need to worry about it? Possibly yes, as Perl garbage collection is very efficient. However you still have to take care of circular data structures manually. To get to the bottom of the matter, one has to be aware of two things, "reference count" and "weak references". Can CPAN help me with this? Yes, there is a module Devel::Peek available on CPAN. This will help you figure out the "reference count". How about "weak references" now? Well, once again CPAN is handy, you have Scalar::Util available on CPAN, which provides the subroutine weaken() to create "weak references". What is the point of creating "weak references"? Well, in Perl, a "weak reference" doesn't affect the "reference count" and in a way helps you stop memory leaks. I have yet to come across a simple working example to demonstrate this behaviour. However, you might find the two recipes Chapter 11.15 and chapter 13.13 from the our old friend, Perl Cookbook, second edition very useful. There is another post, The Trouble with Reference Counting by David Farrell which is also very interesting.
Talking about books, I recommend you take a look at Perl New Features by brian d foy. This book will take you to a memorable journey from Perl v5.10 to v5.32.
To all readers in the United Kingdom, enjoy the Monday bank holiday and rest of world start your week on a happy note starting with the weekly newsletter.
Mohammad Sajid Anwar
|
|
|
Sponsors
|
Perl courses by Gabor Szabo
|
|
Announcements
|
by Neil Bowers (NEILB)
Neil appeals to all CPAN contributors to ask if they are willing to adopt Kent Fredric's distributions.
|
|
|
by Nic Evans
The Perl and Raku Conference in the Cloud 2021 celebrates all things Perl and Raku from 8-10 June with group meetings (BOFs) on the Monday and Friday either side of the main event.
|
|
Articles
|
by Ben Bullock (BKB)
Interesting blog post by Ben talking about boilerplate solutions.
|
|
|
Discussion
|
by Curtis 'Ovid' Poe (OVID)
This should be used as a text for any beginner learning to code. I found it very useful and will definitely bookmark it for future reference.
|
|
|
Web
|
|
CPAN
|
by Neil Bowers (NEILB)
Neil came up withi an extensive report about activity on the CPAN in 2020.
|
|
|
|
by Graham Knop (HAARG)
Check out this introduction to Distar; a new shiny, handy tool for CPAN distribution authors.
|
|
|
|
Perl Weekly Challenge
The Weekly Challenge by Mohammad Anwar will help you step out from your comfort zone. You can even win prize money of a $50 Amazon voucher by participating in the weekly challenge. We pick one winner at the end of each month from all the contributors during that month. The monthly prize is kindly sponsored by Peter Sergeant of PerlCareers.
|
by Mohammad Sajid Anwar (MANWAR)
Welcome a new week with a couple of fun tasks "Self-descriptive Numbers" and "List Methods". If you are new to the weekly challenge then why not join us and have fun every week. For more information, please read the FAQ.
|
|
|
by Mohammad Sajid Anwar (MANWAR)
Enjoy a quick recap of last week's contributions by Team PWC dealing with the "Maximum Gap" and "Decimal String" tasks in Perl and Raku. You will find plenty of solutions to keep you busy.
|
|
|
by Aaron Smith
Once again, Aaron shared some cool Raku magic. Thanks and keep it up.
|
|
by Abigail
Abigail once again showed off his skill and presented his solutions in an elegant blog post.
|
|
by Abigail
Abigail's discussion about the Decimal String task is too technical and well worth reading. Thanks for sharing this knowledge.
|
|
by Adam Russell
Adam's notes section for the Decimal String task is an eye-opener for me. I will go back to it later to gain a better understanding.
|
|
|
by Arne Sommer
Arne always presents his case with reference documents which give you the complete picture. Keep it up.
|
|
by Dave Jacoby (JACOBY)
Dave raised a notorious issue when printing decimal fractions using sprintf().
|
|
|
by Flavio Poletti (POLETTIX)
Flavio's style of blogging is really cool as you don't just get a fine solution but also fun discussion as well.
|
|
|
by Flavio Poletti (POLETTIX)
Flavio went beyond what was expected in the task. I need to revisit hi blog post to get to the bottom of it.
|
|
|
by Laurent Rosenfeld
Laurent showing his expertise in multiple languages in this blog post. Incredible.
|
|
by Luca Ferrari
Luca used his Raku skill and made both tasks look like schoolboy tasks. Simply the best.
|
|
|
by Simon Green
Simon shared his research while working on Decimal String task. We all get it for FREE, thank you.
|
|
by W Luis Mochan
Just loved the hack for the Decimal String task. Beautiful.
|
|
Perl Tutorial
A section for newbies and for people who need some refreshing of their Perl knowledge. If you have questions or suggestions about the articles, let me know and I'll try to make the necessary changes. The included articles are from the Perl Maven Tutorial and are part of the Perl Maven eBook.
|
|
Videos
|
|
|
|
Rakudo
|
|
Weekly collections
|
|
The corner of Gabor
A couple of entries sneaked in by Gabor.
|
Event scheduled for April 11
|
|
by Gabor Szabo (SZABGAB)
List of live events: Automation with Rex; Web application development with Mojolicious; BDD with Test::BDD::Cucumber.
|
|
|
|
Events
|
Wednesday, March 31, 2021
|
|
April 8th, 2021 06:00 PM Central Time (US and Canada)
|
|
Wednesday, April 14, 2021
|
|
|
Wednesday, April 28, 2021
|
|
|
|
|
The leader in premium native advertising for technology, financial services, and corporate and lifestyle sectors, our client is the power behind the advertising throne for over 200 websites. This dynamic team is looking for a senior Perl programmer with a strong understanding of Go programming language, paradigms, constructs, and idioms.
|
|
The client is interested in anyone with experience building web apps in Perl, using one of the major Perl frameworks. If you’re a crack-hand with Catalyst, a Mojolicious master, or a distinguished Dance, they want you. You’ll be deploying apps your work to AWS, so experience would be handy, and the company’s big on testing, so they’d like you to know your way around Test::More.
|
|
As one of the largest product and price comparison platforms in German-speaking countries, they share your dedication to finding consumers the best possible deal on electronics, technology, household appliances, and gaming systems. Best of all, they’re looking for candidates with strong Perl, but they make heavy use of PostgreSQL, Elasticsearch, and Modern Perl.
|
|
Not all jobs are created equal. Sure, most pay the bills, but some do more. They impart a sense of purpose; when you log out at day’s end, it’s with the satisfaction that you are part of something bigger, something more important than yourself. You’ve left the world a little better than you found it, and isn’t that what life is really about?
|
|
Our client is an online financial services company, still rapidly expanding after 20 years of impressive growth. With a truly international presence, they’re well known globally in their niche. Looking for Perl developers with a strong background in Modern Perl – you should be comfortable with Moose and PSGI/Plack, and a solid grounding in using Perl’s testing tools.
|
|
You know, you could get the Perl Weekly right in your mailbox. Every Week. Free of charge!
|