in reply to Re: reading octal values from file
in thread reading octal values from file

Many thanks.

I've now ended up with the following code (and I'm just putting an integer in the option file - i.e. nak:6)

I'm also allowing for a string, such as "OK", but can anyone suggest a more elegant solution than the following?

if($opt{ack} =~ /^\d+$/){ print $live_socket chr($opt{ack}); } else{ print $live_socket $opt{ack}; }
Tom Melly, tom@tomandlu.co.uk

Replies are listed 'Best First'.
Re: Re: Re: reading octal values from file
by flounder99 (Friar) on Feb 27, 2003 at 17:27 UTC
    Does this help with any ideas?
    use strict; my %test; $test{bell} = 'this is my \007'; $test{bell} =~ s!\\(0\d\d)!chr($1)!ge; print $test{bell} . "bell\n";

    --

    flounder