my $yourstr = "user:pass"; my ($User,$Pass) = split (/:/,$yourstr); print "User:$User\n"; print "Pass:$Pass\n";