Re: data dumper

2010-05-17 Thread Steve Bertrand
On 2010.05.18 00:58, Uri Guttman wrote: > SB> Perhaps I completely missed something within the latter posts to this > SB> thread, so I must ask... > > SB> ...why not: > > SB> use Storable; > > SB> ...to store temporary data? I understood what Uri said, but does > SB> Storable not co

Re: data dumper

2010-05-17 Thread Uri Guttman
> "SB" == Steve Bertrand writes: SB> On 2010.05.17 00:12, Shawn H Corey wrote: >> On 10-05-16 11:17 PM, Uri Guttman wrote: >>> it can be used to save data (e.g. a config >>> file) in a file for reloading in the future (via running the dumper >>> output with eval). >> >> By savi

Re: data dumper

2010-05-17 Thread Steve Bertrand
On 2010.05.17 00:12, Shawn H Corey wrote: > On 10-05-16 11:17 PM, Uri Guttman wrote: >> it can be used to save data (e.g. a config >> file) in a file for reloading in the future (via running the dumper >> output with eval). > > By saving the output of Data::Dumper to a *.pm file, it can be reloade

Re: data dumper

2010-05-17 Thread ben perl
Thanks everyone, I tried the module and it is great. Thanks, -Ben On Mon, May 17, 2010 at 8:00 AM, Shawn H Corey wrote: > On 10-05-17 10:35 AM, Eric Veith1 wrote: > >> "Bob McConnell" wrote on 05/17/2010 02:26:58 PM: >> >>> > What is the difference between this and exporting a YAML file? Wher

Setting SIG{CHLD} to IGNORE in fork() changes result of system() call

2010-05-17 Thread Kelly Jones
These 3 lines of code: if (fork()) {sleep 10; exit(0);} $SIG{'CHLD'} = 'IGNORE'; exit(system("/usr/lib/nagios/plugins/check_ping -H google.com -w 500,20% -c 1000,40% 1> /tmp/stdout.txt 2> /tmp/stderr.txt; echo $? > /tmp/res.txt")); return "PING WARNING - Packet loss = 0%, RTA = 62.08 ms|rta=62.07

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread Marilyn Sander
I On May 17, 2010, at 11:21 AM, John W. Krahn wrote: > John W. Krahn wrote: >> Kelly Jones wrote: >>> I did this in tcsh: >>> perl -le 'exit(2); sub END {system("date");}' ; echo $status >>> Mon May 17 11:09:43 MDT 2010 >>> 0 >>> >>> In other words, the return value of the date command in

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread John W. Krahn
John W. Krahn wrote: Kelly Jones wrote: I did this in tcsh: perl -le 'exit(2); sub END {system("date");}' ; echo $status Mon May 17 11:09:43 MDT 2010 0 In other words, the return value of the date command in an END subroutine overrides my desired exit value. How do I fix this? I want to tel

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread Paul Johnson
On Mon, May 17, 2010 at 11:54:32AM -0600, Kelly Jones wrote: > I did this in tcsh: > > > perl -le 'exit(2); sub END {system("date");}' ; echo $status > Mon May 17 11:09:43 MDT 2010 > 0 > > In other words, the return value of the date command in an END subroutine > overrides my desired exit value.

Re: system() call in END() subroutine overrides script exit value

2010-05-17 Thread John W. Krahn
Kelly Jones wrote: I did this in tcsh: perl -le 'exit(2); sub END {system("date");}' ; echo $status Mon May 17 11:09:43 MDT 2010 0 In other words, the return value of the date command in an END subroutine overrides my desired exit value. How do I fix this? I want to tell Perl: if I explicitl

system() call in END() subroutine overrides script exit value

2010-05-17 Thread Kelly Jones
I did this in tcsh: > perl -le 'exit(2); sub END {system("date");}' ; echo $status Mon May 17 11:09:43 MDT 2010 0 In other words, the return value of the date command in an END subroutine overrides my desired exit value. How do I fix this? I want to tell Perl: if I explicitly do exit($foo), I wa

Re: data dumper

2010-05-17 Thread Shawn H Corey
On 10-05-17 10:35 AM, Eric Veith1 wrote: "Bob McConnell" wrote on 05/17/2010 02:26:58 PM: > What is the difference between this and exporting a YAML file? Where > would either be preferred over the other? Except for the obvious syntax and that YAML might be easier to read for "end users" tha

RE: data dumper

2010-05-17 Thread Eric Veith1
"Bob McConnell" wrote on 05/17/2010 02:26:58 PM: > What is the difference between this and exporting a YAML file? Where > would either be preferred over the other? Except for the obvious syntax and that YAML might be easier to read for "end users" that just happen to edit a config file, I guess t

AW: data dumper

2010-05-17 Thread Thomas Bätzler
Bob McConnell asked: > >mBy saving the output of Data::Dumper to a *.pm file, it can be > reloaded mvia "use". > What is the difference between this and exporting a YAML file? Where > would either be preferred over the other? You don't need a YAML parser to read in a Perl source file. OTOH, it

RE: data dumper

2010-05-17 Thread Bob McConnell
From: Shawn H Corey >On 10-05-16 11:17 PM, Uri Guttman wrote: >> it can be used to save data (e.g. a config >> file) in a file for reloading in the future (via running the dumper >> output with eval). >m >mBy saving the output of Data::Dumper to a *.pm file, it can be reloaded >mvia "use". What i