my $sep = q/' '/; $sep = shift @ARGV if @ARGV; # you get the idea my $line = " one two three \n"; my @words = eval qq(split $sep, \$line); #### $sep = q(/\s+/); $sep = q(//); $sep = q(/two|\s+/); $sep = q(m|/|);