summaryrefslogtreecommitdiff
path: root/t/op/unshift.t
Commit message (Collapse)AuthorAgeFilesLines
* Delete experimental autoderef featureAaron Crane2015-07-131-34/+1
|
* Test preamble: if requiring ./test.pl, needs chdir.Jarkko Hietaniemi2014-10-081-0/+1
| | | | Exception: t/op/chdir, which does things its own way, for obvious reasons.
* Test preamble: unify to dot slash test dot plJarkko Hietaniemi2014-10-081-1/+1
|
* rename aggref warnings to autoderefRicardo Signes2014-01-141-1/+1
|
* Make key/push $scalar experimentalFather Chrysostomos2014-01-141-0/+1
| | | | | We need a better name for the experimental category, but I have not thought of one, even after sleeping on it.
* Allow push/pop/keys/etc to act on referencesDavid Golden2010-10-311-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All built-in functions that operate directly on array or hash containers now also accept hard references to arrays or hashes: |----------------------------+---------------------------| | Traditional syntax | Terse syntax | |----------------------------+---------------------------| | push @$arrayref, @stuff | push $arrayref, @stuff | | unshift @$arrayref, @stuff | unshift $arrayref, @stuff | | pop @$arrayref | pop $arrayref | | shift @$arrayref | shift $arrayref | | splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 | | keys %$hashref | keys $hashref | | keys @$arrayref | keys $arrayref | | values %$hashref | values $hashref | | values @$arrayref | values $arrayref | | ($k,$v) = each %$hashref | ($k,$v) = each $hashref | | ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref | |----------------------------+---------------------------| This allows these built-in functions to act on long dereferencing chains or on the return value of subroutines without needing to wrap them in C<@{}> or C<%{}>: push @{$obj->tags}, $new_tag; # old way push $obj->tags, $new_tag; # new way for ( keys %{$hoh->{genres}{artists}} ) {...} # old way for ( keys $hoh->{genres}{artists} ) {...} # new way For C<push>, C<unshift> and C<splice>, the reference will auto-vivify if it is not defined, just as if it were wrapped with C<@{}>. Calling C<keys> or C<values> directly on a reference gives a substantial performance improvement over explicit dereferencing. For C<keys>, C<values>, C<each>, when overloaded dereferencing is present, the overloaded dereference is used instead of dereferencing the underlying reftype. Warnings are issued about assumptions made in the following three ambiguous cases: (a) If both %{} and @{} overloading exists, %{} is used (b) If %{} overloading exists on a blessed arrayref, %{} is used (c) If @{} overloading exists on a blessed hashref, @{} is used
* Refactor and expand unshift.tDaniel Frederick Crisman2009-11-131-6/+61
|
* shift with barewords is deprecated, so this test from perl 1 needs updating.Nicholas Clark2009-10-161-2/+2
|
* Mark all .t and .pm files as non executableRafael Garcia-Suarez2009-06-061-0/+0
|
* Pulling ancient RCS commentsAndy Lester2005-11-201-2/+0
| | | | | Message-ID: <20051119061639.GA25086@petdance.com> p4raw-id: //depot/perl@26178
* perl 5.0 alpha 2perl-5a2Larry Wall1993-10-071-1/+1
| | | | [editor's note: from history.perl.org. The sparc executables originally included in the distribution are not in this commit.]
* perl 4.0.00: (no release announcement available)perl-4.0.00Larry Wall1991-03-211-0/+14
So far, 4.0 is still a beta test version. For the last production version, look in pub/perl.3.0/kits@44.