Skip to content

Commit 81ed03d

Browse files
authored
Merge pull request #64 from choroba/sig-warn-obj
Add sig-warn-obj: $SIG{__WARN__} handler gets non-stringified object
2 parents 4a0f7a6 + a433ef6 commit 81ed03d

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Revision history for Syntax-Construct
22

3+
1.042 2025-06-13
4+
- Add sig-warn-obj
5+
36
1.041 2025-06-09
47
- Add the __FILE__() syntax
58

lib/Syntax/Construct.pm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use 5.006002;
44
use strict;
55
use warnings;
66

7-
our $VERSION = '1.041';
7+
our $VERSION = '1.042';
88

99
my %introduces = do { no warnings 'qw';
1010
( '5.040' => [qw[
@@ -59,7 +59,7 @@ my %introduces = do { no warnings 'qw';
5959
'5.014' => [qw[
6060
?^ /r /d /l /u /a auto-deref
6161
^GLOBAL_PHASE \o package-block
62-
srand-return prototype+
62+
srand-return prototype+ sig-warn-obj
6363
]],
6464
'5.012' => [qw[
6565
package-version ... each-array
@@ -305,7 +305,7 @@ Syntax::Construct - Explicitly state which non-feature constructs are used in th
305305
306306
=head1 VERSION
307307
308-
Version 1.041
308+
Version 1.042
309309
310310
=head1 SYNOPSIS
311311
@@ -638,6 +638,10 @@ See B<srand() now returns the seed> under L<perl5140delta/Other Enhancements>.
638638
639639
See L<perl5140delta/Single-term-prototype>.
640640
641+
=head3 sig-warn-obj
642+
643+
See the second bullet in L<perl5140delta/Exception Handling>.
644+
641645
=head2 5.016
642646
643647
=head3 charnames

t/02-constructs.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,15 @@ my %tests = (
269269
[ 'prototype+',
270270
'sub proto_plus (+) { $_[0][0] }; my @ar = qw( a b ); proto_plus(@ar)',
271271
'a' ],
272+
[ 'sig-warn-obj',
273+
'sub My::Warn::value { 42 }
274+
my $out;
275+
my $w = bless {}, "My::Warn";
276+
local $SIG{__WARN__} = sub { $out = shift->value };
277+
warn $w;
278+
$out',
279+
42
280+
],
272281
],
273282

274283
'5.012' => [

t/05-functions.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use FindBin;
66

77
my %count;
88
BEGIN {
9-
%count = (constructs => 102, old => 4, removed => 7);
9+
%count = (constructs => 103, old => 4, removed => 7);
1010
}
1111

1212
use Test::More tests => 5;

xt/completness.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use FindBin;
55

66
my $plan;
77
BEGIN {
8-
my %count = (constructs => 102,
8+
my %count = (constructs => 103,
99
removed => 7,
1010
aliases => 80,
1111
old => 4);

0 commit comments

Comments
 (0)