in reply to How could I check if a variable is 'read-only'?
While the other posters have focused on your direct problem and on your poor code flow. I'm wondering about your question of checking the readonlyness of a variable. My best stab is this:
sub is_readonly { eval {my $save=$_[0]; $_[0]=42; $_[0]=$save;}; return $@ =~/read.?only/; }
Can anybody come up with a cleaner way?
TACCTGTTTGAGTGTAACAATCATTCGCTCGGTGTATCCATCTTTG ACACAATGAATCTTTGACTCGAACAATCGTTCGGTCGCTCCGACGC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How could I check if a variable is 'read-only'?
by robin (Chaplain) on Jan 31, 2002 at 18:49 UTC | |
|
Re^2: How could I check if a variable is 'read-only'?
by lifeboat (Initiate) on Jan 02, 2019 at 02:08 UTC | |
by syphilis (Archbishop) on Jan 02, 2019 at 05:02 UTC | |
by kschwab (Vicar) on Jan 02, 2019 at 14:39 UTC | |
by Anonymous Monk on Jun 14, 2019 at 23:50 UTC | |
by Anonymous Monk on Jun 15, 2019 at 19:44 UTC | |
by Your Mother (Archbishop) on Jun 15, 2019 at 19:56 UTC | |
|