develooper Front page | perl.perl5.porters | Postings from February 2004

[PATCH] GLOB to LVALUE assignment fix

Thread Next
From:
Tassilo von Parseval
Date:
February 14, 2004 03:05
Subject:
[PATCH] GLOB to LVALUE assignment fix
Message ID:
20040214110256.GA14993@ethan
Hi,

attached you will find the revises patch against @22302 that extends an
LV to hold a complete GV. Differences to the patch draft include a
clean-up in dump.c and thus avoiding duplicate code.

I checked those places that do an explicit comparison between SvTYPEs
and changed them accordingly. With the previous patch, this

    my $v = *GLOB; --$v;

would no longer produce the expected error 'Modification of a read-only
value attempted'. Now the error is back (note that we don't yet have a
test for that).

I added four tests to op/gv.t simply because I didn't find a better
place for them. The generic case

    sub f { $_[0] = *GLOB }
    f($var);

is tested, as is the case for a tied array-element (although this is
superseded by the above):

    $tied[0] = *GLOB;

I didn't explicitely add a test for a tied hash-element. 

Enjoy,
Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About