- Xchat::register(@opts{qw/name version banner/}, sub {
- $ph->flush;
- if (*$ph->{atexit_id}) {
- my @callbacks = sort { *$ph->{atexit}{$b} <=> *$ph->{atexit}{$a} }
- keys %{*$ph->{atexit}};
- $_->($ph) for @callbacks;
- }
- undef $ph;
- });
+ called_from_script {
+ Xchat::register(@opts{qw<name version banner>}, sub {
+ $ph->flush;
+ if (*$ph->{atexit_id}) {
+ my @callbacks = sort { *$ph->{atexit}{$b} <=> *$ph->{atexit}{$a} }
+ keys %{*$ph->{atexit}};
+ $_->($ph) for @callbacks;
+ }
+ undef $ph;
+ })
+ };