Re: SIGNALS & OOP

2006-03-21 Thread Jay Savage
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

Re: SIGNALS & OOP

2006-03-21 Thread Jeff Pang
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:

Re: SIGNALS & OOP

2006-03-21 Thread Mr. Shawn H. Corey
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

Re: SIGNALS & OOP

2006-03-21 Thread John W. Krahn
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 }; >> >>

Re: SIGNALS & OOP

2006-03-21 Thread Mr. Shawn H. Corey
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

SIGNALS & OOP

2006-03-21 Thread Tom Allison
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.