in reply to Hash statement problem.

G'day huchister,

You have a syntax error in your use of a hash slice. Cristoforo has shown you the fix;See Update below perldata - Slices provides an explanation.

Update: That looked like a simple syntax error to me but apparently it's not:

$ perl -MO=Deparse,-p -e 'my( $rxml, $ob ) = @{%$self}{qw/rxml rxml_ob +/};' (my($rxml, $ob) = @{%$self;}{'rxml', 'rxml_ob'}); -e syntax OK

The suggested "fix" by Cristoforo shows the more usual form:

$ perl -MO=Deparse,-p -e 'my( $rxml, $ob ) = @{$self}{qw/rxml rxml_ob/ +};' (my($rxml, $ob) = @{$self;}{'rxml', 'rxml_ob'}); -e syntax OK

Please elaborate on "not seems to be working anymore" and advise what data $self refers to.

-- Ken

Replies are listed 'Best First'.
Re^2: Hash statement problem.
by Anonymous Monk on Mar 11, 2013 at 20:56 UTC
    :) except that its perfectly valid syntax, thus, not a syntax error