
BillKSmith
Veteran
Apr 6, 2012, 9:19 PM
Post #2 of 3
(523 views)
|
|
Re: [jddaly] Problems matching first pattern
[In reply to]
|
Can't Post
|
|
It is much easier to search for one possiblity at a time. I am not exactly sure what you do want, but this should give you the idea.
use strict; use warnings; my $x = 0; my @golferscores; $_ = "- 73 Jason Day +5 +1\tWD\t76 - - - 76"; $golferscores[$x] = /\t(CUT)\t/ ? $1 : /\t(WD)\t/ ? $1 : /\t(E)\t/ ? $1 : /([-+]\d{1,3})/ ? $1 : 'Error' ; print $golferscores[$x]; Good Luck, Bill
|