File: can.pl

package info (click to toggle)
libclass-std-fast-perl 0.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 216 kB
  • sloc: perl: 575; makefile: 2
file content (9 lines) | stat: -rw-r--r-- 302 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
use lib '../lib';
use Class::Std::Fast;
use Benchmark qw(cmpthese);

cmpthese 1000000 , {
    can => sub { return 1 if (Class::Std::Fast->can('DESTROY')) },
    symbol => sub { return 1 if (*{Class::Std::Fast::DESTROY}{CODE}) },
    exist => sub { return 1 if exists &{Class::Std::Fast::DESTROY} },
};