in reply to Re^5: New behavior of 'each' with respect to references
in thread New behavior of 'each' with respect to references

exists on array elements has been deprecated since 5.12.0.

Be aware that calling exists on array values is deprecated and likely to be removed in a future version of Perl.

Same for delete.

  • Comment on Re^6: New behavior of 'each' with respect to references

Replies are listed 'Best First'.
Re^7: New behavior of 'each' with respect to references
by educated_foo (Vicar) on May 17, 2011 at 20:34 UTC
    Okay, so there are several meanings of "deprecated":
    1. "perl -w" will warn, but it probably won't be removed for awhile (e.g. split to @_).
    2. "perl -w" will warn, and it will be removed in the next major release.
    3. "perl -w" won't warn, but the docs call it "deprecated" or possibly "vaguely deprecated;" who knows what will happen?
    delete $a[$n] and exists $a[$n] are deprecated(3), whatever that means.

      Okay, so there are several meanings of "deprecated"

      No, the meaning is always the same: Stop using it.

      1. "perl -w" will warn, but it probably won't be removed for awhile (e.g. split to @_).
      2. "perl -w" will warn, and it will be removed in the next major release.

      There's no such distinction. There's never been a promise that a deprecated feature will be removed in the next version. If you get the warning, it may be gone in the next version, it may be removed later, or it may never be removed.

      By the way, deprecated warnings are now issued even without -w.

      3. "perl -w" won't warn, but the docs call it "deprecated" or possibly "vaguely deprecated;" who knows what will happen?

      A feature won't be removed unless it issued a deprecated warning in the previous version's .0 release, so exists($a[$n]) and delete($a[$n]) won't be removed before 5.18.

      who knows what will happen?

      If you keep using a deprecated feature, the outlook isn't good.

      delete $a[$n] and exists $a[$n] are deprecated(3), whatever that means.

      If you read the rest of the sentence, it clearly defines what that means. They are "likely to be removed in a future version of Perl". I don't follow the confusion.

        This is really simple: Assume feature X is labeled "deprecated" somewhere, perhaps in the documentation or in warnings output. What can one predict about X's behavior in specific future versions of Perl based on this information? The answer to this question is not straightforward, and depends in part on precisely how X has been labeled.

        However, for some reason you don't want to acknowledge this fact, so I'm not sure what to say. "You win"?