- or download this
use strict;
use warnings;
...
inner();
}
- or download this
>perl -c test.pl
Variable "$foo" will not stay shared at test.pl line 8.
test.pl syntax OK
- or download this
use strict;
use warnings;
...
$inner->();
}
- or download this
>perl -c test.pl
test.pl syntax OK
- or download this
use strict;
use warnings;
...
$inner->()
}
}
- or download this
Global symbol "$inner" requires explicit package name at test.pl line
+6.
test.pl had compilation errors.
- or download this
use strict;
use warnings;
...
$inner->()
}
}
- or download this
>perl -c test.pl
test.pl syntax OK
- or download this
# ReleaseTracker.pm
...
sub o { ReleaseTracker->new(); }
1;
- or download this
use strict;
use warnings;
...
outer( o() );
END { print("On program exit:\n"); }
- or download this
>perl test.pl
On program exit:
Destroyed <--- BAD!
- or download this
use strict;
use warnings;
...
outer( o() );
END { print("On program exit:\n"); }
- or download this
>perl test.pl
Destroyed
On program exit:
<-- good
- or download this
sub outer {
...
...
};
helper(@_);
}
- or download this
sub outer {
...
...
}
} )->(@_);
}
- or download this
sub outer {
...
...
weaken($helper);
$helper->(@_);
}