#!./perl
BEGIN {
chdir 't' if -d 't';
}
# this must come before main, or tests will fail
# these are "abstract virtual" parent methods
}
# the default value is undef
my $scalar = Tie::StdScalar->TIESCALAR();
# Tie::StdScalar redirects to TIESCALAR
$scalar = Tie::StdScalar->new();
# this approach should work as well
# first set, then read
# test DESTROY with an object that signals its destruction
{
}
# $scalar out of scope, Tie::StdScalar::DESTROY() called, DestroyAction set flag
# we want some noise, and some way to capture it
use warnings;
my $warn;
local $SIG{__WARN__} = sub {
$warn = $_[0];
};
# Tie::Scalar::TIEHANDLE should find and call TieTest::new and complain
package DestroyAction;
sub new {
bless( \(my $self), $_[0] );
}
sub DESTROY {
$main::flag = 1;
}