File: 17-propagate-subname-colons.t

package info (click to toggle)
libtest-warnings-perl 0.038-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 472 kB
  • sloc: perl: 375; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use warnings;

# checks handling of a warning handler named '::warning_capturer'

my $code = do {
    open(my $fh, 't/14-propagate-subname.t') or die "cannot open t/14-propagate-subname.t for reading: $!";
    local $/;
    <$fh>
};

$code =~ s/\$SIG\{__WARN__\} = 'warning_capturer'/\$SIG\{__WARN__\} = '::warning_capturer'/;

eval $code;
die $@ if $@;