On 3/21/06, Tom Allison <[EMAIL PROTECTED]> wrote:
>
> I'm trying to refactor an application I wrote a few months ago and ran
> into a question about SIG{TERM}.
>
> Currently I have a single application that uses the approach of:
>
> my $please_die = 0;
> $SIG{TERM} = sub {$please_die = 1 };
>
> to
when I should exit out of different loops and structures.
>
>But if I have a script that uses objects, how to I propogate this to the
>objects from the main script?
>
I would suggest you read this article " Using Global Variables and Sharing Them
Between Modules/Packages" writen by Stas Bekman:
John W. Krahn wrote:
If you use the package name then you don't need to use our():
$ perl -Mwarnings -Mstrict -le'$main::var = q[test]; print $main::var'
test
John
True.
But if you don't use 'our' you would always have to use its
fully-qualified name.
$main::please_die = 0;
$SIG{TER
Mr. Shawn H. Corey wrote:
> Tom Allison wrote:
>> I'm trying to refactor an application I wrote a few months ago and ran
>> into a question about SIG{TERM}.
>>
>> Currently I have a single application that uses the approach of:
>>
>> my $please_die = 0;
>> $SIG{TERM} = sub {$please_die = 1 };
>>
>>
Tom Allison wrote:
I'm trying to refactor an application I wrote a few months ago and ran
into a question about SIG{TERM}.
Currently I have a single application that uses the approach of:
my $please_die = 0;
$SIG{TERM} = sub {$please_die = 1 };
to control when I should exit out of different lo
I'm trying to refactor an application I wrote a few months ago and ran
into a question about SIG{TERM}.
Currently I have a single application that uses the approach of:
my $please_die = 0;
$SIG{TERM} = sub {$please_die = 1 };
to control when I should exit out of different loops and structures.