This question was first posted at this site.

Other than the change from "6 identical lines" to "3 identical lines" and the removal of newlines, the OP is a verbatim, blatant plagiarism of this original post:

[Please enter your report here] The perl program below should print 6 identical lines, but one of them is different, which appears to be a very serious bug, perhaps in the optimization of "map". It appears to not be Solaris-specific. I also see this on Linux perl 5.6.1. $ perl <<'EOF' sub f1 { my ($f) = @_; my @z = ("$f"); for my $d (@z) {return $d} } sub f2 { my ($f) = @_; for my $d ("$f") {return $d} } sub f3 { for my $d (@_) {return $d} } print map {f1($_)} qw(x y z); print "\n"; print map {f2($_)} qw(x y z); print "\n"; print map {f3($_)} qw(x y z); print "\n"; for my $a (qw(x y z)) { print f1($a) } print "\n"; for my $a (qw(x y z)) { print f2($a) } print "\n"; for my $a (qw(x y z)) { print f3($a) } print "\n"; EOF xyz zzz xyz xyz xyz xyz

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

In reply to Re: "map" sometimes uses only the last mapped value = PLAGIARISM by liverpole
in thread "map" sometimes uses only the last mapped value by jesuashok

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.