#!/usr/bin/perl # # $Id: whackbacktick 2592 2003-12-21 00:33:01Z jmates $ # # The author disclaims all copyrights and releases this document into # the public domain. use Benchmark qw(cmpthese); $without = 'puff'; $without_long = 'puff the magic dragon lives by the sea and so forth went that song from that movie'; $with_one = 'puff`'; $with_many = 'puff````````````'; $_ = $with_many; # not much diff between these on 5.8 perls cmpthese( -5, { 'many_slag' => 'sub { $with_many =~ s/`//g }', 'many_plus' => 'sub { $with_many =~ s/`+// }', 'many_pdol' => 'sub { $with_many =~ s/`+$// }', 'oneb_slag' => 'sub { $with_one =~ s/`//g }', 'oneb_plus' => 'sub { $with_one =~ s/`+// }', 'oneb_pdol' => 'sub { $with_one =~ s/`+$// }', 'wtos_slag' => 'sub { $without =~ s/`//g }', 'wtos_plus' => 'sub { $without =~ s/`+// }', 'wtos_pdol' => 'sub { $without =~ s/`+$// }', 'wtol_slag' => 'sub { $without_long =~ s/`//g }', 'wtol_plus' => 'sub { $without_long =~ s/`+// }', 'wtol_pdol' => 'sub { $without_long =~ s/`+$// }', } );