- or download this
sub nthword {
my ($texttomatch, $fieldnum) = @_;
($texttomatch =~
m/\s*(\S+)\s*(\S+)\s*(\S+)\s*(\S+)\s*/)[$fieldnum];
}
- or download this
sub nthword {
my ($texttomatch, $fieldnum) = @_;
(split /\s+|^/, $texttomatch)[$fieldnum];
}
- or download this
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/