You simply want to use ($first) = $line =~ /(\S*)/; [download]
In reply to Re: Re: Grabbing first column of text by twerq in thread Grabbing first column of text by Anonymous Monk