in reply to Re: Searching for control characters
in thread Searching for control characters

a) Yes, I did forget that. But it does work. For better style and conformity I should have it.
b) Yes, I mispelled it here. but it is all caps in my script.
c) Doesn't the parens around [:cntrl:] not capture? Or did I read that wrong in the docs?
if ( $line =~ /([[:cntrl:]])/ ) { my $c = $1;
Or should I have gone about this differently?
Thanks. Eric

Replies are listed 'Best First'.
Re^3: Searching for control characters
by Fletch (Bishop) on Feb 07, 2006 at 20:54 UTC

    Your code runs, but you have no idea that the open failed and you blithely continue on until you get the error about trying to print to an unopened handle.

    Next the translation: "Yes, I mispelled it here. but it is all caps (and still wrong) in my script." Again, ORD is not ord. CASE MATTERS.

    And that code there is different than your initial example (but yes, that's correct and should put something meaningful in $1).

Re^3: Searching for control characters
by ericdp (Novice) on Feb 07, 2006 at 20:55 UTC
    oops. ... dumb me ... "ord" not "ORD".