my $sep = ' '; $, = ', '; $\ = $/; my $string = " Hello World"; print split ' ', $string; print split $sep, $string; # This does not work print eval qq< split '$sep', \$string >;