How can I limit Perl's split function?

Posted by joe on Stack Overflow See other posts from Stack Overflow or by joe
Published on 2010-05-19T17:34:30Z Indexed on 2010/05/20 2:30 UTC
Read the original article Hit count: 224

Filed under:
|

I have trying this:

$string ="Group: ALL:ALL:Good";

@str2  = split (/:/,':',2);

print "@str2";

I am looking in $str[0] = Group and $str[1]= ALL:ALL:Good.

It not working. What would be issue?

© Stack Overflow or respective owner

Related posts about perl

Related posts about split