Re: "or die" question

2005-01-25 Thread John W. Krahn
Rod Jenkins wrote: After a failed open, I want to run two statements for an "or die". Code Quesiton: open (TEST, ">/tmp/test") or { die "Could not open test file\n"; syslog("LOG_ALERT","Could not open test file"); }; This does not work, but what is the "right" way to do

Re: "or die" question

2005-01-25 Thread Robert Boone
The "or " can call a subroutine. open (TEST, ">/tmp/test") or myDie(); sub myDie { syslog("LOG_ALERT","Could not open test file"); die "Could not open test file\n"; } On Tue, 2005-01-25 at 08:17 -0600, Rod Jenkins wrote: > After a failed open, I want to run two statements for

Re: "or die" question

2005-01-25 Thread Rod Jenkins
On Jan 25, 2005, at 8:33 AM, Bob Showalter wrote: Rod Jenkins wrote: After a failed open, I want to run two statements for an "or die". Code Quesiton: open (TEST, ">/tmp/test") or { die "Could not open test file\n"; syslog("LOG_ALERT","Could not open test fil

RE: "or die" question

2005-01-25 Thread Thomas Bätzler
Hi, > After a failed open, I want to run two statements for an "or die". > > Code Quesiton: > > open (TEST, ">/tmp/test") > or { > die "Could not open test file\n"; > syslog("LOG_ALERT","Could not open test file"); >}; > > This does not work, but w

RE: "or die" question

2005-01-25 Thread Bob Showalter
Rod Jenkins wrote: > After a failed open, I want to run two statements for an "or die". > > Code Quesiton: > > open (TEST, ">/tmp/test") > or { > die "Could not open test file\n"; > syslog("LOG_ALERT","Could not open test file"); >}; > > This does no

Re: "or die" question

2005-01-25 Thread Prasanna Kothari
interchange may work. { syslog("LOG_ALERT","Could not open test file"); die " .."; } or look for help of "eval " Rod Jenkins wrote: After a failed open, I want to run two statements for an "or die". Code Quesiton: open (TEST, ">/tmp/test") or { die "Could not open test file

"or die" question

2005-01-25 Thread Rod Jenkins
After a failed open, I want to run two statements for an "or die". Code Quesiton: open (TEST, ">/tmp/test") or { die "Could not open test file\n"; syslog("LOG_ALERT","Could not open test file"); }; This does not work, but what is the "right" way