Issue #506 - 2021-04-05 - Perl Memory Management

latest | archive | edited by Mohammad Sajid Anwar
This edition was made possible by the supporters of our cause.
Don't miss the next issue!

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

Code Maven courses

Perl courses by Gabor Szabo


Announcements

Kent Fredric's CPAN distributions are available for adoption

by Neil Bowers (NEILB)

Neil appeals to all CPAN contributors to ask if they are willing to adopt Kent Fredric's distributions.

TPRCIC 2021 - Call for papers

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

Switch lots of things on at once

by Ben Bullock (BKB)

Interesting blog post by Ben talking about boilerplate solutions.

Security Issues in Perl IP Address distros

by Dave Rolsky (DROLSKY)

Security Issues in Perl IP Address distros.


Discussion

The Zen of Test Suites

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

Monthly Report - March

by Mohammad Sajid Anwar (MANWAR)

Following the tradition, here is my monthly report for March 2020.


CPAN

CPAN Report 2020

by Neil Bowers (NEILB)

Neil came up withi an extensive report about activity on the CPAN in 2020.

CPAN utils

by Thibault Duponchelle

Coolest collection of CPAN utils ever.

Distar - A CPAN Distribution Author Tool

by Graham Knop (HAARG)

Check out this introduction to Distar; a new shiny, handy tool for CPAN distribution authors.

A pull request for Crypt::LE

by Flavio Poletti (POLETTIX)

Flavio's contribution to Crypt::LE is very handy. Please check it out.

Date::Parse

by Flavio Poletti (POLETTIX)

Flavio shared the power of Date::Parse. Find out the secret for yourself.


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.

The Weekly Challenge - 107

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.

RECAP - The Weekly Challenge - 106

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.

Perl Weekly Challenge 106

by Aaron Smith

Once again, Aaron shared some cool Raku magic. Thanks and keep it up.

Perl Weekly Challenge 106: Maximum Gap

by Abigail

Abigail once again showed off his skill and presented his solutions in an elegant blog post.

Perl Weekly Challenge 106: Decimal String

by Abigail

Abigail's discussion about the Decimal String task is too technical and well worth reading. Thanks for sharing this knowledge.

Recursion and Repeated Decimals: The Weekly Challenge 106

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.

String the Gap with Raku

by Arne Sommer

Arne always presents his case with reference documents which give you the complete picture. Keep it up.

Just Got Poked: Perl Weekly Challenge 106 and Other News

by Dave Jacoby (JACOBY)

Dave raised a notorious issue when printing decimal fractions using sprintf().

PWC106 - Maximum Gap

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.

PWC106 - Decimal String

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.

Perl Weekly Challenge 106: Maximum Gap and Decimal String

by Laurent Rosenfeld

Laurent showing his expertise in multiple languages in this blog post. Incredible.

Perl Weekly Challenge 106: quick and easy

by Luca Ferrari

Luca used his Raku skill and made both tasks look like schoolboy tasks. Simply the best.

Perl Weekly Challenge 106: Maximum Decimal

by Roger Bell West (FIREDRAKE)

Roger shared a cool algorithm to deal with the Decimal String task. Thanks for sharing.

Weekly Challenge 106

by Simon Green

Simon shared his research while working on Decimal String task. We all get it for FREE, thank you.

Perl Weekly Challenge 106.

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.

Generate Calendar in ICal format

by Gabor Szabo (SZABGAB)

This example was written in preparation for the calendar file provided by the Perl Weekly site that contains all the Perl-related events we are aware of from our events page. There is also a calendar file provided by the Code Maven site that include all the live events.


Videos

Rakudo

2021.13 Games Pop

by Elizabeth Mattijsen (ELIZABETH)


Weekly collections

The corner of Gabor

A couple of entries sneaked in by Gabor.

Live events

by Gabor Szabo (SZABGAB)

List of live events: Automation with Rex; Web application development with Mojolicious; BDD with Test::BDD::Cucumber.


Events

Houston Perl Mongers Online Meeting: Pairwise and Lightning Talks

April 8th, 2021 06:00 PM Central Time (US and Canada)

Purdue Perl Mongers - HackLafayette

Wednesday, April 14, 2021

Toronto Perl Mongers Online Meeting

Thursday, April 22, 2021

Berlin Perl Mongers

Wednesday, April 28, 2021


Perl Jobs by Perl Careers

Mad Men (and women) of London. Perl in London

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.

That’s a Big Sandbox! Perl role in London

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.

Smart Shopper = Smart Saver. Perl role in Vienna

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.

Grow Your Karma with a Job that Does Good! Perl role in Australia

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?

The Future is Now! Perl Role in Malaysia

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!

Just ONE e-mail each Monday. Easy to unsubscribe. No spam. Your e-mail address is safe.
Perl Weekly on Twitter RSS Feed of the Perl Weekly. Updated once a week