Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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


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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-07-05 18:35 GMT
Find Nodes?
    Voting Booth?

    No recent polls found