aboutsummaryrefslogtreecommitdiff
path: root/challenge-331/deadmarshal/perl/ch-1.pl
blob: f6fccc6c15fb2eb84cf5a8c5ba689ce481322a22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env perl
use strict;
use warnings;

sub last_word{
  length((split /\s/,$_[0])[-1])
}

printf "%d\n",last_word('The Weekly Challenge');
printf "%d\n",last_word('    Hello World    ');
printf "%d\n",last_word('Let\'s begin the fun');