I think this is a bug.. and tried to submit it once correctly to the perl development team. How sorry was I to see the troubled scripture was none other than my favorite phrase in all of the Kingdom of Perl! Hubris perhaps, to contemplate counting the *'s in $sky..

I caught a brief reference to a "quotemeta bug" in a perl-porters archive too..

My question is: Is this a feature we are blessed not to recapitulate in 5.6?

taygeta# perl -e '$s = "<tr><td>el</td></tr>"; $numtrs = $s =~ tr/\Q<tr\E/\Q<tr\E/; print "$numtrs trs.\n";#count trs'
10 trs.
taygeta# perl -e '$s = "<tr><td>el</td></tr>"; $numtrs = $s =~ tr/tr/tr/; print "$numtrs trs.\n";#count trs'
6 trs.

I assure you most religiously this ranked an epiphany for me when it struck. Funny (no! terrifying indeed it was!) it also revealed a bug in this very page of perlmonks.org as I was to post this meditation. Previewing the post leaves some of the code above the "Add it" bar. (Scared to write here in its entirety the damned phrase which was written through the corrupt agency of some demonic intent just below the hallowed name of the house of vroom..)

Perchance 'tis evidence of a holy battle with that frisky html bot? But the agony of rerecording the carats with more obfuscation!

..For the *un-html'd* code is displayed in the "Add this" frame each time. Demonic.. indeed! Much like our old manuscripts which would tolerate neither error nor spill of wine. Going back and forth ten times to make this post was - yes! I dare to say it - a test of faith.

My fervent hopes the above portent may resolve to solely (and most woefully to be sure) an overload of the flesh.

In Spiritus..

Replies are listed 'Best First'.
Ah, 'twere but a night-mare
by mattr (Curate) on Apr 26, 2000 at 22:07 UTC
    $numtrs = ($s =~ s/tr/tr/g);

    How glad I have just noticed that it was as flimsy a concern as the fleece on a maiden's .. erhm.

    The depradations of the html bot still cause this monk worry but hope against hope that time will heal this itinerant's faith..

      I read your epistle with passing interest, sirrah, as we (you and I) seem both to be gifted (or cursed mayhap, as the curse on the old cask which brings its lusty fruit more regular on the parted lip) with that noble gift of true and trusy toungue. Your humble servant has been unjustly accused of erudition for its own sake, an particularly oafish saying, which barbs do linger still in my aching flesh. Certes, I do from time to time wax eloquent and draw glances from the lowly lidded eye; that is my simian, and it is couched on my shoulder and none other.
      In reading your soliloquest (for goal you must have had, else why soliloquize in parte primus), I was minded of a utility that has aided my intercourse with those unaccustomed to our mode of rhetoric. Your servant offers it here for your perusal.
      #!usr/bin/perl -w use strict; srand; my @line; my $index; my $particle; my @vocabulary = ("uh", "er", "ummm", "ahhhh", "rhubarb"); while(<>) { @line = split (/ /,$_); foreach(@line) { $index = rand 5; $particle = $vocabulary[$index]; s/.{1,}/$particle/g; } $_ = join (' ',@line); print; }


      Your Servant,

      Simplicus