The behavior of this script in perl 5.26 is so weird that it seems like it must be a bug.
Before calling the sub test_this @arr: 1 2 3 4 5 6 7 8 9 10 Inside the sub, before the map @arr: 1 2 3 4 5 6 7 8 9 10 Inside the sub, before the map @_ = 1 2 3 4 5 6 7 8 9 10 Inside the sub, after the map @arr: 2 4 6 8 10 12 14 16 18 20 Use of uninitialized value $_[0] in join or string at foo line 11. Use of uninitialized value $_[3] in join or string at foo line 11. Use of uninitialized value $_[6] in join or string at foo line 11. Use of uninitialized value $_[9] in join or string at foo line 11. Inside the sub, after the map @_ = _ Use of uninitialized value $_[0] + in join or string at foo line 11. _ Use of uninitialized value $_[3] in join or string at foo line 11. _ Use of uninitialized value $_[6] in join or string at foo line 11. After calling the sub test_this @arr: 2 4 6 8 10 12 14 16 18 20
If I throw in print Dumper(@_), I get this:
panic: attempt to copy freed scalar 7fe03e8040b0 to 7fe03e82c858 at /o +pt/local/lib/perl5/5.26/darwin-thread-multi-2level/Data/Dumper.pm lin +e 602.
Anyone know what's going on?

In reply to Re: How come @_ gets changed here? by Anonymous Monk
in thread How come @_ gets changed here? by pritesh_ugrankar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.