Tanton Gibbs wrote: > > If you know they will always be around -, then you might be able to do > something like: > > while( $line =~ /(\d\d?-\d\d?)|(T+)/g ) { > push @snow, ($1 || $2); #T will be $2, not $1 ^^^^^^^^ This won't work because once $1 has been set it retain that value until it is reset by another match so it will be true and $2 will not be used. Of course if it has the value of zero it will be false and $2 will be used, whether it has a value or not.
while( $line =~ /(\d\d?-\d\d?|T+)/g ) { push @snow, $1; > } > > Also, I'm not sure why you had all of the [], they make a character class > which is probably not what you want. \d _is_ a character class (as are \D \w \W etc.) \d is the same as [0-9] or [\d] (where the brackets are redundant) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]