Perl

nicolaw 8th April 2018 at 11:36am

I know there's very little Perl stuff on this wiki. That's a shame because it's what I leanred a lot with in my earlier career. Michael Conrad wrote an excellent article on why he (and as it happens I) love Perl 5 so much.

I love the smell of Perl in the morning.

#!/usr/bin/env perl

use strict;
use warnings;
use feature qw(say);
use constant TWO => 2;

sub main {
  while (local $_ = <DATA>) {
    s{([a-z])} {
      qq[EXTERMINATE >$1< = HALF OF @{[ord($1)*+TWO]}\n];
    }egis;
    say;
  }
}

&main;

__DATA__
This
should
be
okay
for
us!

Related