in reply to using split without $junk
This was discussed recently, but here is one way that doesn't involve split at all.
Cheers - L~R#!/usr/bin/perl -w use strict; my $string = 'part of string to keep|part of string to toss'; my $keep = substr($string , 0 , index($string , '|'));
|
|---|