DEV Community

Lance Wicks
Lance Wicks

Posted on • Originally published at lancewicks.com on

2

Skipping a @perlwchallenge week, to do some #judo coding in #perl

This week, I tried to do week 75 and it just did not click. 🙁

That said, I did do some Perl coding for someone looking at doing some research into Judo. They reached out to me as a result of my http://rwjl.net site I think. On that page I ran a research project into an alternative ranking system for Olympic Judo using the ELO system used in Chess.

So the request via email, was a great surprise. It came from someone I deeply respect; so helping was a pleasure.

Perl, has always been a tool for automating tasks. It is the superglue for many tasks. So this week I used it to automate collating some competition results into a format that suited.

Specifically… the dreaded CSV format.

But being Perl, this was easy! just two lines and it was done.

So skipping to the CSV bit, I have an array of hashes. Each entry is the result of a contest in a international Judo competition. To write this data out to a .CSV file in perl looks like this:

use Text::CSV_XS 'csv';

...

my $err = csv( in => \@data, out => "summary_data.csv" );
Enter fullscreen mode Exit fullscreen mode

That’s basically it; copied directly from the POD documentation for the module (Text::CSV_XS).

This took the 167,000+ lines of data and produced a CSV with almost zero fuss. Perl rocks!

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay