in reply to Small replace regular exp help...pls

Or use split which takes a regular expression as an argument.

my (undef, $data) = split / : /, $str; print "Data: $data\n";

CountZero

PS: Honestly, tell us, this is homework, isn't it?

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law