Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.17.26.38
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : Script.pm
package Test::LeakTrace::Script;

use strict;

use Test::LeakTrace ();

my $Mode = $ENV{TEST_LEAKTRACE};

sub import{
	shift;

	$Mode = shift if @_;
}

no warnings 'void';

INIT{
	Test::LeakTrace::_start(1);
}

END{
	$Mode = -simple unless defined $Mode;
	Test::LeakTrace::_finish($Mode);
	return;
}

1;
__END__

=head1 NAME

Test::LeakTrace::Script - A LeakTrace interface for whole scripts

=head1 SYNOPSIS

	#!perl -w
	use Test::LeakTrace::Script sub{
		my($svref, $file, $line) = @_;

		warn "leaked $svref from $file line $line.\n";
	};

=head1 DESCRIPTION

This is a interface to C<Test::LeakTrace> for whole scripts.

=head1 INTERFACE

=head2 Command line interface

	$ perl -MTest::LeakTrace::Script script.pl

	$ perl -MTest::LeakTrace::Script=-verbose script.pl

	$ TEST_LEAKTRACE=-lines script.pl

=head1 ENVIRONMENT VARIABLES

=head2 TEST_LEAKTRACE=mode

=head3 -simple (DEFAULT)

=head3 -sv_dump

=head3 -lines

=head3 -verbose

=head1 SEE ALSO

L<Test::LeakTrace>.

=cut

© 2025 GrazzMean