From mb at matthewb.org Mon Oct 13 03:51:52 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Perl Mongers Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 A few points: 1. I have just found out about this: http://www.oreilly.com/catalog/perltoolkt/ (O'Reilly book on Template Toolkit co-written by Cross). In my little world this is a matter of great interest ;) 2. I am actually going to do something about the web site shortly. I have collated various bits of feedback I've had in the past. If anyone wants to make a feature request, now's the time. 3. There has been talk of meetings in the past. These do not come about because the membership of DCPM is very small. Recruitment is, therefore, required. I large number of people who use Perl on a regualr basis are currently being relocated to Exeter with the move of the Met Office. I have instructed Mrs B. to casually mention the existance of DCPM to colleagues who look like they might be interested. Further suggestions welcome. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/imepy5o0lRFL2ooRAqm9AJ9sQe0mOl63U6NRpVVeLECSx5zZEgCgjkdZ 2r5tB9wZBFZ48YOom3BnfRo= =ssRb -----END PGP SIGNATURE----- From linux at codehelp.co.uk Mon Oct 13 15:54:04 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Problems with an unusual module Message-ID: <200310132154.05829.linux@codehelp.co.uk> I have a new-ish SourceForge project built around an ancient bibliography protocol called Z39.50 which caches ISBN data on books. http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://perl.z3950.org/ http://indexdata.dk/yaz/ http://lcweb.loc.gov/z3950/gateway.html My project aims include creating a distributed index of all ISBN titles as Z39.50 cannot tell me which server (from the gateway list) would hold which record. To do this, I've created the initial code and I'm working on the framework to link all these sites together. The code is on the sourceforge link, v0.2-2 is the latest and v0.3 will be the first with the framework in the next few weeks. Problem: Net::Z3950 requires the YAZ toolkit to be installed prior to using CPAN to obtain the perl module. The toolkit is the usual tarball with the usual ./configure make make install triage command set. The requirement for root to perform the make install is quite a hurdle for getting the project on enough servers and to cache all records, I am going to need quite a few servers! (>100,000 new ISBN's pa just in UK). I've just come back from Linux Expo and I was talking to one of the Perl mongers on the Debian stand about my problem and his comments can be summarised as: "There is no good reason for a toolkit required by Perl to be installed as root" The scripts I use in my package, have to set the port number at runtime (lowest port # 210) so they are not privileged ports. The protocol itself works over normal TCP/IP. He suggested I talk to some local Perl mongers about writing a HOWTO for the SourceForge package that allows anyone downloading the package to install Net::Z3950 and MARC::Record in a non-privileged directory (like public_html/cgi-bin/) AND upload a customised build YAZ toolkit into somewhere like /tools or whatever - just something above the public_html website directories but still accessible through normal user FTP - i.e. without having to bug the webhost sysadmin (as I had to). Provisos: On Debian, I had problems with YAZ and Net::Z3950 - http://isbnsearch.sourceforge.net/servers.html (On Debian 3.0 Woody stable, I had to install the debian package AND compile the source from the tarball before Net::Z3950 would install.) Doing either alone wasn't sufficient, doing both in either order was fine. Is anyone able to help with how this can be done? (In order to test the instructions, I'd also need a quick reminder of how to uninstall Perl modules, ta! The test box will be Debian 3 stable. If it works on that it should work on any Linux!) -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ 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/20031013/b44a5e32/attachment.bin From Simon at wretched.demon.co.uk Mon Oct 13 21:46:09 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Perl Mongers In-Reply-To: References: Message-ID: <3F8B6371.8040502@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matthew Browning wrote: > > 3. There has been talk of meetings in the past. These do not come > about because the membership of DCPM is very small. Recruitment is, > therefore, required. I large number of people who use Perl on a > regualr basis are currently being relocated to Exeter with the move of > the Met Office. I have instructed Mrs B. to casually mention the > existance of DCPM to colleagues who look like they might be interested. > Further suggestions welcome. Oh, I also know far too many people at the UK Met. Office, although when I worked there they were more likely to rewrite everything in Fortran 77 (despite the standard actually falling into some sad state of disrepair), rather than brave something new and strange like Perl. Fortunately things have changed somewhat since I joined, and I suspect people no longer eye you suspiciously if you code in something not invented by IBM. Bruce (copied) probably has a good feel for people who belong in the Devon and Cornwall Perl Monger list, I would kick Kirby, but he already thinks I'm strange having tried to recruit him to the Devon and Cornwall Linux User Group. I plead Perl still feels like line noise to me on occaison, but I am developing a pressing requirement to be able to write Perl for websites as part of my new job, so a meeting where I get to exchange beer for the opportunity to review Matthew's book collection is urgently needed ;) Thursday or Friday is good for me, perhaps me and Matthew agree a place and time offlist and present the list with fait accompli? Simon PS: Megabyte are having a closing down sale, everything half price. PPS: If you never found Megabyte after they moved from Paris street, and presumably many didn't else why are they shutting, they are now next to the "Love Shack" sex shop, which is somewhere behind Titan (the computer shop Shabir runs on Sidwell street). Think turning by Motorman/Kwik Fit. -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/i2NuGFXfHI9FVgYRArwxAJ9DabB7qZwLv8fJvrZGiHMblmewIgCgq9V+ s0wSA7pv6lCunJmp4Oq0HPc= =2zbi -----END PGP SIGNATURE----- From mb at matthewb.org Tue Oct 14 01:45:29 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Perl Mongers In-Reply-To: <3F8B6371.8040502@wretched.demon.co.uk> References: <3F8B6371.8040502@wretched.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 14 October 2003 03:46, Simon Waters wrote: > Oh, I also know far too many people at the UK Met. Office, although > when I worked there they were more likely to rewrite everything in > Fortran 77 (despite the standard actually falling into some sad state > of disrepair), rather than brave something new and strange like Perl. > Fortunately things have changed somewhat since I joined, and I > suspect people no longer eye you suspiciously if you code in > something not invented by IBM. > True story: I went out on a social last year with a bunch of staff including Mrs B's current line manager. There were non-tech people as well as aging Fortranners. To the question `what is Perl?' he replied, with a smile, `Its what you almost always need'. > I plead Perl still feels like line noise to me on occaison, but I am > developing a pressing requirement to be able to write Perl for > websites as part of my new job... > Depending on what you are doing, there is something of a buzz going on right now about CGI::Application. I gave it a go for the project I'm doing right now and I'm impressed. The code itself is really simple but it generalises the `screens' of your CGI app into methods, making everything seem nice and tidy. > Thursday or Friday is good for me... > I'm fine with that also. Despite wanting the location to be as close as possible to my own front door I reckon there is logic on making Exeter the general rule. There are some okay pubs and it is accessible whatever your form of transport. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/i5uPy5o0lRFL2ooRAp8WAKCCUHE/p36UNjwMzBSs57+WrEu4ZACfWC4V YqNgygEEd8t0HiJk1nk0k4k= =WLLg -----END PGP SIGNATURE----- From steve at devon-it.co.uk Tue Oct 14 03:07:55 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Perl Mongers In-Reply-To: <3F8B6371.8040502@wretched.demon.co.uk> References: <3F8B6371.8040502@wretched.demon.co.uk> Message-ID: <20031014080755.GA16997@flumpet.demon.co.uk> Simon Waters wrote: > I plead Perl still feels like line noise to me on occaison, but I am > developing a pressing requirement to be able to write Perl for websites > as part of my new job, so a meeting where I get to exchange beer for the > opportunity to review Matthew's book collection is urgently needed ;) I've got a few too :) > Thursday or Friday is good for me, perhaps me and Matthew agree a place > and time offlist and present the list with fait accompli? If you could make it at least a little way towards North Devon, that would be excellent. > PS: Megabyte are having a closing down sale, everything half price. Where are they? Cheers Steve From mb at matthewb.org Tue Oct 14 03:29:35 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Problems with an unusual module In-Reply-To: <200310132154.05829.linux@codehelp.co.uk> References: <200310132154.05829.linux@codehelp.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 October 2003 21:54, Neil Williams wrote: > Problem: > Net::Z3950 requires the YAZ toolkit to be installed prior to using > CPAN to obtain the perl module. The toolkit is the usual tarball with > the usual ./configure make make install triage command set. The > requirement for root to perform the make install is quite a hurdle > for getting the project on enough servers and to cache all records, I > am going to need quite a few servers! (>100,000 new ISBN's pa just in > UK). > I wrote quite a nice answer to this and then my kmail decided to die on me and all was lost. Here's a quick summary: - - YAZ toolkit is apt-gettable. - - The Makefile.PL for Net::Z3950 collates some data by means of backticking to a utility called `yaz-config'. Clearly, this has to be in PATH for the makefile to get generated. Not tried to install it but I would imagine you could get some reaults by manual tinkering. Installing modules to non-standard directory: $ perl Makefile.PL PREFIX=/desired/location $ make $ make test $ make install More: http://perlmonks.org/index.pl?node_id=78457 Uninstalling modules: - - No way to do this with the CPAN shell. - - Consult the .packlist file and delete module components by hand - - Or you can `make uninstall' if you have the makefile still. > I've just come back from Linux Expo and I was talking to one of the > Perl mongers on the Debian stand about my problem and his comments > can be summarised as: > "There is no good reason for a toolkit required by Perl to be > installed as root" Disagree. Perl modules do not lend themselves to generalisation ;) > Is anyone able to help with how this can be done? > Others may disagree but I reckon in order to achieve what you describe you want to customise where the module looks for this YAZ package then get it working and make a tar of the whole thing. That's what I'd do anyway. HTH, MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/i7P1y5o0lRFL2ooRAiw5AJ9uj6NdgeewTIQhGIVCsj4O/PyuVQCeKnhb DifYPebhCB2qqGm82qoRpjQ= =QKpR -----END PGP SIGNATURE----- From linux at codehelp.co.uk Tue Oct 14 16:01:08 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: Problems with an unusual module In-Reply-To: References: <200310132154.05829.linux@codehelp.co.uk> Message-ID: <200310142201.13460.linux@codehelp.co.uk> On Tuesday 14 Oct 2003 9:29 am, Matthew Browning wrote: > On Monday 13 October 2003 21:54, Neil Williams wrote: > > Problem: > > Net::Z3950 requires the YAZ toolkit to be installed prior to using > > CPAN to obtain the perl module. The toolkit is the usual tarball with > > the usual ./configure make make install triage command set. The > > requirement for root to perform the make install is quite a hurdle > > for getting the project on enough servers and to cache all records, I > > am going to need quite a few servers! (>100,000 new ISBN's pa just in > > UK). > > I wrote quite a nice answer to this and then my kmail decided to die on > me and all was lost. Here's a quick summary: > > - YAZ toolkit is apt-gettable. When I tried that with Debian 3 woody (fresh install), the yaz debian package alone was not adequate for the Net::Z3950 module. I too spotted the yaz-config requirement but simply adjusting the PATH isn't sufficient. On my box, Debian didn't have yaz-config from installing the package - it was only generated from the tarball make. Copying a yaz-config from a second fresh Debian install didn't complete the make, Net::Z3950 still failed to install. Besides, using apt to get the Debian package doesn't help me install on webhosts that don't allow user access to apt - I suspect most wouldn't. > - The Makefile.PL for Net::Z3950 collates some data by means of > backticking to a utility called `yaz-config'. Clearly, this has to be > in PATH for the makefile to get generated. Not tried to install it but > I would imagine you could get some reaults by manual tinkering. > > Uninstalling modules: > > - No way to do this with the CPAN shell. > - Consult the .packlist file and delete module components by hand > - Or you can `make uninstall' if you have the makefile still. Thanks for the info, I'll do this over the weekend. Manually delete the package on one Debian box, rebuild it with custom settings. > > I've just come back from Linux Expo and I was talking to one of the > > Perl mongers on the Debian stand about my problem and his comments > > can be summarised as: > > "There is no good reason for a toolkit required by Perl to be > > installed as root" > > Disagree. Perl modules do not lend themselves to generalisation ;) :-( > Others may disagree but I reckon in order to achieve what you describe > you want to customise where the module looks for this YAZ package then > get it working and make a tar of the whole thing. That's what I'd do > anyway. What about problems moving that tar from one server to another? I want to make it easier for users to install on any server. If I use a prefix for the Perl build, can it be relative? There's no way I can use an absolute file location as I want to be able to install in directories dictated by, as yet unknown, webhosts. I'd feel happier just putting out the instructions for what to change and how. I will experiment with the prefix - if it works I can put it as a separate download. -- 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/20031014/ea19eeb6/attachment.bin From Simon at wretched.demon.co.uk Thu Oct 16 14:41:16 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: CGI and Database sanitising Message-ID: <3F8EF45C.2070108@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 quote seems a bit weak for SQL sanitising. Having looked around for "SQL injection" preventation, the Internet is fill of how not to do things, but very little on the right way to do things. What ways do people use to sanitize data from tainted CGI data, for use in database input, or do you al studiously avoid creating SQL and only use place holders and other such techniques? Urm when are we meeting, someone name a day and a pub quickly? -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/jvRbGFXfHI9FVgYRAhVBAKCO49pA1IDER/0MGifmx3dHxEghUwCgzGdb 9qz2nKFkbAy18fNZ3/Wv810= =tyAU -----END PGP SIGNATURE----- From mb at matthewb.org Thu Oct 16 18:54:04 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: CGI and Database sanitising In-Reply-To: <3F8EF45C.2070108@wretched.demon.co.uk> References: <3F8EF45C.2070108@wretched.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 16 October 2003 20:41, Simon Waters wrote: > What ways do people use to sanitize data from tainted CGI data, for > use in database input, or do you al studiously avoid creating SQL and > only use place holders and other such techniques? > That's right. Use of placeholders protects you from this kind of thing. We are also religiously checking untrusted user input with regexes. There is also this CGI::Untaint module: http://search.cpan.org/~tmtm/CGI-Untaint-1.00/lib/CGI/Untaint.pm ...and finally, I'm not giving apache|www|nobody (whatever you call him) rights he doesn't need. > Urm when are we meeting, someone name a day and a pub quickly? Thursday 30 October, in the evening, Exeter, pub TBC. (Prefer Friday but suspect town will be crawling with students being spooky). Last Thursday of the month henceforth. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/jy+ky5o0lRFL2ooRAj+tAJ4+lvAUwk3v/68c9I+ENsuQCHIxhwCfTXEp EXY9hoyNLuZaOjYO06/iw6Q= =zkDQ -----END PGP SIGNATURE----- From Simon at wretched.demon.co.uk Fri Oct 17 12:47:08 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: CGI and Database sanitising In-Reply-To: References: <3F8EF45C.2070108@wretched.demon.co.uk> Message-ID: <3F902B1C.1080009@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matthew Browning wrote: > On Thursday 16 October 2003 20:41, Simon Waters wrote: > >>What ways do people use to sanitize data from tainted CGI data > Use of placeholders protects you from this kind of thing. We are also > religiously checking untrusted user input with regexes. There is also > this CGI::Untaint module: > > http://search.cpan.org/~tmtm/CGI-Untaint-1.00/lib/CGI/Untaint.pm Ta muchly, I can see my second perl CGI will be a lot more secure than my first :( >>Urm when are we meeting, someone name a day and a pub quickly? > > Thursday 30 October, in the evening, Exeter, pub TBC. The Great Western or whatever the big white place is on the roundabout by the exit of St Davids station is a good choice if anyone comes by train. Parking there or on St Davids hill is usually easy. The drink isn't cheap, but you can talk, and read if needs be, even use a laptop if you are desparate ;) > Last Thursday of the month henceforth. Cool, although I have a nagging suspicion I agree to another regular meeting thursdays, at the Great Western, if we have the same venue maybe I can make both if they ever clash ;) -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/kCsaGFXfHI9FVgYRAmq3AJ92BDOEscfML+mPjFeyj7tKzh9FDgCghBGz dWjdOP6yGkKjw6IUxK+kW1g= =dvXs -----END PGP SIGNATURE----- From mb at matthewb.org Sat Oct 18 01:04:07 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: CGI and Database sanitising In-Reply-To: <3F902B1C.1080009@wretched.demon.co.uk> References: <3F8EF45C.2070108@wretched.demon.co.uk> <3F902B1C.1080009@wretched.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 17 October 2003 18:47, Simon Waters wrote: > The Great Western or whatever the big white place is on the > roundabout by the exit of St Davids station is a good choice if > anyone comes by train. Parking there or on St Davids hill is usually > easy. > > The drink isn't cheap, but you can talk, and read if needs be, even > use a laptop if you are desparate ;) > > > Last Thursday of the month henceforth. > > Cool, although I have a nagging suspicion I agree to another regular > meeting thursdays, at the Great Western, if we have the same venue > maybe I can make both if they ever clash ;) Looks like we have a time and date then; all welcome. Questions and asking for lifts etc to the list. MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/kNfjy5o0lRFL2ooRAhNHAJ46w3J0FjARzx0ofXg/xsKWNXP9mwCbBxGo NZtEPr9gS22HO0BvV3SA9x0= =Y3ae -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Oct 20 03:31:34 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: meeting Message-ID: <20031020083134.GA8734@flumpet.demon.co.uk> Back from Demon mailing hell, I've had all sorts in all osrts of orders. Did some fine fellows arrange a meeting? If so, can you tell me where it is? Cheers Steve From mb at matthewb.org Mon Oct 20 03:39:27 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:49 2004 Subject: DCPM: meeting In-Reply-To: <20031020083134.GA8734@flumpet.demon.co.uk> References: <20031020083134.GA8734@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 20 October 2003 09:31, Steve Marvell wrote: > Back from Demon mailing hell, I've had all sorts in all osrts of > orders. Did some fine fellows arrange a meeting? > > If so, can you tell me where it is? > Thursday 30 October. Great Western, by St. Davids, Exeter. No time suggested, so I suggest 8pm. MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/k58/y5o0lRFL2ooRAn4UAJ9ln+23WEUF4RmaLelPD75kInBWEACeOtzj XNZCiARt+UYlqRMny3jxhSA= =hkpk -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Oct 20 04:30:39 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting In-Reply-To: References: <20031020083134.GA8734@flumpet.demon.co.uk> Message-ID: <20031020093039.GA9361@flumpet.demon.co.uk> Matthew Browning wrote: > Thursday 30 October. Great Western, by St. Davids, Exeter. No time > suggested, so I suggest 8pm. So, the suggestion of making it a bit closer to North Devon fell on deaf ears? So where's this pub then, given that I'd just driven in from the University end? Cheers Steve From steve at devon-it.co.uk Mon Oct 20 11:42:04 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: just a test Message-ID: <20031020164204.GA10661@flumpet.demon.co.uk> to see what's going on Steve From mb at matthewb.org Mon Oct 20 11:40:32 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: just a test In-Reply-To: <20031020164204.GA10661@flumpet.demon.co.uk> References: <20031020164204.GA10661@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 20 October 2003 17:42, Steve Marvell wrote: > to see what's going on > *** OT CONTENT SENT TO LIST ANYWAY *** Hi Steve. Sorry to post this on the list but there seems to be a problem with your email address right now. I have sent details to your old fysh.org address on the assumption that you still use it. By all means give me a shout if you don't have that. MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/lBAAy5o0lRFL2ooRArfUAKDsRW64Bfic8qRa6Mh9k5odBEUJ5QCgy9SE cEXUNexH5wpwbenKHzc0PWs= =nDyT -----END PGP SIGNATURE----- From steve at devon-it.co.uk Mon Oct 20 14:01:13 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: just a test In-Reply-To: References: <20031020164204.GA10661@flumpet.demon.co.uk> Message-ID: <20031020190113.GA10915@flumpet.demon.co.uk> Matthew Browning wrote: > Hi Steve. Sorry to post this on the list but there seems to be a > problem with your email address right now. Now tell them the truth! Steve From Simon at wretched.demon.co.uk Mon Oct 20 16:20:16 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting In-Reply-To: <20031020093039.GA9361@flumpet.demon.co.uk> References: <20031020083134.GA8734@flumpet.demon.co.uk> <20031020093039.GA9361@flumpet.demon.co.uk> Message-ID: <3F945190.407@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve Marvell wrote: > Matthew Browning wrote: > > >>Thursday 30 October. Great Western, by St. Davids, Exeter. No time >>suggested, so I suggest 8pm. > > > So, the suggestion of making it a bit closer to North Devon fell on > deaf ears? Pardon ;) > So where's this pub then, given that I'd just driven in from the > University end? Okay, assuming you mean the Crediton road, you want the right fork opposite the University, but I'm not sure you are allowed to turn right there (?!). Otherwise turn right into the one way street by the Imperial hotel, and right at the end of the one way street, down St Davids hill, and the hotel is at the bottom. It is the Great Western Hotel, not a pub, and you can't miss it if you get to St David's railway station and look around the carpark till you find two small roundabouts.... Simon -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/lFGOGFXfHI9FVgYRAnAfAKCmywuR6XmOiLW87cAS6x8drB+G2gCfWXpt vcqF8uKujwfwmdSfypWukIU= =6fyK -----END PGP SIGNATURE----- From mb at matthewb.org Tue Oct 21 00:56:25 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: just a test In-Reply-To: <20031020190113.GA10915@flumpet.demon.co.uk> References: <20031020164204.GA10661@flumpet.demon.co.uk> <20031020190113.GA10915@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 20 October 2003 20:01, Steve Marvell wrote: > Matthew Browning wrote: > > Hi Steve. Sorry to post this on the list but there seems to be a > > problem with your email address right now. > > Now tell them the truth! > It was my fault. Aaaarrgh! - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/lMqQy5o0lRFL2ooRAsH0AJ0cCXS7rii+hENMGFrJU64uKPRw1QCfbbz5 9tASR0MKB4OG/ioXvXqJ04Y= =mt9B -----END PGP SIGNATURE----- From steve at devon-it.co.uk Tue Oct 21 10:04:58 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting and members Message-ID: <20031021150458.GA2770@flumpet.demon.co.uk> Anyone need a lift from: Hartland Bideford Barnstaple anywhere on the road to Crediton to Exeter? Since that's the route I'll be taking. Confirm the Great Western, Exeter at 8pm (next) Thursday 30th October? Nice to see new subscribers. It's clear someone is talking in the Met Office. Has anyone attacked the University? Steve From mb at matthewb.org Tue Oct 21 10:20:25 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting and members In-Reply-To: <20031021150458.GA2770@flumpet.demon.co.uk> References: <20031021150458.GA2770@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 21 October 2003 16:04, Steve Marvell wrote: > Anyone need a lift from: > > Hartland > Bideford > Barnstaple > anywhere on the road to Crediton > to Exeter? > > Since that's the route I'll be taking. > > Confirm the Great Western, Exeter at 8pm (next) Thursday 30th > October? > > Nice to see new subscribers. It's clear someone is talking in the Met > Office. That was me [:-)] > Has anyone attacked the University? > I have the contacts to ``do'' Plymouth but I have no links whatsoever with Exeter. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/lU65y5o0lRFL2ooRAhD8AJ0eNdNNb0b0ckSpK5adlpf/xrVNYgCfdscM BJk8/dKw/qKCYJPMckSA/cE= =N2kZ -----END PGP SIGNATURE----- From steve at devon-it.co.uk Tue Oct 21 10:47:47 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting and members In-Reply-To: References: <20031021150458.GA2770@flumpet.demon.co.uk> Message-ID: <20031021154747.GA3031@flumpet.demon.co.uk> Matthew Browning wrote: > I have the contacts to ``do'' Plymouth but I have no links whatsoever > with Exeter. I'll try mine then. Steve From Simon at wretched.demon.co.uk Tue Oct 21 14:18:13 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting and members In-Reply-To: <20031021154747.GA3031@flumpet.demon.co.uk> References: <20031021150458.GA2770@flumpet.demon.co.uk> <20031021154747.GA3031@flumpet.demon.co.uk> Message-ID: <3F958675.8040509@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve Marvell wrote: > Matthew Browning wrote: > > >>I have the contacts to ``do'' Plymouth but I have no links whatsoever >>with Exeter. > > > I'll try mine then. Alasdair is a Perl fanatic at Exeter Uni. (bcc'ed) He gave the talk on Perl for the free software meet, a LONG time ago now it seems, the talk was very well received..... http://www.astro.ex.ac.uk/people/aa/home.html Although I'm not sure we'll drag him down to the Great Western for a Perl meeting on the 30th 8pm, now if we all pretend it is a specialist meeting on Solar sails I bet he'd make it. Whether he can be persuaded to recruit perlmongers for Devon and Cornwall I've no idea. Then again maybe he can explain why the Europeans are launching spaceships to the moon that'll take months to get there... -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/lYZzGFXfHI9FVgYRAmUtAJ9t0bMGm3Hwxdnxz6Ba1S5c+HCsZwCgvU0n /ZP2zQfXiGyuwvtYLO1WIUE= =uM5a -----END PGP SIGNATURE----- From mb at matthewb.org Wed Oct 29 11:27:18 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: DCPM meeting reminder Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Well, it looks like it's really happening... To anyone new to the list who missed the discussion on the matter there will be a meeting of the Mongers tomorrow (Thursday) night in Exeter at about 8pm. Venue is the `Great Western Hotel', which is by St. David's station. When I look at it, I have been there before and there *is* a cracking range of `proper' beers. Relevant info here: http://www.greatwesternhotel.com/innsite/locobar.htm Here it is on Multimap if you seriously can't place it based on the above description: http://www.multimap.com/map/browse.cgi?pc=ex44nu Members who have not personally met anyone else on the list and want someone to look out for may be advised that I will be the bloke in glasses and a white shirt. Hope that helps. Although cutting it a bit fine, it's probably not too late to ask for a lift if you desperately want to come but are stuck miles from anywhere with no transport. Please be mindful of the dangers inherent with drinking and driving. Jusqu'au demain, moines. MB. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/n/h2y5o0lRFL2ooRAidBAJ0V29GlJom1d1uz0blZIMKA0njXIACdFsy0 h/TR0hdkjuWKpZ418HeXzmQ= =O8EA -----END PGP SIGNATURE----- From mb at matthewb.org Wed Oct 29 11:53:32 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: CGI and Database sanitising In-Reply-To: <3F902B1C.1080009@wretched.demon.co.uk> References: <3F8EF45C.2070108@wretched.demon.co.uk> <3F902B1C.1080009@wretched.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 17 October 2003 18:47, Simon Waters wrote: > Matthew Browning wrote: > > On Thursday 16 October 2003 20:41, Simon Waters wrote: > >>What ways do people use to sanitize data from tainted CGI data > > > > Use of placeholders protects you from this kind of thing. We are > > also religiously checking untrusted user input with regexes. There > > is also this CGI::Untaint module: > > > > http://search.cpan.org/~tmtm/CGI-Untaint-1.00/lib/CGI/Untaint.pm > Nothing mind-blowing but Simon Cozens has recently written an article for perl.com which touches on the subject of placeholders and best practice with DBI/DBD: http://www.perl.com/lpt/a/2003/10/23/databases.html Received wisdom is that there's really only one way to do it ;) MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/n/6cy5o0lRFL2ooRAiMYAKDTvz1k/qZCyFg7+uAZQ2jmQKhYNQCfYR/U X9wavJD5WLKMaA7VqcAYyj8= =NQ7l -----END PGP SIGNATURE----- From steve at devon-it.co.uk Thu Oct 30 07:05:19 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: DCPM meeting reminder In-Reply-To: References: Message-ID: <20031030130519.GB4620@flumpet.demon.co.uk> Matthew Browning wrote: > Members who have not personally met anyone else on the list and want > someone to look out for may be advised that I will be the bloke in > glasses and a white shirt. Hope that helps. I'll be the tall bloke with the pony tail, almost certainly in dark colours and late. Steve From steve at devon-it.co.uk Thu Oct 30 11:01:40 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: rain rain go away Message-ID: <20031030170140.GA5726@flumpet.demon.co.uk> I'm coming to Exeter from North Devon tonight, is there any path I should be on the lookout for excessive water on the roads? Cheers Steve From steve at devon-it.co.uk Fri Oct 31 04:54:43 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: body bags Message-ID: <20031031105443.GA8476@flumpet.demon.co.uk> 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. I suppose evaling your call and checking $@ might be a good way of handling this situation too. There's a bit more in perlvar. Steve From steve at devon-it.co.uk Fri Oct 31 05:13:35 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting Message-ID: <20031031111335.GA8571@flumpet.demon.co.uk> Howdy Thanks to the four of us for turning up, it was nice to put faces to names. The venue was good; easy to find especially. We chatted about stuff, some of which was related to perl :) It was muted that a monthly meeting seemed like a good plan, the venue for which would move around. We need more bodies on board, for sure, so let's try and convince a few people to get on here. Also, let's talk our way through more problems, ask for some advice of eachother and put up some useful code here and there, like that split thing I just did. We talked about it in the meeting, and there it is. There was no need though, it was useful enough to put up there without the metting. My bad. Anyway, see some more of you next month then. Steve From steve at devon-it.co.uk Fri Oct 31 05:32:56 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: splitting on lookaheads Message-ID: <20031031113256.GA8630@flumpet.demon.co.uk> This is very useful if you don't have a record separator, but instead, you have concatenated records with a known start block which you need to keep. (I've put in a space before the sub so it doesn't bounce) #!/usr/bin/perl sub border; { local $/; $string = } print border('=',$string); @records = split (/(?=^fred)/m, $string); print map { border('-',$_) } @records; exit; sub border { my ($mark,$string) = @_; $mark x 10,"\n",$string,$mark x 10,"\n"; } __DATA__ fred 1 dsa dsa fred 2 sdaf dsa fsda dsa From mb at matthewb.org Fri Oct 31 05:52:35 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting In-Reply-To: <20031031111335.GA8571@flumpet.demon.co.uk> References: <20031031111335.GA8571@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 31 October 2003 11:13, Steve Marvell wrote: > We chatted about stuff, some of which was related to perl :) > > We need more bodies on board, for sure, so let's try and convince a > few people to get on here. > I've chatted about it and can definitely bring along two others next time. If everyone could manage that we're talking multiple tables! > Also, let's talk our way through more problems, ask for some advice > of each other and put up some useful code here and there, like that > split thing I just did. Split thing? Agree with your POV though ...here's a question then that is sort of on-topic because Simon has been expressing an interest in CGI: where's the silver-bullet framework for Perl-CGI? I've been banging on at this for years now and I don't think it's possible to get any more `professional' than my current toolbox: mod_perl (unless it's a cheapo hosting deal) Handler inheriting from CGI::Application CGI::Session or Apache::Session (can't decide) TT2 for *total* separation of style and content `leet web authoring skillz' Other modules I like the look of. Now, we hear a lot about what is wrong with a load of existing solutions but I don't believe people are actually writing everything by hand so what are we using? What do you get told to use if you are just starting out? > Anyway, see some more of you next month then. > Hopefully next time I won't miss the train by five seconds and have to give a taxi driver who looked like he'd had more beer than me thirty five quid to work out the longest possible route to my house [:-(] MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/ok0Dy5o0lRFL2ooRAmduAJ4nRxX2gpSx1Q5PVFq3B8giGq4rYgCg0aou jm98gOqFmmJzP7V5XO6MoCE= =S4TS -----END PGP SIGNATURE----- From mb at matthewb.org Fri Oct 31 06:06:30 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: splitting on lookaheads In-Reply-To: <20031031113256.GA8630@flumpet.demon.co.uk> References: <20031031113256.GA8630@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 31 October 2003 11:32, Steve Marvell wrote: > This is very useful if you don't have a record separator, but > instead, you have concatenated records with a known start block which > you need to keep. > Okay. I've seen the split thing now ;) That's cool. I've used this technique on files of numeric data where all I knew was that sections were separated by *something* composed of word chars. It might bear a bit of explanation regarding what the input record separator is and the effect of localising it and WTF a lookahead assertion is because, AFAIK and please correct me if I'm wrong, that's a feature unique to perl. Haters of line-noise may like to look into the English module (which I think is standard). It allows you to relace things like $/ with $INPUT_RECORD_SEPARATOR which at least gives a novice a fighting chance of interpreting it. MB - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/olBGy5o0lRFL2ooRAooZAKCDymj+uy8x+qYYfCjkRDmnaZDKbACeO1hM E3eap3APkKUuZMpfDLE8V3Q= =qEYG -----END PGP SIGNATURE----- From steve at devon-it.co.uk Fri Oct 31 07:37:34 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: splitting on lookaheads - verbose Message-ID: <20031031133734.GA8949@flumpet.demon.co.uk> > sub border; Pre-declare the subroutine so it doesn't clog the top of my code. > { local $/; $string = } I use a block here to make sure that the $/ variable only retains it's new value for the duration of the read. If I tried to do this in the main scope, I would have to remember the old value of $/, then set it, read and set it back. Since that's what local does, that's why I chose a block. This is one of the "Seven Useful Uses of Local", a Perl Journal article which can be found at: http://perl.plover.com/local.html The $/ variable is the "input record separator", which effectively means "that which the input is split on". By default this is newline, and hence we get lines from files when we use it in its default state. Setting $/ to undef, which is the effect of decalring it without value, makes whole contents of the file come in at once, since there is no record separator, the first record is the whole file. You'll find another special case (paragraph splitting) in perlvar. DATA is a special file handle which, as you can probably see, read from that which follows __DATA__. This allowed me to embed my data in the example. How very BASIC. > print border('=',$string); Pretty print. > @records = split (/(?=^fred)/m, $string); Here, I want to split the string up, however, I don't want to retain the thing which starts my record (fred). If I'd used: split (/fred/, $string); I'd have got: ---------- ---------- ---------- 1 dsa dsa ---------- ---------- 2 sdaf dsa fsda dsa ---------- Here, not only do I lose 'fred' but I also get an empty record at the beginning, since in this context, it's a separator, ie. the thing that strictly goes between records. So, I use a "zero-width positive look-ahead assertion". That is to say that the regex engine looks for it, but doesn't include it in the match. This is why it's retained. So, why don't I get an empty record at the beginning still? Well, that only happens when the match is of positive width. See perldoc -f split OK, so, why the ^ ? Well, clearly, if my data was: __DATA__ fred 1 dsa dsa fred 2 sdaf dsa fred fsda dsa I'd get from: split (/(?=fred)/, $string); ---------- fred 1 dsa dsa ---------- ---------- fred 2 sdaf dsa ---------- ---------- fred fsda dsa ---------- This is clearly not what I want, so I need to match fred at the beginning of the line. However, split (/(?=^fred)/, $string); gives: ---------- fred 1 dsa dsa fred 2 sdaf dsa fred fsda dsa ---------- So, the final /m gives me the "multi-line match" I need. This gives me a "beginning of line" at the beginning of every line, not just the begeinning of the string. > print map { border('-',$_) } @records; Pretty print again. > exit; Habit. > sub border { > > my ($mark,$string) = @_; > > $mark x 10,"\n",$string,$mark x 10,"\n"; > } Though simple, this look cack in the code and hence the sub. > __DATA__ > fred 1 > dsa > dsa > fred 2 > sdaf > dsa fred > fsda > dsa The data, ammended with extra fred. Questions are, of course, always welcome. Steve PS AFAIK zero-width stuff is a Perl extension to regular expressions, though it may have been stolen by other languages. From mb at matthewb.org Fri Oct 31 08:52:04 2003 From: mb at matthewb.org (Matthew Browning) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: splitting on lookaheads - verbose In-Reply-To: <20031031133734.GA8949@flumpet.demon.co.uk> References: <20031031133734.GA8949@flumpet.demon.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 31 October 2003 13:37, Steve Marvell wrote: > [verbose stuff] ...that's fairly verbose! One niggle: > > sub border; > > Pre-declare the subroutine so it doesn't clog the top of my code. > This is now unnecessary if you are invoking your subroutine with parentheses. > Questions are, of course, always welcome. > > PS AFAIK zero-width stuff is a Perl extension to regular expressions, > though it may have been stolen by other languages. I've flicked through a couple of books and it would appear that Python has comparable features. - -- http://matthewb.org/public_key.txt -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/oncUy5o0lRFL2ooRAoV5AJ4pscwvE83ZCZRiNSLi0FK02SP6PQCgwEbA Br9z4eak9nbJ1axA/v4h3jA= =4mRz -----END PGP SIGNATURE----- From steve at devon-it.co.uk Fri Oct 31 09:53:57 2003 From: steve at devon-it.co.uk (Steve Marvell) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: splitting on lookaheads - verbose In-Reply-To: References: <20031031133734.GA8949@flumpet.demon.co.uk> Message-ID: <20031031155356.GA9411@flumpet.demon.co.uk> Matthew Browning wrote: > > > sub border; > > > > Pre-declare the subroutine so it doesn't clog the top of my code. > > > > This is now unnecessary if you are invoking your subroutine with > parentheses. Good habit to get into if you don't, or might change your calling method half way through. Also lets any code reader know that the functions are defined in this file. Steve From Simon at wretched.demon.co.uk Fri Oct 31 15:07:27 2003 From: Simon at wretched.demon.co.uk (Simon Waters) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: meeting In-Reply-To: References: <20031031111335.GA8571@flumpet.demon.co.uk> Message-ID: <3FA2CF0F.1070702@wretched.demon.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matthew Browning wrote: > > ...here's a question then that is sort of on-topic because Simon has > been expressing an interest in CGI: where's the silver-bullet > framework for Perl-CGI? I've been banging on at this for years now > and I don't think it's possible to get any more `professional' than > my current toolbox: ;) > mod_perl (unless it's a cheapo hosting deal) Damn, I'm helping build a cheapo hosting deal ;) It is more a case of building a managable, and thus cost effective, hosting offering. We'll no doubt add features as users request them, and we can work out how to do it without letting people hog or abuse the server. Mod_perl documentation has a long discussion on ISP mod_perl offerings - I came away with the impression that user space Linux is probably the best way of offering it securely, so if and when we are offering that we'll be doing it on a.n.other set of servers - sorry. > Handler inheriting from CGI::Application CGI::Session or > Apache::Session (can't decide) TT2 for *total* separation of style > and content TT2? ah the templates you mentioned.... http://www.template-toolkit.org/ > What do you get told to use if you are just starting out? Ah one I can answer... I surfed a little... basically the various HOW-TO's all seem to say much the same thing about CGI's. PHP is great for small projects, but when it gets big people prefer PERL (presumably because they can better hide/abstract/reuse, and effectively build a toolkit for that project). CGI::Application and Mason get a mention, but no one seems THAT enthusiastic about them, although that may be because the more "infrastructure" you throw into the pot, the more people who are excluded from using it, the amount you need to know and understand to stand on the top of the pile, and discover it is only 10 lines and a stye sheet to buid the perfect website.... I know the Netscape authoring stuff ended up this way, if you chucked enough Netscape software in the pot, you could build excellent webpages in a few lines of XML, but you need a budget of 200,000 to buy the hardware, software and system admin to put it all together, and of course someone who can write the CORRECT 7 lines of XML. So yes at the moment I'm hand coding large chunks, reusing what has gone before me, in not as strucured a way as I would like. There were some crazy 4GL languages around a few years back. One was called Magic, and it was used by a winning team in a couple of programming "races". But the ideas behind it and powerbuilder haunt me whenever I revisit the typical "form" like programming world that is most of business programming. Basically the boring 80% is search, read, modify and store data, so a lot of what you code in such apps is routine framework and much of it can be implied from the database structure. If you have an order table, and an order item table (master-detail), you'll almost invariably want "order query", "add item", "modify order", "modify item", "delete order". So why no just build them automatically, with perhaps options to hint at what should and shouldn't be included. Plus use the database relationships to throw in some navigation.... Powerbuilder had an add-on for this kind of stuff (I forget the name), but it must be pretty old by now. This allowed you to define database (and program layout) structure graphically, and generate "framework code" (and DDL - data definition language - all those create table, create index etc). The bit that demo'ed well, not sure how well it worked in practice, was you could alter the database structure with a little SQL, click the reverse engineer button, and it would redo the graphical database design, and take your modifcations into account, allowing you to extend the design taking into account the bits of the 'real world' as they encroached. Whilst I can conceive of what I want, not sure I know how to write it yet. Simon -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQE/os8KGFXfHI9FVgYRAhH5AJd38jo7AdPaNyS2htukEgamw3SQAJ4sL6Fo rpuJ0zlpZBd/TbKii7XFAA== =D1/E -----END PGP SIGNATURE----- From linux at codehelp.co.uk Fri Oct 31 17:25:16 2003 From: linux at codehelp.co.uk (Neil Williams) Date: Thu Aug 5 00:28:50 2004 Subject: DCPM: body bags In-Reply-To: <20031031105443.GA8476@flumpet.demon.co.uk> References: <20031031105443.GA8476@flumpet.demon.co.uk> Message-ID: <200310312325.21142.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. > By using __WARN__ and __DIE__ I've caught nearly all the horrible errors that have been plagueing me. (Thanks!) 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. This snippet demonstrates some of the methods I've used to try to get the module to forget the current connection. (All attempts further into the script / closer to the connection itself have also failed). local $SIG{__DIE__} = sub{ @_ = ''; $conn = qw//; #$conn->close(); # my @cleanup = $mgr->connections(); # my $yy = @cleanup; # print STDERR qq/number of connections: $yy\n/; # foreach $conn (@cleanup) { # $conn->close(); # } # if(defined($conn)) { $conn->close(); } #$conn->delete(); #$mgr->delete(); # print STDERR qq/$conn\n/; print STDERR qq/Error connecting to $server ID:$count for ISBN: $inputisbn\n/; die("\n"); }; The final code would only use one of these, hopefully, the rest are there for easier debugging with comments etc. Line 310 is: die "$this can't forget $conn"; part of: sub forget { my $this = shift(); my($conn) = @_; my $connections = $this->{connections}; my $n = @$connections; $this->warnconns("forget()", "looking for $conn"); for (my $i = 0; $i < $n; $i++) { if (defined $connections->[$i] && $connections->[$i] eq $conn) { $this->warnconns("pre-splice", "forgetting $i of $n"); splice @{ $this->{connections} }, $i, 1; $this->warnconns("post-splice", "forgot $i of $n"); return; } } die "$this can't forget $conn"; } This happens with servers that ARE running but which refuse a connection. The full output from the existing (unwrapped) cron task is: Event: trapped error: [sauco.csic.es:9909] connection refused in Event::io=HASH(0x837e2fc) -- poll: 'w' fd: 'IO::Handle=GLOB(0x837e47c)' timeout: 0 timeout_cb: cb: 'CODE(0x82057a8)' cbtime: 1067637610.03063 desc: '?? Connection.pm:146' debug: '' prio: 4 reentrant: 1 repeat: 1 max_cb_tm: 1 (Hence why I want to wrap it!) If I try to close the connection at the point of error (later in the code), I get: Can't call method "close" on an undefined value (in cleanup) Net::Z3950::Manager=HASH(0x82ab24c) can't forget etc. This reflects a bit about what we were discussing about new() failures - how can I close a connection when the handler is undefined? To me, the answer SHOULD be: You shouldn't have to close it - if the handler is undefined, there isn't a connection! If a server refuses a connection, as in this case, why should a module require the refused connection to be closed? > I suppose evaling your call and checking $@ might be a good way of > handling this situation too. Using: $conn = eval( $mgr->connect($server, $port)); instead of : $conn = $mgr->connect($server, $port); generates the cleanup error EVERYTIME, even on successful queries. What's going on in cleanup and how can I pre-empt it? If I try to use $conn->close(), the sub doesn't output the final print STDERR statement, it goes straight to cleanup and the error. $! returns Connection refused - can I use that? -- 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/20031031/40ea5b76/attachment.bin