develooper Front page | perl.perl5.porters | Postings from July 2010

[perl #4003] Can't chomp values %h

Thread Previous
George Greer via RT
July 25, 2010 18:44
[perl #4003] Can't chomp values %h
Message ID:
On Wed Aug 30 09:22:19 2000, RT_System wrote:
> In article <13564.967673497@chthon>,
> Tom Christiansen <> wrote:
> > 
> > >rick $ /home/perl/bin/perl -le '%h=(1..4);chop values %h'
> > >Can't modify values in chop at -e line 1, at EOF
> > >Execution of -e aborted due to compilation errors.
> > 
> > "chop %h" is legal, and does what you think it does.
> That's pretty vague.  chop %h does what chop values %h should do.  I
> think chop %h should be deprecated or made a syntax error now so that
> when someday we support modifiable sv keys we can make it do "what you
> think it does" then.
> But chop values %h should certainly work.
> Incidentally, chop on a hash slice seems to return the first char
> chopped, not the last (array slices do seem to work though).

'chop %h' was documented in 4bf21a6d.

'chop for values %h' also works, per the suggestion of a 'chop values %h'.

In testing v5.13.3-49-g01604df, I get the last value (4 in the example)
back from a hash slice so that seems good too.

As such, I'll resolve this.

George Greer

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About