#!/usr/bin/perl -w
use strict;
my ($theVar);
# Processor
$theVar = "john smith";
print "($theVar)\n";
if ($theVar =~ s/john /jonathan /) {
print "($theVar)\n"; # Expand name
}
if ($theVar =~ s/(.+)\s(.+)/$2 $1/) {
print "($theVar)\n"; # Swap first and last name
}