$ perl -le' sub head($) { my ($x, $xs) = split( " ", ${$_[0]}, 2); ${$_[0]} = $xs; return $x; } my $msg = "new item x"; my $cmd = head \ $msg; print for $cmd, $msg; ' new item x $ perl -le' sub head { my ($x, $xs) = split( " ", $_[0], 2); $_[0] = $xs; return $x; } my $msg = "new item x"; my $cmd = head $msg; print for $cmd, $msg; ' new item x