my $string="part of string to keep|part of string to toss"; my ($keep,$junk)=split /\|/, $string; print "$keep\n";