Use <code> tags, otherwise array indices are turned into links.
#!/usr/bin/perl use warnings; use strict; use Time::HiRes qw(gettimeofday tv_interval) +; my( @suit, @deck); my @ups = qw( 0 0 0 0 0 0 0 0 0 0); my $cntr = 0; Deck(); # four shuffled suits are added to a deck and then shuffled print "\n"; my $t0 = gettimeofday; T0: $ups[0] = Card(); $ups[1] = Card(); # draw cards for pos #0 & # +1 T1: if($ups[0] eq $ups[1]) { goto T0; } # cover a pair & go back if($ups[2] eq '0') { $ups[2] = Card(); } # fill pos#2 if vacant # check pos#2 against pos#0 - cover a pair & go back if($ups[2] eq $ups[0]) { Cover(2,0); goto T1; } # check pos#2 against pos#1 - cover a pair & go back if($ups[2] eq $ups[1]) { Cover(2,1); goto T1; } # watch the rows for pairs that don't get covered foreach my $x (@ups) { print "$x "; } print "\n"; for(my $j=3;$j<10;$j++) { if($ups[$j] eq '0') { $ups[$j] = Card(); } for(my $k=0;$k<$j;$k++) { if($ups[$j] eq $ups[$k]) { Cover($j,$k); goto T1; } } } + TX: print "\n"; foreach my $x (@ups) { print "$x "; } print "\t\tExit row\n"; my $del_t = (gettimeofday - $t0) * 10**6; my $usec = sprintf("%.2f",$del_t); print "\n$cntr passes in $usec microseconds. "; if($cntr == @deck) { print "Success!\n\n"; } else { print "{sigh...}\n\n"; } #======================================== sub Card { my $tmp = $deck[$cntr]; $cntr++; if($tmp ne 'X') { return $tmp; } else { goto TX; } } sub Suit { @suit = qw(A B C D E F G H I J K L M ); for(my $i=$#suit;$i>0;$i--) { my $j = int(rand($i + 1)); @suit[$i, $j] = @suit[$j, $i]; } } sub Deck { for(my $i=0;$i<4;$i++) { Suit(); @deck = (@deck,@suit); +} for(my $i=$#deck;$i>0;$i--) { my $j = int(rand($i + 1)); @deck[$i, $j] = @deck[$j, $i]; } push(@deck,"X"); } sub Cover { my $x = $_[0]; my $y = $_[1]; $ups[$x] = Card(); $ups[$y] = Card(); }

I tried running the script 1000 times in 5.26.1 and the current blead (5.41.5-22-ga8a74a872d). There was no warning.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

In reply to Re^2: pop() on a fast multi-core cpu by choroba
in thread pop() on a fast multi-core cpu by Anonymous Monk

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.