my $readline = "perl::monk"; my ( $first, $second ); # this will get the first item... ( $first, undef ) = split /::/, $readline, 2; # or the second one... ( undef, $second ) = split /::/, $readline, 2;