|
{ my ( $i , $msg ) = qw(0 test) ;
sub t {
return ( $msg , $i ) = ( @_ , 0) if @_ ;
$msg . ' ' .++ $i
}}
t 'here my' ;
ok eval '$x' , t;
ok !$@, t;
is eval '$x' , 5, t;
my $y = 3;
t 'here syntax' ;
ok ! eval '$y' , t;
ok $@, t;
sub myok {
map { "my \$$_ = 'ok';" } @_
}
t 'here transform' ;
{
is eval '$x' , 'ok' , t;
is eval '$y' , 'ok' , t;
is eval '$z' , 'ok' , t;
}
t 'use here::install' ;
{
is eval '$a' , 'ok' , t;
is eval '$b' , 'ok' , t;
}
no here::install 'myok' ;
BEGIN {
t 'no here::install' ; {
ok ! $INC { 'myok.pm' }, t;
ok ! defined &myok::import , t;
}
}
|