perl 5 already does that: print "'$_' " foreach split /(=)/, "rank=?"; print "\n"; print "'$_' " foreach split /\s*(=)\s*/, "rank = ?"; print "\n";
# Output: # 'rank' '=' '?' # 'rank' '=' '?' Greetings, Christian -- [EMAIL PROTECTED] - http://www.web42.com/crenz/ - http://www.web42.com/ "Faith (...) is the art of holding onto things your reason has once accepted, in spite of your changing moods." -- C.S. Lewis, Mere Christianity