File: test.pl

package info (click to toggle)
apache-perl 1.3.9-14.1-1.21.20000309-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,524 kB
  • ctags: 1,743
  • sloc: ansic: 9,017; perl: 7,822; sh: 864; makefile: 695
file content (44 lines) | stat: -rw-r--r-- 697 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
BEGIN {
    $^W=1;
    print "1..3\n";
}

use ExtUtils::testlib;
use Apache::Symbol ();

use strict;

package Foo;

@Foo::ISA = qw(Apache::Symbol);
sub one {1}

sub constant_one () {1}

#comment out the line below and you'll see something like:
#Subroutine one redefined at (eval 1) line 1.
#Constant subroutine constant_one redefined at (eval 2) line 1.

Foo->undef_functions;

eval "sub one {1}";
eval "sub constant_one () {1}";

print "ok 1\n";

my $name = Apache::Symbol::sv_name(\&Foo::one);
print "not " unless $name eq "Foo::one";

print "ok 2\n";

package main;

sub THREE () {3}
my $sv = Apache::Symbol::cv_const_sv(\&THREE) or print "not ";

$sv ||= "3 (failed!)";
print "ok $sv\n";