sub foo{return reverse split//,shift} #no semi-colon :) my $i = foo("oof rab"); print $i;