On 1/11/07, hOURS <[EMAIL PROTECTED]> wrote:
Jay Savage <[EMAIL PROTECTED]> wrote: On 1/11/07, hOURS wrote: > > > Jay Savage wrote: On 1/11/07, hOURS wrote: > [snip] > Thanks Jay. I can't believe I didn't think of that myself. I put in the 1;'s and the "or die". It's not that the requires are failing - I get the same results. I added > print $@; > right after the eval block. Each time, that reads "The Unsupported function alarm function is unimplemented at line 5." What does that mean? > Fred > That means you don't have an alarm function, which probably means you're on Windows (AFAIK everything else implements a system alarm). If that's the case, you need to stop before you write any more code and read the perlport and Win32 manpages cover to cover. Then go take a look at the docs for the Win32 and Win32::Process modules. Doing that now will save you a lot of frustration later. You may also want to pick up a copy of Learning Perl on Win32 Systems. Since Windows doesn't implement an alarm function, you're probably going to need to rethink your approach: timing out require isn't really a viable option. Take a look at the combination of create and wait from WIn32::Process. HTH, -- jay -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of â will give rise to dom! Wow. Is windows such a rarity in the PERL world that no one thought of it 'til now? Yes, that would in fact be my problem. The rest of your message is pretty much foreign language to me though. And reading something cover to cover sounds daunting. I just need a way to do this one thing. Does anybody have any coding suggestions for a Windows user who may end up making requires to programs with infinite loops?
A rarity? No. But Windows *is* sufficiently different that there is a separate mailing list that deals with just these sorts of portability issues: http://lists.cpan.org/showlist.cgi?name=perl-win32-users. This list assumes that all questions refer to a reasonably modern "standard" Perl installation running on a POSIX-ish platform. If you're working on a platform that doesn't support the expected array of system calls and character sets or a version of Perl previous to 5.8, you'll get the help you need a lot faster by pointing up the differences. You'll also may find you don't need help at all if you read the supplied documentation. First of all it's just good netiquette, and second, you really will save yourself a lot of time and energy by reading the perlport and Win32 man pages. Neither of them is that long; you can read them both in less than 30 mins. Then the next time you run into a windows-specific issue, you won't have to wait around for one of us to tell you it's a windows-specific issue. If it's a FAQ, the solution will be right there in the docs, and if it's not a FAQ, at least you'll be able to get right to the question of "ok, how do I do this on Windows?" If the rest of my email is a foreign language, you really need to take a step back and read a good intro to Perl (the perltut manpage is a good place to start). The XXX::XXX notation refers to Perl modules. Win32 and Win32::Process are core modules to interact with Windows; they're installed when you install Perl on a Windows machine. They both offer a number of differnt routines for dealing with Windows idiosyncracies and you'll want to get familiar with them. In your particular case, the create() and wait() routines from the Win32::Process module may be helpful. Since Windows doesn't implement an alarm, though, you're going to have to get creative. My gut reaction is to launch an external process using Win32::Process->create that does nothing but require the module you're testing; set Win32::Process->wait; see if the external process times out; if it doesn't, require the module in the main program. That's convoluted, but it should work. HTH, -- jay -------------------------------------------------- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential daggerquill [at] gmail [dot] com http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org values of β will give rise to dom!