Skip to content

Commit 7b1e48d

Browse files
committed
add util function warn and die.
1 parent b0890a2 commit 7b1e48d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

utils.pm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ sub read_rcfile {
4646
return @lines;
4747
}
4848

49+
sub warn {
50+
my $program = shift;
51+
52+
return CORE::warn( $program, ': ', @_, "\n" );
53+
}
54+
55+
sub die {
56+
my $program = shift;
57+
58+
return CORE::die( $program, ': ', @_, "\n" );
59+
}
60+
4961
# set socket nonblocking.
5062
sub mk_fd_nonblocking {
5163
use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);

0 commit comments

Comments
 (0)