summaryrefslogtreecommitdiff
path: root/t/comp/term.t
Commit message (Collapse)AuthorAgeFilesLines
* Eval fails in certain situations (eval "{'...")Gurusamy Sarathy1997-08-071-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Sun, 20 Jul 1997 16:02:05 MDT, Dave Carrigan wrote: >Eval will fail in the following situation: > >- eval'ing a string >- the string represents an anonymous hash >- the first key of the anon hash is single quoted, and contains an > embedded single quote escaped with a backslash >- using the form `` $ref = eval $string '' > >The MLDBM module uses this form of eval all the time, so the above >situation actually has the potential to occur quite often. >$string2 = "{'a\\'' => 'foo', 'b' => 'bar', 'c' => 'bat'}"; That is one of the cases where the note in perlref (about disambiguating braces not preceded by anything else) applies. However, in this particular case, the code that recognizes if a literal string is the first thing inside the curlies is not doing a thorough job of it. The attached patch should cure it. Note that you'll still need to write C<eval "{ $a => 'foo' }"> as C<eval "+{ $a => 'foo' }"> if you want it to evaluate as a hashref. Perl only auto-disambiguates if the first thing in the curlies is a literal string followed by a comma or =>. I'll change MLDBM to conform, for the next release. p5p-msgid: 199707211753.NAA14940@aatma.engin.umich.edu
* 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/+35
So far, 4.0 is still a beta test version. For the last production version, look in pub/perl.3.0/kits@44.