Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: "map" sometimes uses only the last mapped value = PLAGIARISM

by liverpole (Monsignor)
on Oct 06, 2006 at 13:46 UTC ( [id://576665]=note: print w/replies, xml ) Need Help??


in reply to "map" sometimes uses only the last mapped value

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$..$/

Replies are listed 'Best First'.
Re^2: "map" sometimes uses only the last mapped value
by Gavin (Archbishop) on Oct 06, 2006 at 18:24 UTC
    Well said ++ Liverpole

    Postings of that sort to gain xp are not in the spirit of perlmonks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://576665]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found