in reply to Re: Readonly variable
in thread Readonly variable

do you mean sub is_readonly { eval { substr($_[0],0,0) = '' ; 1 } } ?

This way is very smart. I will use it, thx :)

Replies are listed 'Best First'.
Re: Re: Re: Readonly variable
by japhy (Canon) on Feb 26, 2001 at 22:56 UTC
    You can use a comma or a semicolon, there is no difference. An even shorter (faster?) approach might be: sub is_readonly { eval { $_[0] = $_[0], 1 } }

    japhy -- Perl and Regex Hacker