in reply to Recognizing all-caps line

if( ($line eq uc $line) && ($line !~ /\d/) ) { . . . }

Update: Oops, had the match condition the wrong way around, as the replies noted.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Replies are listed 'Best First'.
Re^2: Recognizing all-caps line
by grinder (Bishop) on Oct 27, 2004 at 21:20 UTC
    $line =~ /\d+/

    Nice variant. In some ways it better matches the spec than my offering, but you got the conditional the wrong way round. You want $line !~ /\d/ methinks (and the + is not necessary, one is all you need to make it fail).

    - another intruder with the mooring of the heat of the Perl

Re^2: Recognizing all-caps line
by DrHyde (Prior) on Oct 28, 2004 at 08:35 UTC
    you do, of course, mean ...
    && $line !~ /\D/