help me die verbosely

2008-01-17 Thread Jonathan Mast
I want to write the errors caught by a 'die' clause into a file. In others words, open F ">>somefile.log"; blah->blah or die (print F $@) but the above does work. thanks

Fwd: help me die verbosely

2008-01-18 Thread Jonathan Mast
-- Forwarded message -- From: Jonathan Mast <[EMAIL PROTECTED]> Date: Jan 18, 2008 10:50 AM Subject: Re: help me die verbosely To: "Chas. Owens" <[EMAIL PROTECTED]> OK, so were binding an anonymous subroutine to the DIE signal? Does this need to go abov

Where is $main defined?

2008-01-22 Thread Jonathan Mast
I have a perl module that extensively uses a variable named "$main", which is apparently bound to the script that calls the library. I can't find where the exact semantics of this automagic variable defined. thanks, jhmast

Fwd: more fun with $main::

2008-02-08 Thread Jonathan Mast
Can you use the $main:: convention from inside a module to call a script subroutine? I know it can be used to reference fields from a script, but we seem to be having problems when trying to call a subroutine. thanks

Are comments allowed before package declarations in modules?

2008-02-26 Thread Jonathan Mast
I seem to have a vague memory about Perl not allowing comments before program statements, but I'm not sure. I really want to add a lot of comments at the top of a rather large module, but I'm unsure if thats safe. thanks

Filehandles in a socket server

2008-03-10 Thread Jonathan Mast
We have a socket server that, in addition to serving data, also writes logging statements to a file. My question concerns the correctness of how it accesses the log file. The script is running continuously and all the log file IO stuff is inside the main 'while' loop. The file is opened, written

Re: Filehandles in a socket server

2008-03-10 Thread Jonathan Mast
event memory leaks as per the above scenario or what? thanks again. On Mon, Mar 10, 2008 at 11:19 AM, Rob Dixon <[EMAIL PROTECTED]> wrote: > Jonathan Mast wrote: > > > > We have a socket server that, in addition to serving data, also writes > > logging statements to a fi

How do I get the contents of a url?

2008-03-12 Thread Jonathan Mast
How do I get the contents of a url? I mean passing a url to whatever object and receiving the content of that webpage as a scalar. I have a web service I want to test with perl, but I can't seem to find the right command or module to this despite looking quite a bit. thanks

How do I access module subroutines?

2008-04-08 Thread Jonathan Mast
I know this seems to be a very basic question, but I cannot figure out how to access a modules subroutines. We a module named FOO::BAR in which we access some hashes using this form: $FOO::BAR::hash1 and it works fine. When I try to access a subroutine in that same module, using this form: $var1

Re: How do I access module subroutines?

2008-04-09 Thread Jonathan Mast
Or I could just remove the $ from the call. $var1 = FOO::BAR::sub1(); works fine. I was referencing it like $FOO::BAR::sub1(); Thanks for the input however On Tue, Apr 8, 2008 at 1:12 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Tue, 2008-04-08 at 12:24 -0400, Jonathan M

Best way to grab lines n thru x of a file

2008-04-10 Thread Jonathan Mast
Hi, I have a ~125MB file of which I want to read lines n thru n+x and write those into a separate file. What is the best way to go about this? thanks

Re: Best way to grab lines n thru x of a file

2008-04-10 Thread Jonathan Mast
Thanks for all the input. The head / tail solution would work, but isn't very scalable. I did something similar on another file of comparable size and it took a long time to complete. The line numbers are 4million to 4million + some odd hundred thousand, just to give an idea of the size. The se

What does "print $cgi->header" do?

2008-04-21 Thread Jonathan Mast
There is a line in script we have that I find baffling, it is print $cgi->header; To me this seems to be printing the results of the header method of the CGI module to standard output. Is something else going on here as well? Thanks