in reply to exists EXPR error

As a side note %new_list{$file} is a syntax error, but the exists error already makes perl die before this can be reported.

> perl %h{a}; syntax error at - line 1, near "%h{" Execution of - aborted due to compilation errors.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Replies are listed 'Best First'.
Re^2: exists EXPR error
by Eily (Monsignor) on Dec 15, 2014 at 12:59 UTC

    I don't have a v5.20 I can test on, but I suppose this is either still an error, or at least a warning with the hash slice syntax (the same way @array[0] will provoke a warning if they are activated, even in list context, while @array[0,] is always valid)

      Hi Eily

      I'm not sure what you mean, this %h{a} is not a hash slice, it has no meaning.

      (slices always start with an @ :)

      > @array[0] will provoke a warning ... even in list context, 

      Hmm not sure if I like that.

      Cheers Rolf

      (addicted to the Perl Programming Language and ☆☆☆☆ :)

        New slice syntax in 5.20:
        %h{ qw(key1 key2) } # Returns: key1 value1 key2 value2
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ