Skip to content

Instantly share code, notes, and snippets.

@andrewsolomon
Created May 21, 2017 17:23
Show Gist options
  • Save andrewsolomon/81a89ab212e9382d88cb7c65b72ef0d3 to your computer and use it in GitHub Desktop.
Save andrewsolomon/81a89ab212e9382d88cb7c65b72ef0d3 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dump 'pp';
use feature 'say';
sub string_lengths {
my @params = @_;
return map { $_ => length($_) } @params;
}
my %lengths = string_lengths(@ARGV);
say 'String lengths: '.pp(%lengths);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment