From linux at codehelp.co.uk Sat Nov 1 10:46:19 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: body bags In-Reply-To: <200310312325.21142.linux@codehelp.co.uk> References: <20031031105443.GA8476@flumpet.demon.co.uk> <200310312325.21142.linux@codehelp.co.uk> Message-ID: <200311011646.26400.linux@codehelp.co.uk> On Friday 31 Oct 2003 11:25 pm, Neil Williams wrote: > Yet I can't catch this one: > > (in cleanup) Net::Z3950::Manager=HASH(0x82ab24c) can't forget > Net::Z3950::Connection=HASH(0x8358b00) at > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/Z3950/Manager.pm > line 310 during global destruction. > Event: trapped error: [sauco.csic.es:9909] connection refused I found the one answer I didn't want: http://perl.z3950.org/docs/todo.html Work still to be done in Net::Z3950.pm Things that need fixing include, but may not be limited to, the following. (They're listed in the order that they occurred to me, which is by no means order of importance or anything.) Creating a non-blocking COMSTACK to a non-existent server (e.g. ECONNREFUSED) is not properly diagnosed, yielding a SIGPIPE instead of a graceful error report. i.e. it's a BUG in the module. There's more goodies too, including: "Improve the reporting of Z39.50 errors. " I hadn't noticed any error reporting! That's why I need __DIE__ !! I'd still be interested in any ideas to catch this SIGPIPE on connrefused. -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031101/cf527a3e/attachment.bin From theo at crazygreek.co.uk Tue Nov 4 22:22:30 2003 From: theo at crazygreek.co.uk (Theo P. Zourzouvillys) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: meeting In-Reply-To: References: <20031031111335.GA8571@flumpet.demon.co.uk> Message-ID: <200311050422.31066.theo@crazygreek.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 31 October 2003 11:52 am, Matthew Browning wrote: > where's the silver-bullet framework for Perl-CGI? I used to do a lot with Mason, which is [rather] nice, and pretty fast deveoplment once you get your head around it. it scales /fairly/ well. these days whenever i get some time to code something, i'll use pure mod_perl, xml/xslt, which works the best for me for the larger type of project. ~ Theo - -- Theo Zourzouvillys -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/qHsG448CrwpTn6YRAnhNAJ4hpyWqhruKlqx2SKLebf2mqVRJjgCfeA4t w8uwMsDqUFHlOUK3AH9q+Fc= =brov -----END PGP SIGNATURE----- From mb at matthewb.org Tue Nov 4 23:14:48 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: meeting In-Reply-To: <200311050422.31066.theo@crazygreek.co.uk> References: <20031031111335.GA8571@flumpet.demon.co.uk> <200311050422.31066.theo@crazygreek.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 05 November 2003 04:22, Theo P. Zourzouvillys wrote: > On Friday 31 October 2003 11:52 am, Matthew Browning wrote: > > where's the silver-bullet framework for Perl-CGI? > > these days whenever i get some time to code something, i'll use pure > mod_perl, xml/xslt, which works the best for me for the larger type > of project. > Hmm. I've recently started to get my feet wet with AxKit: http://www.axkit.org/ ...which seems pretty cool but I'm nowhere near confident enough to be an advocate (yet). However many times I go through it, I can't get XSL to sit comfortably in my head. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/qIdOy5o0lRFL2ooRAnJZAKCRq9UDprLsulNwLY2jbijMxlsCOQCfWEMm 8Q53q7knvWMAJugQtohWec4= =rGgg -----END PGP SIGNATURE----- From linux at codehelp.co.uk Wed Nov 5 15:21:20 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: meeting In-Reply-To: References: <20031031111335.GA8571@flumpet.demon.co.uk> <200311050422.31066.theo@crazygreek.co.uk> Message-ID: <200311052121.21550.linux@codehelp.co.uk> On Wednesday 05 Nov 2003 5:14 am, Matthew Browning wrote: > On Wednesday 05 November 2003 04:22, Theo P. Zourzouvillys wrote: > > On Friday 31 October 2003 11:52 am, Matthew Browning wrote: > However many times I go through it, I can't get XSL to sit comfortably > in my head. I have a few pages on XSLT which might help - it's aimed at transforming XML into HTML but it should illustrate the structure. (I was experimenting with putting all the data in XML and all the presentation in XSLT - this would then be parsed to create an XHTML page using CSS. It did save >50% of the previous web space for those pages but it was quite restrictive and not as easy to maintain as I had hoped. Plus, XSLT=>XHTML never left IE-only territory and I simply moved to PHP instead of pursuing XSL/CSS.) http://www.codehelp.co.uk/html/glossary2.html http://www.codehelp.co.uk/html/examplehelp2.html http://www.codehelp.co.uk/html/fourth.html http://www.codehelp.co.uk/html/fifth.html -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031105/6137557b/attachment.bin From Simon at wretched.demon.co.uk Tue Nov 11 15:26:59 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Errors and Exceptions included Message-ID: <3FB15423.8000003@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Okay, getting into Perl a bit further this week, my brain was reasonably together today even if it did take me a minute or two to dereference the return values from selectall_arrayref method in DBI. Are there any guidelines or good articles on error handling in Perl? The current program I'm working on it using "eval"/"die"/"$@" very much in the style of exception handling one might do in other languages (e.g. Java try/catch). I'm reasonably happy with it for this small program, although I get the feeling it was only ever intended for very rare error conditions. Things like if I pass the error message up, I'm going to want to trim the line number, as the end user doesn't really care at what line things failed, give me this impression. Google was remarkably unhelpful, throwing me a really interesting discussion on Perl coding standards.... or did I miss a manual page? Simon -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/sVQhGFXfHI9FVgYRAjKDAKDFQa6N5gOwdU/X4+L0dQCIoCrvWACfYE/y 3kK3bklEZlw9CH/QrYV0kck= =H86u -----END PGP SIGNATURE----- From mb at matthewb.org Tue Nov 11 23:31:31 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Errors and Exceptions included In-Reply-To: <3FB15423.8000003@wretched.demon.co.uk> References: <3FB15423.8000003@wretched.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 11 November 2003 21:26, Simon Waters wrote: > Are there any guidelines or good articles on error handling in Perl? > > The current program I'm working on it using "eval"/"die"/"$@" very > much in the style of exception handling one might do in other > languages (e.g. Java try/catch). > This is apparently not my area of expertise but I will point out the existance of Error.pm: http://search.cpan.org/~uarun/Error-0.15/Error.pm ...which gives you try, catch etc. in a nice interface. This is my solution if I'm experiencing this kind of problem and want to keep things tidy. > I'm reasonably happy with it for this small program, although I get > the feeling it was only ever intended for very rare error conditions. > Things like if I pass the error message up, I'm going to want to trim > the line number, as the end user doesn't really care at what line > things failed, give me this impression. > To trim the line number from a die message stick a newline at the end of it: die "I am dead"; # I am dead at line x die "I am dead\n"; # I am dead MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/scW5y5o0lRFL2ooRAh5eAKDXxTnOsAyUKDSmrKm77db6Xqp/cgCeKCNR Y7sMvISoiljHYZpGL3Ci1VA= =X33c -----END PGP SIGNATURE----- From linux at codehelp.co.uk Sat Nov 15 09:08:42 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Can Makefile.PL accept command-line parameters? Message-ID: <200311151508.46662.linux@codehelp.co.uk> I'm currently testing this patch to a Makefile.PL --- Makefile.PL Tue Sep 16 14:26:57 2003 +++ isbnsearchMakefile.PL Wed Nov 12 14:09:27 2003 @@ -1,7 +1,32 @@ # $Header: /home/cvsroot/NetZ3950/Makefile.PL,v 1.6 2003/05/09 10:33:23 mike Exp $ -my $yazinc = `yaz-config --cflags`; -my $yazlibs = `yaz-config --libs`; +# isbnsearch customisation enabler +# Either call the script using a pipe: +# echo "/home/user/path/" | perl isbnsearchMakeFile.PL +# /home/user/path/ = path to yaz_config +my $prefix; +# OR: enter the same path and uncomment the next line: +# Make sure path ends in / +# $prefix = ""; +my $yazinc; +my $yazlibs; +if(!$prefix) { + while(<>) { + $prefix .= $_; + } +} +if($prefix) { + chomp($prefix); + $prefix .= "yaz-config"; + $yazinc = qx/$prefix --cflags/; + $yazlibs = qx/$prefix --libs/; +} +else { + $yazinc = `yaz-config --cflags`; + $yazlibs = `yaz-config --libs`; +} +# end isbnsearch + if (!$yazinc || !$yazlibs) { die "ERROR: Unable to call script 'yaz-config': is YAZ installed?"; } Yes, it's my old friend, Net::Z3950 again. The problem is that using while(<>) {} means that I can only pass the prefix using: echo "/home/siteuser/path/" | perl Makefile.PL The full documentation for what I'm trying to do is here: http://www.isbn.org.uk/docs/install.html Also, if I fail to pass something via echo, Perl hangs on the Makefile. Therefore, I've added a line that allows the prefix to be edited within the Makefile as well. +# $prefix = ""; I'm looking for a more elegant way of doing it, so that instead of: perl -MCPAN -e 'install Net::Z3950' I can use: download NetZ3950.pm apply patch to Makefile.PL perl Makefile.PL --prefix /home/siteuser/path/ Although I suspect Perl won't do that. The path will differ for each user of the patch and I'm trying to reduce the workload / confusion. -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031115/467d6d81/attachment.bin From mb at matthewb.org Sun Nov 16 02:59:53 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Can Makefile.PL accept command-line parameters? In-Reply-To: <200311151508.46662.linux@codehelp.co.uk> References: <200311151508.46662.linux@codehelp.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 15 November 2003 15:08, Neil Williams wrote: [ snipped example ] > I'm looking for a more elegant way of doing it, so that instead of: > perl -MCPAN -e 'install Net::Z3950' > > I can use: > download NetZ3950.pm > apply patch to Makefile.PL > perl Makefile.PL --prefix /home/siteuser/path/ > > Although I suspect Perl won't do that. > > The path will differ for each user of the patch and I'm trying to > reduce the workload / confusion. > I would definitely not call the argument `prefix' if I was doing this - there is a clear possibility for confusion between that and the common PREFIX option. Reducing confusion is good but I'd also be concerned about breaking the expected behaviour of a Makefile.PL - anyone else got a better opinion on this? You could use Getopt::Long (standard module) to capture the command-line argument and die with a usage message if the arg is not supplied nor hard-coded. I wonder if it might be possible to also try using `locate' in the script to find the yaz binary? Had a late night last night and suspect my reasoning may be a little off-centre still but it sounds like it might be worth a try...hmm, seems someone has done a spectacularly pointless module for this: http://search.cpan.org/~vparseval/File-Locate-0.01/Locate.pm MB (sorry if I've missed the point) - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/tzyPy5o0lRFL2ooRArd3AKDrkf3Mnxky/FKtN7yi+QJFsd9A+ACgil9H aDnXQYkslDs/xOQa7SJ/mhw= =CyVk -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Nov 17 03:53:25 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling Message-ID: <20031117095325.GA2731@flumpet.demon.co.uk> So, what are people using for image scaling these days? I've been using GD, but it seems a bit overkill. Steve From mb at matthewb.org Mon Nov 17 03:51:49 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <20031117095325.GA2731@flumpet.demon.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 17 November 2003 09:53, Steve Marvell wrote: > So, what are people using for image scaling these days? > > I've been using GD, but it seems a bit overkill. > PerlMagick. But I try to steer clear of the area. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/uJo1y5o0lRFL2ooRAvcvAJ9QkOAxTaqw/Xp00FysMw5v5TVQkgCg7KLu wohfKipx1szbMgf5DuM1yy8= =onM4 -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Nov 17 04:11:13 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: References: <20031117095325.GA2731@flumpet.demon.co.uk> Message-ID: <20031117101113.GA2879@flumpet.demon.co.uk> Matthew Browning wrote: > > I've been using GD, but it seems a bit overkill. > > PerlMagick. But I try to steer clear of the area. Even bigger then :) Steve From mb at matthewb.org Mon Nov 17 04:20:28 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <20031117101113.GA2879@flumpet.demon.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> <20031117101113.GA2879@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 17 November 2003 10:11, Steve Marvell wrote: > Matthew Browning wrote: > > > I've been using GD, but it seems a bit overkill. > > > > PerlMagick. But I try to steer clear of the area. > > Even bigger then :) > Uh, yeah. And grotty to use also. This sort of thing comes up for me when doing some kind of CMS with loads of users who want to upload photos of stuff they have done. I've found it such a nightmare in the past to provide defence against 15MB 1024*768 photos (in a way that keeps them looking okay) that my inclination is, rather, to provide education in client-side image processing for web-delivery. You can set a maximum upload size but your end users don't particularly dig error messages, however helpful they are. No doubt I need to go read some book about graphics processing somewhere but if anyone in mongerland has a *good* experience of dealing with this kind of problem I'm ready to hear it. MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/uKDsy5o0lRFL2ooRAveNAKDTFaLiPRkS0PKoWJwcYXxUEKtB4ACfdEJ4 gjPAp6asYirTBF3CaVeU55g= =2TbL -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Nov 17 04:42:22 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: References: <20031117095325.GA2731@flumpet.demon.co.uk> <20031117101113.GA2879@flumpet.demon.co.uk> Message-ID: <20031117104222.GA3087@flumpet.demon.co.uk> Matthew Browning wrote: > No doubt I need to go read some book about graphics processing > somewhere but if anyone in mongerland has a *good* experience of > dealing with this kind of problem I'm ready to hear it. You want a graphic design, that what you want. Steve From mb at matthewb.org Mon Nov 17 04:40:31 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <20031117104222.GA3087@flumpet.demon.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> <20031117104222.GA3087@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 17 November 2003 10:42, Steve Marvell wrote: > Matthew Browning wrote: > > No doubt I need to go read some book about graphics processing > > somewhere but if anyone in mongerland has a *good* experience of > > dealing with this kind of problem I'm ready to hear it. > > You want a graphic design, that what you want. > How do you mean? Graphic designER? That would be good. I've thought about doing a course or something myself in `design for the www' or somesuch but having perused other people's course-notes I fear that I would lack the patience ;) - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/uKWgy5o0lRFL2ooRAruwAKDPJXnZcW41hIW4cJ4ugtOzT0KF0QCg3AsB ICYs8AfUf/8Dw7RyGf4P0I4= =2Bjg -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Nov 17 04:55:27 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: References: <20031117095325.GA2731@flumpet.demon.co.uk> <20031117104222.GA3087@flumpet.demon.co.uk> Message-ID: <20031117105527.GA3125@flumpet.demon.co.uk> Matthew Browning wrote: > How do you mean? Graphic designER? That would be good. That's what I meant. > I've thought about doing a course or something myself in `design for > the www' or somesuch but having perused other people's course-notes I > fear that I would lack the patience ;) I'd hate it. Steve From linux at codehelp.co.uk Mon Nov 17 13:03:16 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <20031117095325.GA2731@flumpet.demon.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> Message-ID: <200311171903.17618.linux@codehelp.co.uk> On Monday 17 Nov 2003 9:53 am, Steve Marvell wrote: > So, what are people using for image scaling these days? After a little research on a post on the DCLUG mailing list: http://freshmeat.net/projects/netpbm/?topic_id=100 NetPBM (formerly PBMplus) is a package of over 220 programs that convert from one graphics format to another and do simple editing and analysis of images. There are no interactive tools in this package, and nothing that displays graphics of any kind. It is like a non-GUI equivalent of ImageMagick, GIMP, and Adobe Photoshop, etc. Over 100 graphics formats are handled, including JPEG, MPEG, PNG, GIF, TIFF, BMP, XWD, XBM, G3 fax, and special formats used by digital cameras and handheld computers. > > I've been using GD, but it seems a bit overkill. > > Steve -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031117/608d3072/attachment.bin From linux at codehelp.co.uk Mon Nov 17 16:04:42 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: body bags In-Reply-To: <20031031105443.GA8476@flumpet.demon.co.uk> References: <20031031105443.GA8476@flumpet.demon.co.uk> Message-ID: <200311172204.43134.linux@codehelp.co.uk> On Friday 31 Oct 2003 10:54 am, Steve Marvell wrote: > On the subject of "what do I do with a die from a module way way down > the chain of command?": > > #!/usr/bin/perl > > local $SIG{__DIE__} = sub { > die "You killed Kenny! @_"; > }; > > die "you bastard"; > > Be careful not to exit() in these handlers, since that really break > thing when someone evals it and expects to catch the dies. OK, I've done quite a few more upgrades since the meeting - including adding a rollover and a lot more servers > 500 now. The script already tries 6 queries sequentially per run. It also now repeats to a new server if there's no DNS etc. because die() isn't dying. Net result (sorry), is that I got a cron report tonight that instead of giving the usual 4 to 6 message reports, gave 45! 15kb! So by handling die(), I'm allowing the script to continue again and again. It stops when it has finally contacted and queried successfully for each query - unless it segfaults. I'm trying to handle / prevent as many of these as I can but I don't actually get notified of a segfault - the cron report ends, the result is emailed and the segfault is only reported to the remote server logs. (I never see it on the remote reports, even though it does appear on similar local console printouts.) Should I use exit() anyway - in the top level code? There are times when the die() that has been handled is leaving the underlying module code in a bad state. e.g. after an ECONNREFUSED, I quite often get a broken pipe error - yet the server connection reporting the broken pipe is always fine when tested separately. I also get cleanup errors from undefined connections created using new() that cannot then be destroyed. -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031117/1db35992/attachment.bin From theo at crazygreek.co.uk Mon Nov 17 17:15:55 2003 From: theo at crazygreek.co.uk (Theo P. Zourzouvillys) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: body bags In-Reply-To: <200311172204.43134.linux@codehelp.co.uk> References: <20031031105443.GA8476@flumpet.demon.co.uk> <200311172204.43134.linux@codehelp.co.uk> Message-ID: <200311172315.55776.theo@crazygreek.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 17 November 2003 10:04 pm, Neil Williams wrote: > I quite often get a broken pipe error - > yet the server connection reporting the broken pipe is always fine when > tested separately. are you ignoring SIGPIPE? ~ Theo - -- Theo Zourzouvillys -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/uVar448CrwpTn6YRAsHqAJ9Q1ogwEj94DDRLpX9NTVVcrxIk6QCfdcR0 zai3Y5HK/5AGSHrDPFapMRw= =1/8V -----END PGP SIGNATURE----- From linux at codehelp.co.uk Mon Nov 17 17:47:54 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: body bags In-Reply-To: <200311172315.55776.theo@crazygreek.co.uk> References: <20031031105443.GA8476@flumpet.demon.co.uk> <200311172204.43134.linux@codehelp.co.uk> <200311172315.55776.theo@crazygreek.co.uk> Message-ID: <200311172347.58807.linux@codehelp.co.uk> On Monday 17 Nov 2003 11:15 pm, Theo P. Zourzouvillys wrote: > On Monday 17 November 2003 10:04 pm, Neil Williams wrote: > > I quite often get a broken pipe error - > > yet the server connection reporting the broken pipe is always fine when > > tested separately. > > are you ignoring SIGPIPE? Not expressly, but I think the module way down the chain is calling die() on a broken pipe - I sometimes get broken pipe errors on their own. I suppress all WARN messages and handle DIE but no others. (thanks to Steve 'cos I hadn't done any of that until now.) The script itself is on SourceForge, isbnsearch. http://cvs.sourceforge.net/viewcvs.py/isbnsearch/isbnsearch/config/fallbackisbn.pl and select text. Browsing CVS on SourceForge is behind the actual CVS and I've added more code recently, but v1.3 is the one with a functional DIE handler and tidy error handling messages. -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031117/f46c9fac/attachment.bin From theo at crazygreek.co.uk Mon Nov 17 18:19:45 2003 From: theo at crazygreek.co.uk (Theo P. Zourzouvillys) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: body bags In-Reply-To: <200311172347.58807.linux@codehelp.co.uk> References: <20031031105443.GA8476@flumpet.demon.co.uk> <200311172315.55776.theo@crazygreek.co.uk> <200311172347.58807.linux@codehelp.co.uk> Message-ID: <200311180019.45502.theo@crazygreek.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 17 November 2003 11:47 pm, Neil Williams wrote: > Not expressly, but I think the module way down the chain is calling die() > on a broken pipe - I sometimes get broken pipe errors on their own. I > suppress all WARN messages and handle DIE but no others. try ignoring SIGPIPE, as if you are reading data from a server that dumps data onto the socket, then closes it without lingering for a close, you will sometimes get a SIGPIPE before you've finished reading all your data from the sockets kernel buffer ;) ~ Theo - -- Theo Zourzouvillys -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/uWWh448CrwpTn6YRAtBfAKDEKGWPwnTbddbYmLOjdjzhkbfxwgCfZs/h vPLX242oQ5OWwRk42hRWrqM= =wHdO -----END PGP SIGNATURE----- From steve at devon-it.co.uk Tue Nov 18 05:20:26 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <200311171903.17618.linux@codehelp.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> <200311171903.17618.linux@codehelp.co.uk> Message-ID: <20031118112026.GB9262@flumpet.demon.co.uk> Neil Williams wrote: > NetPBM (formerly PBMplus) is a package of over 220 programs I'm still waiting for a good perl interface. Steve From mb at matthewb.org Tue Nov 18 14:05:39 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Here we go again... Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [matthewb@odette:~]$ cal November 2003 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Yoinks! Looks like it is just nine days until the November DCPM meeting comes round. (last Thursday in November = 27.11.03) It was determined last time that the next meeting would be `somewhere near Barnstaple' because Steve asked for that in October and I ignored him so we *definitely* have to do it this time ;) Since I've not been to Barnstaple much I need someone who knows the town to nominate a pub and publish its whereabouts. Clearly, now is a good time to ask for lifts etc. I also suggest that finalised details are published to the DCLUG list this time. [...] On a side note, what's the best book on Postgres? Any suggestions welcome. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/unuTy5o0lRFL2ooRAsyxAJ44Jvnx8GTOnp/p8WrLIYHEzQAyQACZAWAY /RSfRD0FTEMMniOqRPA+W6c= =jcGI -----END PGP SIGNATURE----- From Simon at wretched.demon.co.uk Tue Nov 18 14:44:49 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Postgres In-Reply-To: References: Message-ID: <3FBA84C1.8020907@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matthew Browning wrote: > > On a side note, what's the best book on Postgres? Any suggestions > welcome. The online manual has only let me down once. It was a tad vague on how to figure out where your tables, and indexes, are on disk, which is really a big (old?) database admin mentality thing. These days just stripe and mirror everywhere or let the RAID controller optimise your disk IO HP style. It was documented but buried away, and keeps changing from what I can gather. Q: I mean how much do you need to know about a relational database? A: It talks SQL ;) I know it has some funky features like HTML output, and unique abilities when it comes to doing non-relational stuff (table hierarchies), but I either never needed them, or wanted to do them in a portable fashion. The only bit I have found causes any pause for thought are the way it handles authentication, but once you get the hang it is remarkably flexible, allowing me to trust "postgres" locally to do unattended backup, but insist on passwords for all other connections to the database. Oh and there was a recent security patch for the networking, but that applies to everything these days as far as I can tell. -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/uoS/GFXfHI9FVgYRAl1rAJwPUc3aBevzO6pZp6q0T4Bsycv8LACg2SB3 4MsSfR2Lws0PcABpcJUdxNc= =uaEh -----END PGP SIGNATURE----- From Simon at wretched.demon.co.uk Tue Nov 18 16:09:13 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <20031117095325.GA2731@flumpet.demon.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> Message-ID: <3FBA9889.1070105@wretched.demon.co.uk> Steve Marvell wrote: > So, what are people using for image scaling these days? > > I've been using GD, but it seems a bit overkill. I try not to, but the company I work for now has a load of libraries that do lots of funky image manipulation which they inherited from their days of doing image manipulation software. Indeed one of the guys in the Office still writes graphics software fulltime. So I guess I do it by asking the guys who sit behind me nicely ;) How do you do it in GD with Perl by the way? I'm curious as I had to install the latest version to get the Perl graphics stuff working on Redhat 9, be interested to compare it to te stuff at work if I get an idle moment. Simon -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 218 bytes Desc: not available Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031118/479a96fd/attachment.bin From mb at matthewb.org Tue Nov 18 22:06:50 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: image scaling In-Reply-To: <3FBA9889.1070105@wretched.demon.co.uk> References: <20031117095325.GA2731@flumpet.demon.co.uk> <3FBA9889.1070105@wretched.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 18 November 2003 22:09, Simon Waters wrote: > > How do you do it in GD with Perl by the way? Using Lincoln Stein's interface class (GD.pm). See also GD::Graph (file under: ubiquitous). MB. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/uuxgy5o0lRFL2ooRAiH7AJ9RneTVjYGGjzbbdywH35gF0oLpRACeIJDZ M+u3tup+H5E1vtuAulTYZK0= =vcju -----END PGP SIGNATURE----- From steve at devon-it.co.uk Thu Nov 20 04:58:00 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Here we go again... In-Reply-To: References: Message-ID: <20031120105800.GA13106@flumpet.demon.co.uk> Matthew Browning wrote: > Since I've not been to Barnstaple much I need someone who knows the > town to nominate a pub and publish its whereabouts. Will people be mostly driving or getting the train? Steve From steve at devon-it.co.uk Thu Nov 20 04:58:51 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Postgres In-Reply-To: <3FBA84C1.8020907@wretched.demon.co.uk> References: <3FBA84C1.8020907@wretched.demon.co.uk> Message-ID: <20031120105851.GB13106@flumpet.demon.co.uk> Simon Waters wrote: > The online manual has only let me down once. I agree. I have a paper book and never pick it up. Steve From mb at matthewb.org Thu Nov 20 04:58:40 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Here we go again... In-Reply-To: <20031120105800.GA13106@flumpet.demon.co.uk> References: <20031120105800.GA13106@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 20 November 2003 10:58, Steve Marvell wrote: > Matthew Browning wrote: > > Since I've not been to Barnstaple much I need someone who knows the > > town to nominate a pub and publish its whereabouts. > > Will people be mostly driving or getting the train? > I'll be on the train. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/vJ5oy5o0lRFL2ooRApc4AJ43muAaRRzb0GsLy28hI4GwC4Q+/ACfR3tf EYqPOn6Z6o0WoLbrdL3FcLw= =xYfF -----END PGP SIGNATURE----- From linux at codehelp.co.uk Tue Nov 25 17:35:06 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Here we go again... In-Reply-To: References: <20031120105800.GA13106@flumpet.demon.co.uk> Message-ID: <200311252335.07264.linux@codehelp.co.uk> On Thursday 20 Nov 2003 10:58 am, Matthew Browning wrote: > On Thursday 20 November 2003 10:58, Steve Marvell wrote: > > Matthew Browning wrote: > > > Since I've not been to Barnstaple much I need someone who knows the > > > town to nominate a pub and publish its whereabouts. Any decision yet? > > > > Will people be mostly driving or getting the train? > > I'll be on the train. I'll be driving. -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031125/55b3afc6/attachment.bin From steve at devon-it.co.uk Wed Nov 26 06:34:45 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Here we go again... In-Reply-To: <200311252335.07264.linux@codehelp.co.uk> References: <20031120105800.GA13106@flumpet.demon.co.uk> <200311252335.07264.linux@codehelp.co.uk> Message-ID: <20031126123444.GA10683@flumpet.demon.co.uk> Neil Williams wrote: > > > > Since I've not been to Barnstaple much I need someone who knows the > > > > town to nominate a pub and publish its whereabouts. > > Any decision yet? I'm mad busy, it'll have to wait a little while, sorry. Steve From mb at matthewb.org Sat Nov 29 08:20:40 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: emacs sytax highlighting in cperl-mode Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This has been discussed before and relates to the process of programming Perl so is not that OT. The other day it came to my attention that it was now possible to compile GNU Emacs with GTK2 and, as such, make it look prettier. So I checked out the latest version from CVS and decided to have a go the other night. Now, `This is GNU Emacs 21.3.50.3 (i686-pc-linux-gnu, GTK+ Version 2.2.4)' and I am typing into it on a Saturday with loads of work to do and I noticed something about cperl-mode...I can't break the syntax highlighting. Seriously. I just did this: print qq[this is testing emacs]; print < If a module doesn't use a default timeout on sockets that are created internally - within another module perhaps two further down the chain - is there a way for Perl to enforce a timeout of 5 seconds? I'm verifying a list of 1100 servers and so far the majority simply don't respond (to anything). The script just hangs around waiting for a reply that will never come. I've left some for >30 minutes. It makes me think that there's something in how Perl itself is configured as I do get timeout error messages from the webhost when a similar delay occurs on the site, but not locally on Mandrake 9.1 In PHP there's an easy config setting that changes the timeout per script or per installation. Is there anything like that in Perl? (That doesn't require me to re-install / re-compile Perl itself!) I can't use Ping to verify in advance as a lot of the servers don't respond to ping requests - even when they are working normally. -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031130/395cd6c2/attachment.bin From mb at matthewb.org Sun Nov 30 09:06:38 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Timeouts in modules In-Reply-To: <200311301322.58452.linux@codehelp.co.uk> References: <200311301322.58452.linux@codehelp.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 30 November 2003 13:22, Neil Williams wrote: > > In PHP there's an easy config setting that changes the timeout per > script or per installation... In IO::Socket there is a timeout method but presumably your process is instantiated by some module up the hierarchy. You could take a look at this (source is nothing to do with me and I do not approve of it): http://www.foo.be/docs/perl/advprog/ch05_06.htm - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/ygd+y5o0lRFL2ooRAmXIAKCNhgPMTyQvABahhxw3xFMsZnzw3gCdFg7Q lO09DshLWfsHeb05yGGdkIE= =D+Q6 -----END PGP SIGNATURE----- From linux at codehelp.co.uk Sun Nov 30 10:13:40 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Timeouts in modules In-Reply-To: References: <200311301322.58452.linux@codehelp.co.uk> Message-ID: <200311301613.45715.linux@codehelp.co.uk> On Sunday 30 Nov 2003 3:06 pm, Matthew Browning wrote: > On Sunday 30 November 2003 13:22, Neil Williams wrote: > > In PHP there's an easy config setting that changes the timeout per > > script or per installation... > > In IO::Socket there is a timeout method but presumably your process is > instantiated by some module up the hierarchy. Correct, I can't use the IO::Socket method. > You could take a look at this (source is nothing to do with me and I do > not approve of it): > > http://www.foo.be/docs/perl/advprog/ch05_06.htm The official perldoc does have a similar example. http://www.perldoc.com/perl5.8.0/pod/perlipc.html#Signals I can't get it to work. When I use alarm 5; I can get the script to terminate with Alarm clock but I can't handle $SIG{ALRM} - the alarm is suddenly and completely ignored! eval{ local $SIG{ALRM} = sub{ die "my own alarm" }; alarm 5; $conn = $mgr->connect("$server", "$port"); alarm 0; }; my own alarm is never shown, the timeout is ignored and the script just continues waiting for nothing. If I comment out the local ALRM handler, the script ends with Alarm clock - I want the script to continue with the error being logged! The main die() handler is not getting in the way because I can remove it and still the alarm will not work if $SIG{ALRM} is used but it will halt the script completely if it is not. This needs to be called from within a for() loop - does that make a difference? I've tried with the local $SIG{ALRM} = sub{ die "my own alarm" }; line inside and outside the loop, inside or outside the eval{}; Incidentally, why must the eval have }; at the end instead of just } ? -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031130/b27fc63d/attachment.bin From Simon at wretched.demon.co.uk Sun Nov 30 14:03:16 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Timeouts in modules In-Reply-To: <200311301613.45715.linux@codehelp.co.uk> References: <200311301322.58452.linux@codehelp.co.uk> <200311301613.45715.linux@codehelp.co.uk> Message-ID: <200311302003.16408.Simon@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Neil, I tried this simplified version of your script, which works fine. How are you handling the alarm outside the block? #!/usr/bin/perl eval{ local $SIG{ALRM} = sub{ die "my own alarm" }; alarm 5; my $input=<>; alarm 0; }; if ( $@ =~ /my own alarm/) { print "Too slow\n"; } I'm still mastering Perl, but assume the called code could also use or redefine the alarm signal handler? -----BEGIN PGP SIGNATURE----- Comment: Encryption...is a powerful defensive weapon for free people. iD8DBQE/yk0EGFXfHI9FVgYRAlTmAKDViwdmNbXfIrtYCi1/Sz5UD74iiACfZBPs FsycMSRXyjK8pj6NkMNFcEo= =xc1p -----END PGP SIGNATURE----- From linux at codehelp.co.uk Sun Nov 30 15:17:03 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:51 2004 Subject: DCPM: Timeouts in modules In-Reply-To: <200311302003.16408.Simon@wretched.demon.co.uk> References: <200311301322.58452.linux@codehelp.co.uk> <200311301613.45715.linux@codehelp.co.uk> <200311302003.16408.Simon@wretched.demon.co.uk> Message-ID: <200311302117.06800.linux@codehelp.co.uk> On Sunday 30 Nov 2003 8:03 pm, Simon Waters wrote: > Neil, > > I tried this simplified version of your script, which works fine. > How are you handling the alarm outside the block? The full script is here, minus the handler code which caused the alarm to be missed. http://isbnsearch.sourceforge.net/verify.html > #!/usr/bin/perl > eval{ > local $SIG{ALRM} = sub{ die "my own alarm" }; > alarm 5; > my $input=<>; > alarm 0; > }; > > if ( $@ =~ /my own alarm/) { > > print "Too slow\n"; > > } Example of one of the alternatives tried: eval{ local $SIG{ALRM} = sub{ die"Alarm" }; alarm(10); $conn = $mgr->connect("$server", "$port"); alarm 0; }; if ($@ =~ /Alarm/) { $bug = 9; report; next; } report is a simple MySQL + print subroutine. I tried all manner of handler codes, from simple print statements like that, to full MySQL output. My problems seem to be based around either the loop (because all the examples use the eval{} block in a straight piece of code) or the module (which must the most awkward module I've ever tried to understand). My connect call has to go into a loop that can be called maybe 600 times. I wouldn't expect to define the local $SIG{ALRM} line each time through the loop, but putting the local definition line outside (near the top of the script) doesn't change the lack of handling. > I'm still mastering Perl, but assume the called code could also use or > redefine the alarm signal handler? With an alarm handler defined, I get: [neil@mdk91 notes]$ perl -T verify.pl Content-type: text/plain Server count: 196 IP: 198.168.27.3 Server: www.biblinat.gouv.qc.ca, port: 210, database: IRIS (I have to force the script to end using Ctrl-C). With the alarm handler commented out or replaced with local $SIG{ALRM}=''; I get: [neil@mdk91 notes]$ perl -T verify.pl Content-type: text/plain Server count: 196 IP: 198.168.27.3 Server: www.biblinat.gouv.qc.ca, port: 210, database: IRIS Alarm clock Note the Alarm clock default which halts the script - the alarm is working. So I tried your example of input =<>; and the alarm becomes active again: ### isbnsearch cron task error report: 1 ### --- isbnsearch ERROR: 5 Script crash - see mailing list --- Error connecting to www.biblinat.gouv.qc.ca Server details: IRIS - www.biblinat.gouv.qc.ca : 210 Reason: Interrupted system call OK, it's not the error report I was expecting, (it should be error 9 not error 5) but at least it shows that the loop isn't the problem - the error repeated for subsequent servers with the same delays - but it means it's going to be harder still to deal with the problem. It means now that the problem must be related to the module. eval{ alarm(10); # $conn = $mgr->connect("$server", "$port"); my $input=<>; alarm 0; }; works - albeit with error 5 instead of 9 as defined by the handler. By deliberately setting 9 in the handler, before calling die, I get the right error message: local $SIG{ALRM} = sub{ $bug = 9; die"error9" }; if ($@ =~ /error9/) { $bug = 9; print STDERR "alarm handled OK\n"; report; next; } (The handler is never being called because the print statement is ignored - the error output below is created by the die handler which acts as a catch-all. ### isbnsearch cron task error report: 1 ### --- isbnsearch ERROR: 9 Connection request timed out --- Error connecting to z3950.bl.uk Server details: MAR - z3950.bl.uk : 2020 Reason: Interrupted system call Server IP address: 194.66.234.45 Connection request timeout error. (Reason is the output from $! - does that give any clues?) (The Connection time out stuff is manual output generated from setting the error to 9.) As soon as I re-instate the original $conn=$mgr->connect() line, the alarm is completely ignored, the handler is never called, the script doesn't die until the default timeout of some 200 seconds and I can only get it working again by deleting the handler code. local $SIG{ALRM} = ''; But then all I get is Alarm clock again + halt. Is $@ being overridden by the call within the alarm block? Even when I comment out the entire die handler (+ warn handler too), $SIG{ALRM}=sub{die"anything"}; doesn't work! -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: signature Url : http://mail.pm.org/archives/devoncornwall-pm/attachments/20031130/3d43ee56/attachment.bin