From scott at iwebsoftware.com Fri Jun 1 12:29:03 2001 From: scott at iwebsoftware.com (iWeb Technical Suport: Scott A. Hammond, Sr.) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers Message-ID: <01d601c0eac0$5af1cb70$0e05c740@prima> I've been hunting around for a good reference on sending multipart e-mail in perl (essentially I want to send text/plain and text/html in the same message) with particular emphasis on the headers and separators required to accomplish this. I've found plenty of references for one or the other and I can look at the souce on messages containing both all day, however, there is a multi-part separator included and I'm essentially looking for the specs/rules I have to live by in generating such a separator, etc. I've looked in CPAN, RFC's on mail standards, and searched just about all of the major perl sites I normally use. I've not turned up much to date. I would appreciate anyone who could offer pointers or links to references on the headers necessary to send multi-part messages. Thanks! ====================================== Scott Hammond, Director of Technical Support The Interactive Web (http://www.iwebsupport.com) >> Please direct any and all Tech Support Questions: to our newsgroups, as instructed on the support website (address above). Initial support requests sent via email will not be answered. << ====================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010601/f78020a3/attachment.htm From rowdenw at eskimo.com Fri Jun 1 11:42:56 2001 From: rowdenw at eskimo.com (William Rowden) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers In-Reply-To: <01d601c0eac0$5af1cb70$0e05c740@prima> Message-ID: Today, iWeb Technical Suport: Scott A. Hammond, Sr. wrote: > I've been hunting around for a good reference on sending > multipart e-mail in perl You may want to look on CPAN for MIME::Tools. Those modules were quite useful to me for a Perl script (called from procmail) to save attachments. > however, there is a multi-part separator included and I'm > essentially looking for the specs/rules I have to live by in > generating such a separator, etc. Doesn't RFC 1521 (or perhaps 1522) contain the specification? There may be guidelines in RFC 2049 as well. (Actually, RFCs 2045-2049 might be interesting reading.) -- -William PGP key: http://www.eskimo.com/~rowdenw/crypt/pgp/rowdenw.asc Fingerprint: 00C9 6887 F073 A261 CE06 EC88 7D75 13BD 1221 2BA9 How extravagant you are, throwing away women like that. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From bill at celestial.com Fri Jun 1 11:47:15 2001 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers In-Reply-To: <01d601c0eac0$5af1cb70$0e05c740@prima>; from scott@iwebsoftware.com on Fri, Jun 01, 2001 at 11:29:03AM -0600 References: <01d601c0eac0$5af1cb70$0e05c740@prima> Message-ID: <20010601094715.C25836@barryg.mi.celestial.com> I think you will find this information in the appropriate MIME modules from CPAN. On Fri, Jun 01, 2001 at 11:29:03AM -0600, iWeb Technical Suport: Scott A. Hammond, Sr. wrote: > > I've been hunting around for a good reference on > > sending multipart e-mail in perl (essentially I want to > > send text/plain and text/html in the same message) > > with particular emphasis on the headers and > > separators required to accomplish this. > > > > I've found plenty of references for one or the other and > > I can look at the souce on messages containing both > > all day, however, there is a multi-part separator > > included and I'm essentially looking for the specs/rules > > I have to live by in generating such a separator, etc. > > > > I've looked in CPAN, RFC's on mail standards, and > > searched just about all of the major perl sites I normally > > use. I've not turned up much to date. > > I would appreciate anyone who could offer pointers or > > links to references on the headers necessary to send > > multi-part messages. > > > > Thanks! > > > > ====================================== > Scott Hammond, Director of Technical Support > The Interactive Web ([1]http://www.iwebsupport.com) > > > > >> Please direct any and all Tech Support Questions: > to our newsgroups, as instructed on the support > website (address above). Initial support requests > sent via email will not be answered. << > ====================================== > >References > > 1. http://www.iwebsupport.com/ -- Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``We shouldn't elect a President; we should elect a magician.'' Will Rogers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From rowdenw at eskimo.com Fri Jun 1 12:00:42 2001 From: rowdenw at eskimo.com (William Rowden) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers In-Reply-To: Message-ID: Using MIME::Tools (i.e., MIME::Entity's build()) would obviate generating the boundary yourself. Nevertheless, the specification is below. Today, William Rowden wrote: > > however, there is a multi-part separator included > Doesn't RFC 1521 (or perhaps 1522) contain the specification? This is from RFC 1521 (section 7.2.1, "Multipart: the common syntax"): boundary := 0*69 bcharsnospace bchars := bcharsnospace / " " bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" /"_" / "," / "-" / "." / "/" / ":" / "=" / "?" -- -William PGP key: http://www.eskimo.com/~rowdenw/crypt/pgp/rowdenw.asc Fingerprint: 00C9 6887 F073 A261 CE06 EC88 7D75 13BD 1221 2BA9 Buongiorno, Principessa! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mathin at mathin.com Fri Jun 1 12:25:15 2001 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers In-Reply-To: <01d601c0eac0$5af1cb70$0e05c740@prima> Message-ID: I have had good luck using the MIME::Lite module. It is basic and may not give you all the control you want, but it isn't bad. Dan. ---------------------------------------------------------------- The shortest distance between two points is under construction. -- Noelie Alito ---------------------------------------------------------------- On Fri, 1 Jun 2001, iWeb Technical Suport: Scott A. Hammond, Sr. wrote: > I've been hunting around for a good reference on > sending multipart e-mail in perl (essentially I want to > send text/plain and text/html in the same message) > with particular emphasis on the headers and > separators required to accomplish this. > > I've found plenty of references for one or the other and > I can look at the souce on messages containing both > all day, however, there is a multi-part separator > included and I'm essentially looking for the specs/rules > I have to live by in generating such a separator, etc. > > I've looked in CPAN, RFC's on mail standards, and > searched just about all of the major perl sites I normally > use. I've not turned up much to date. > > I would appreciate anyone who could offer pointers or > links to references on the headers necessary to send > multi-part messages. > > Thanks! > > ====================================== > Scott Hammond, Director of Technical Support > The Interactive Web (http://www.iwebsupport.com) > > >> Please direct any and all Tech Support Questions: > to our newsgroups, as instructed on the support > website (address above). Initial support requests > sent via email will not be answered. << > ====================================== > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From aaron at activox.com Fri Jun 1 12:52:59 2001 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers Message-ID: <3.0.5.32.20010601105259.011c63e0@pop3.norton.antivirus> Two votes for MIME::Lite. Especially if it's important that your code be OS-neutral -- MIME::Lite doesn't require sendmail to do its thing so you can go to Uncle Bill and back without a hitch. Tastes great. Less filling. What's not to like? ~!a At 10:25 AM 6/1/01 -0700, you wrote: > >I have had good luck using the MIME::Lite module. It is basic and may not >give you all the control you want, but it isn't bad. > >Dan. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mcrip at cac.washington.edu Fri Jun 1 13:37:59 2001 From: mcrip at cac.washington.edu (Marvin Crippen) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Mail Headers In-Reply-To: <3.0.5.32.20010601105259.011c63e0@pop3.norton.antivirus> Message-ID: On Fri, 1 Jun 2001, Aaron Salo wrote: > Two votes for MIME::Lite. Especially if it's important that your code be > OS-neutral -- MIME::Lite doesn't require sendmail to do its thing so you > can go to Uncle Bill and back without a hitch. > > Tastes great. Less filling. What's not to like? Add another vote for MIME::Lite, I've used it on a few scripts (on a unix box) without any problems. -- Marvin Crippen mcrip@cac.washington.edu DO-IT Program http://www.washington.edu/doit/ (206) 221-4166 It is by caffeine alone I set my mind in motion, It is by the beans of Java the thoughts acquire speed, The hands acquire shaking, the shaking become a warning. It is by caffeine alone I set my mind in motion. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From john.brittingham at attws.com Tue Jun 5 18:47:26 2001 From: john.brittingham at attws.com (Brittingham, John) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Problems with a regex Message-ID: <23F6FCBAA611D511A74A00508BCFBE401279D3@WA-MSG06> Having trouble replacing the following string: Any help would be appreciated. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Tue Jun 5 19:14:46 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Problems with a regex In-Reply-To: <23F6FCBAA611D511A74A00508BCFBE401279D3@WA-MSG06>; from Brittingham, John on Tue, Jun 05, 2001 at 04:47:26PM -0700 References: <23F6FCBAA611D511A74A00508BCFBE401279D3@WA-MSG06> Message-ID: <20010605171446.A10067@timji.consultix.wa.com> On Tue, Jun 05, 2001 at 04:47:26PM -0700, Brittingham, John wrote: > > Having trouble replacing the following string: "-//ATT//dtd ccml3//EN" []> > Any help would be appreciated. > Looks like a good place to use an alternate delimiter (like |) and the quoting metacharacters, \Q\E, to automatically backslash all the appropriate stuff: s|\Q "-//ATT//dtd ccml3//EN" []>\E|WHATEVER|; *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From myocom at microsoft.com Tue Jun 5 19:23:39 2001 From: myocom at microsoft.com (Mark Yocom) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Problems with a regex Message-ID: ...though I would generally recommend against using regexen to parse (X?HT|X)ML documents. It's very difficult (and indeed, sometimes impossible) to get right. HTML::Parser and/or the various XML modules may be better suited for this sort of work. > -----Original Message----- > From: Tim Maher/CONSULTIX [mailto:tim@consultix-inc.com] > Sent: Tuesday, June 05, 2001 5:15 PM > To: Brittingham, John > Cc: spug-list@pm.org > Subject: Re: SPUG: Problems with a regex > > > On Tue, Jun 05, 2001 at 04:47:26PM -0700, Brittingham, John wrote: > > > > Having trouble replacing the following string: > "-//ATT//dtd ccml3//EN" []> > > Any help would be appreciated. > > > > > Looks like a good place to use an alternate delimiter (like |) > and the quoting metacharacters, \Q\E, to automatically > backslash all the appropriate stuff: > > s|\Q "-//ATT//dtd ccml3//EN" []>\E|WHATEVER|; > > *============================================================= > =============* > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; > ask for FAX# | > | Email: tim@consultix-inc.com Web: > http://www.consultix-inc.com | > | TIM MAHER: Unix/Perl > DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | > | *We are currently scheduling On-Site Classes on UNIX and > Perl topics!* | > *============================================================= > =============* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address > For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: > http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Wed Jun 6 11:08:37 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Extreme Programming Meeting This Thursday (June 7) Message-ID: EXTREME PROGRAMMING MEETING TOPIC Arlo Emerson, Senior Site Developer with Lante will be giving a presentation on the use of the Struts Framework. An explanation on how Struts was leveraged during an XP project, including configuration, integration with servlets, unit testing and acceptance testing with real world examples will be given. For background or additional information http://jakarta.apache.org/struts/index.html. Arlo can be reached at aemerson@lante.com. DATE AND SCHEDULE Thursday, June 7, 2001 (second Thursday of the month). 6.30 pm - 7.00 pm : Pizza + Networking. 7.00 pm - 9.00 pm : Presentations and Q&A. LOCATION Suite 100, Lante's Main Conference Room 3180 139th Avenue SE Bellevue, WA 98005 425.564.8800 (main desk) DIRECTIONS I have refactored the directions into two parts. First, how to get to 139th Ave SE (which depends on which interstate you use) and then how to get to 3180 which should be same for all cases: STEP 1: How to get to 139th Ave SE From I-405 South (going towards I-90) from Bellevue, Redmond. * Take exit 10 for Coal Creek Parkway and turn LEFT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE. From I-405 North (going towards I-90) from Renton. * Take exit 10 for Coal Creek Parkway and turn RIGHT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE From I-90 West (going towards I-405) from Bellevue, Issaquah, Redmond. * Take the 161st Ave SE/156th Ave SE/150th Ave SE exit (exit 11). * Keep LEFT at the fork in the ramp. * Keep RIGHT at the fork in the ramp. * Turn LEFT onto SE Eastgate Way. * Turn RIGHT onto 139th Ave SE. From I-90 East (going towards I-405) from Seattle, Mercer Island. * Take the Richards Road exit (exit 10). * Take a LEFT at the light off the exit ramp onto Richards Rd. * You will drive under I-90 crossing it. * Take the first RIGHT onto SE Eastgate Way. * Take a LEFT at the light onto 139th Ave SE STEP 2: How to find 3180 on 139th Ave SE * Drive past the turn for SE 32nd St. * 3180 will be the first building on your RIGHT. * You will notice a parking entrance into the building on your RIGHT. * Drive into it and then drive up the parking garage to the top (the 4th floor) which has uncovered parking. * Park anywhere (parking is free). * The building entrance should be straight ahead and there will be signs pointing to the XP meeting. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Wed Jun 6 18:17:19 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: Extreme Programming Meeting On JUNE 14 (CORRECTION) Message-ID: The meeting is on June 14 (second Thursday of the month), NOT June 7, as I accidentally stated earlier. Sorry about the confusion. I forgot I wasn't pairing. -- Asim EXTREME PROGRAMMING MEETING TOPIC Arlo Emerson, Senior Site Developer with Lante will be giving a presentation on the use of the Struts Framework. An explanation on how Struts was leveraged during an XP project, including configuration, integration with servlets, unit testing and acceptance testing with real world examples will be given. For background or additional information http://jakarta.apache.org/struts/index.html. Arlo can be reached at aemerson@lante.com. DATE AND SCHEDULE Thursday, June 14, 2001 (second Thursday of the month). 6.30 pm - 7.00 pm : Pizza + Networking. 7.00 pm - 9.00 pm : Presentations and Q&A. LOCATION Suite 100, Lante's Main Conference Room 3180 139th Avenue SE Bellevue, WA 98005 425.564.8800 (main desk) DIRECTIONS I have refactored the directions into two parts. First, how to get to 139th Ave SE (which depends on which interstate you use) and then how to get to 3180 which should be same for all cases: STEP 1: How to get to 139th Ave SE From I-405 South (going towards I-90) from Bellevue, Redmond. * Take exit 10 for Coal Creek Parkway and turn LEFT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE. From I-405 North (going towards I-90) from Renton. * Take exit 10 for Coal Creek Parkway and turn RIGHT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE From I-90 West (going towards I-405) from Bellevue, Issaquah, Redmond. * Take the 161st Ave SE/156th Ave SE/150th Ave SE exit (exit 11). * Keep LEFT at the fork in the ramp. * Keep RIGHT at the fork in the ramp. * Turn LEFT onto SE Eastgate Way. * Turn RIGHT onto 139th Ave SE. From I-90 East (going towards I-405) from Seattle, Mercer Island. * Take the Richards Road exit (exit 10). * Take a LEFT at the light off the exit ramp onto Richards Rd. * You will drive under I-90 crossing it. * Take the first RIGHT onto SE Eastgate Way. * Take a LEFT at the light onto 139th Ave SE STEP 2: How to find 3180 on 139th Ave SE * Drive past the turn for SE 32nd St. * 3180 will be the first building on your RIGHT. * You will notice a parking entrance into the building on your RIGHT. * Drive into it and then drive up the parking garage to the top (the 4th floor) which has uncovered parking. * Park anywhere (parking is free). * The building entrance should be straight ahead and there will be signs pointing to the XP meeting. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From eric.brose at attws.com Thu Jun 7 19:01:45 2001 From: eric.brose at attws.com (Brose, Eric) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: help with split Message-ID: <67AC2DB52118D411A8F300508B957F1204B14556@WA-MSG02> Hello, I'd like to use the split function, but my delimeter is a decimal point and split doesn't like that. #!/usr/bin/perl $s = "9.6"; (@here) = split(/./,$s); print $here[1]; This above won't work, but if I use #!/usr/bin/perl $s = "9,6"; (@here) = split(/,/,$s); print $here[1]; it works fine. Can i have a quick workaround? Thanks, Eric - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jimfl at colltech.com Thu Jun 7 19:37:30 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: help with split In-Reply-To: <67AC2DB52118D411A8F300508B957F1204B14556@WA-MSG02> Message-ID: <719450.3200924250@[192.168.1.101]> --Also Sprache "Brose, Eric" On Thursday, June 7, 2001 5:01 PM -0700: > I'd like to use the split function, but my delimeter is a decimal > point and split doesn't like that. Actually, split likes it too much. Split uses the dot to match any character. To stop split from interpreting the dot as a special charater, just put a backslash in front of it. @stuff = split(/\./, $thingy); -- Jim Flanagan Senior Consultant, Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From eric.brose at attws.com Fri Jun 8 10:08:44 2001 From: eric.brose at attws.com (Brose, Eric) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: help with split Message-ID: <67AC2DB52118D411A8F300508B957F1204B1455E@WA-MSG02> Thanks everyone for their help. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope at jope.net Fri Jun 8 14:13:54 2001 From: jope at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: PS/PDF parsing Message-ID: Are there any modules that do parsing of Postscript/PDF files? I looked on CPAN and found lots that output Postscript or PDF, but none that do parsing, outside of the little bit necessary to add a stamp or cut marks to each page. Context of the question: Someone in my office was looking for a PS-to-HTML converter. There are a couple PS-to-text converters (using Ghostscript under the hood), but those strip most of the layout and formatting info that would be useful for conversion to something richer than plaintext. -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From scott at sabmail.rresearch.com Fri Jun 8 17:12:34 2001 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: PS/PDF parsing In-Reply-To: References: Message-ID: <20010608151233.A66693@sabami.seaslug.org> On Fri, Jun 08, 2001 at 12:13:54PM -0700, El JoPe Magnifico wrote: > Are there any modules that do parsing of Postscript/PDF files? > I looked on CPAN and found lots that output Postscript or PDF, > but none that do parsing, outside of the little bit necessary > to add a stamp or cut marks to each page. > > Context of the question: Someone in my office was looking for a > PS-to-HTML converter. There are a couple PS-to-text converters > (using Ghostscript under the hood), but those strip most of the > layout and formatting info that would be useful for conversion > to something richer than plaintext. That's going to be rather tricky since PS is a programming language that can be abused...you need a language interpreter (e.g. Ghostscript) to make sense of out of it. I don't know what kind of drivers there are for Ghostscript, but it seems like that's what you'd need - some driver for GS that does some fancier conversions to some sort of page layout language (e.g. TeX, troff, ...), then format to HTML from that. Another problem is going to be that since it's a page layout sort of language, it's probably assuming a larger, fixed size piece of paper for output and going to a language where the user is expect to be able to resize the device could present problems... Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From SEYMOUR at npl.npl.washington.edu Fri Jun 8 17:40:42 2001 From: SEYMOUR at npl.npl.washington.edu (Richard Seymour UW-NPL) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: PS/PDF parsing Message-ID: <010608154042.2182b583@npl.npl.washington.edu> Am i missing something here? On Fri, Jun 08, 2001 at 12:13:54PM -0700, El JoPe Magnifico wrote: > Are there any modules that do parsing of Postscript/PDF files? Don't you consider PDF pretty much already "web-enabled", since (almost) all browsers carry around Acrobat Reader? > Context of the question: Someone in my office was looking for a > PS-to-HTML converter. There are a couple PS-to-text converters > (using Ghostscript under the hood), but those strip most of the > layout and formatting info that would be useful for conversion > to something richer than plaintext. Let's play give-the-user-what-they-asked-for (which may not be what they wanted... that's user education) Since Ghostscript is capable of both GIF (old versions) and PDF output, simply change the PS-to-Text background script to generate either one... IF you generate PDF, you're (effectively) done... serve the result. If you generate GIF, then you'll need a ( img src="scratch.gif" ) tag to show it as a full-page image. The latter (gif) "solution" requires parsing the original document to single-page level (or iteratively calling ghostscript with the page number until it returns a blank result). The PDF ghostscript command would be something along the lines of: gs -sDEVICE=pdfwrite -r72x72 -sOutputFile=- input.ps with the "r" being the pixels-per-inch resolution. There's also a -g(width)x(height) to describe page size in pixels. -sOutputFile=| outputs to a pipe. it's a great tool... --dick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope-spug at jope.net Fri Jun 8 20:11:48 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:05 2004 Subject: SPUG: PS/PDF parsing In-Reply-To: <010608154042.2182b583@npl.npl.washington.edu> Message-ID: On Fri, 8 Jun 2001, Richard Seymour UW-NPL wrote: > Don't you consider PDF pretty much already "web-enabled", > since (almost) all browsers carry around Acrobat Reader? Personally, yes. I should point out that the original request that spurred me on to this line of questioning is _not_ my sole purpose for asking. As usual, it got me thinking off on a tangent. =) There are various other useful reasons to want to be able to parse PS/PDF content, besides converting to HTML, which actually interests me very little: Batch-modifying PDF's, cataloguing content in PDF's found by a crawler, as an import filter for a layout program, etc. On Fri, 8 Jun 2001, Scott Blachowicz wrote: > That's going to be rather tricky since PS is a programming language > that can be abused...you need a language interpreter (e.g. > Ghostscript) to make sense of out of it. First, that'd be cheatin'. =) Second, COME ON, THIS IS PERL! If Damian hasn't taught you by now that it can parse anything on the planet, then I'm not going to try. Yes, it's a difficult problem, but therefore also an interesting one. I just want to know whether anyone has already made headway on it. -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From aaron at activox.com Sat Jun 9 00:48:19 2001 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: PS/PDF parsing In-Reply-To: References: <010608154042.2182b583@npl.npl.washington.edu> Message-ID: <3.0.5.32.20010608224819.01017a80@pop3.norton.antivirus> At 06:11 PM 6/8/01 -0700, El JoPe Magnifico wrote: >There are various other useful reasons to want to be able to parse >PS/PDF content, besides converting to HTML, which actually interests >me very little: Batch-modifying PDF's, cataloguing content in PDF's >found by a crawler, as an import filter for a layout program, etc. ...or run regexes to suck data out of PDFs and put it into a database, breaking up Big Effing PDFs into Little Bitty ones that only have the parts you want based on the contents thereof and shove those little bits into an access control system, converting selective PDF contents on the fly into XML so you can feed it to another system, and the list goes on. I also don't care a bit about layout. I usually work the other end. I get a bunch of PDF stuff kicked to me, and somebody wants me to programmatically rip the PDFs up and send them the good parts either as smaller PDFs or they just want the data, please. Most of the PDF stuff on CPAN either focus on writing PDFs, or only give you functions to learn ABOUT the file (the labeling crap I really don't care much about). There are some commercial products that (for a steep price) give you some limited means to do this, but even among the commercial stuff there is no Swiss Army knife of PDFs. How about something to rip the effing chest of a PDF open and hold its still-beating heart up to its face as it sinks to its knees and takes a last breath, similar to the way that Spreadsheet:ParseExcel works? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dcd at tc.fluke.com Sat Jun 9 15:28:49 2001 From: dcd at tc.fluke.com (David Dyck) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: PS/PDF parsing In-Reply-To: <3.0.5.32.20010608224819.01017a80@pop3.norton.antivirus> Message-ID: On Fri, 8 Jun 2001, Aaron Salo wrote: > .... or they just want the data, please. I too have wanted the data from .pdf files in the past - I've either generated postscript, and grep'ed the postscript, or went to a windows pc, and printed from acroread to a text file. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sat Jun 9 23:08:58 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: June Talk: Colin on Databases Message-ID: <20010609210858.A32203@timji.consultix.wa.com> JUNE SPUG TALK Title: Database Programming with Perl Speaker: Colin Meyer, Helvella Time: June 19th, 2001 (Third Tuesday), 7pm-9pm Location: Union Bank of Cal., Madison & 5th, 5th Floor Mtg Room Cost: Admission is free and open to the general public. Attendees are encouraged to arrive at the building's 5th & Madison door by 6:45pm, which might be locked at other times. More Info: See http://www.seattleperl.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Colin Meyer is an acknowledged expert on Perl, database, and CGI programming, and author of the 3-day training course "Database Programming with Perl" (see http://www.consultix-inc.com). He'll cover the use of the DBI.pm module to connect to popular database engines, and answer questions from the audience. NOTE: He gave a similar talk about 2 years ago, when SPUG was still meeting at the Fred Hutchinson Cancer Research center. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Parking We recommend avoiding the parking lot below the Union Bank building, due to the very hefty fee you'll be assessed if you leave after 9pm. There are plenty of other parking garages in the vicinity that are more affordable, and some on-street parking too. Pre/Post-Meeting Gathering Place Come and pass the pre-meeting time with other SPUGsters at the Rock Bottom brewpub, at 1333 5th Ave., (206) 623-3070, in downtown Seattle. Look to your left, near the bar or pool table, for bizarre yet strangely appealing characters wielding laptops and hearty ales. Attendees tend to arrive around 6pm, and to leave for the meeting by 6:40pm. For more information, including driving directions and street addresses, see http://www.seattleperl.com ======================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: seattleperl.com | ======================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Sun Jun 10 15:18:38 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: perl/unix whiz available for work Message-ID: <20010610131838.B5670@ero.com> Sorry to all if this is an inappropriate post, but... I'm a Seattle-based perl/unix geek who is currently available for work. Specialties include (but are not limited to) OO perl, data-munging, Unix automation, network tools, DBI, Apache, mod_perl, HTML::Mason, MySQL, and Sybase, Interests include (but are not limited to) genetic algorithms, AI, distributed computing, linguistics, and sifting through mountains of text. Although I prefer short term contracts, part-time work, working remotely, or work having some combination of the aforementioned qualities, I'm open to most anything. I even do Python work. The cliff's note version of my resume is available online at: http://www.ero.com/resumes/dean/ dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From joshlanza at hotmail.com Mon Jun 11 15:09:46 2001 From: joshlanza at hotmail.com (Joshua Lanza) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Local ISP with PHP and CGI Message-ID: Anyone have any advice on local ISPs that have PHP, CGI and database access? TIA, Josh _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Mon Jun 11 17:22:52 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Re: perl/unix whiz available for work References: <20010610131838.B5670@ero.com> Message-ID: <013701c0f2c5$120069f0$1788ddd1@aciwin> I'm looking for Perl/Java/Unix work in Seattle also. Strengths include Perl, mod_perl, DBI, Java, C, SQL, Unix, algorithm development (HMAC-SHA, Weiner-Levinson deconvolution, conjugate gradient search, inversion, time series analysis, Fourier transform). Will do contract or full-time. Condensed resume is on-line at http://www.icca.org/firms/f21152.htm or will e-mail detailed version. Cheers, Richard ---- Original Message ----- From: "Dean Hudson" To: Sent: Sunday, June 10, 2001 1:18 PM Subject: SPUG: perl/unix whiz available for work > Sorry to all if this is an inappropriate post, but... > > I'm a Seattle-based perl/unix geek who is currently available for > work. Specialties include (but are not limited to) OO perl, > data-munging, Unix automation, network tools, DBI, Apache, mod_perl, > HTML::Mason, MySQL, and Sybase, Interests include (but are not limited > to) genetic algorithms, AI, distributed computing, linguistics, and > sifting through mountains of text. > > Although I prefer short term contracts, part-time work, working > remotely, or work having some combination of the aforementioned > qualities, I'm open to most anything. I even do Python work. > > The cliff's note version of my resume is available online at: > > http://www.ero.com/resumes/dean/ > > dean. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Mon Jun 11 17:45:50 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: OO Perl conundrum References: <20010609210858.A32203@timji.consultix.wa.com> Message-ID: <015f01c0f2c8$44bef480$1788ddd1@aciwin> I recently loaded an upgrade to HTTP::WebTest to CPAN, and promptly got an interesting change request from a gentleman named Thomas Ayles (actually, a submittal of the code for a complete revision of the module). (HTTP::WebTest is a module that fetched URLs, runs tests on the returned page and generates a detailed test report.) Thomas's idea, which is good, is to define a namespace, HTTP::WebTest::Plugins, to hold plugin subroutines that run additional tests on the page. Then coderefs to the subroutines are passed to HTTP::WebTest, which passed the fetched page to the subroutine for testing. Thomas also defines a class HTTP::WebTest::PluginHelper to encapsulate the report generation. My concern is about Thomas's use of the package and use statements. The structure of the new HTTP::WebTest class looks like this: package HTTP::WebTest; ... { package PluginHelper; ... package Plugins; use HTTP::WebTest; ... } ... This seems like a fairly non-standard use of OO Perl. Would this be better done by subclassing HTTP::WebTest and making PluginHelper and Plugins subclasses of the new subclass be better? Or is there some simpler approach? Puzzled, Richard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Mon Jun 11 20:55:51 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: OO Perl conundrum In-Reply-To: <015f01c0f2c8$44bef480$1788ddd1@aciwin>; from Richard.Anderson@raycosoft.com on Mon, Jun 11, 2001 at 03:45:50PM -0700 References: <20010609210858.A32203@timji.consultix.wa.com> <015f01c0f2c8$44bef480$1788ddd1@aciwin> Message-ID: <20010611185551.A13835@ero.com> On Mon, Jun 11, 2001 at 03:45:50PM -0700, Richard Anderson wrote: > package HTTP::WebTest; > ... > { > package PluginHelper; > ... > package Plugins; > use HTTP::WebTest; > ... > } > ... > > This seems like a fairly non-standard use of OO Perl. Would this be better > done by subclassing HTTP::WebTest and making PluginHelper and Plugins > subclasses of the new subclass be better? Or is there some simpler approach? It seems to me that inheritance is not the correct relationship between these things; composition is prolly what you're looking for (ie an HTTP::WebTest object HAS one or more HTTP::WebTest::Plugins.) You can keep track of them via an array in your HTTP::WebTest instance. Then you could require that a HTTP::WebTest::Plugin object implement a particular method (say test()) which implements the test that you want the plug-in to handle. After running your standard tests you iterate over your array of plug-in objects and call their test() methods, passing them the web page to be tested. Does that make any sense? I'm not familiar with the module at all, and I'm also not sure where PluginHelper fits in (I'm not sure what it does) so I could be off base. But usually composition is a more appropriate relationship than inheritance. dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From weaver at eai.com Tue Jun 12 12:12:44 2001 From: weaver at eai.com (weaver) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: removing array from "array of arrays" Message-ID: I have: @args = ("arg1", "arg2", "arg3"); for($i = 1; $i < $something; $i++) { push @args_list, @args; # or push @args_list, [ @args ]; } and in a subroutine would like to remove the @args that I pushed onto @args_list during one loop iteration, WITHOUT KNOWING THE # OF ELEMENTS ASSIGNED TO @args. In other words, I DON'T want to use: @var = @_[0, 1, 2]; or anything of this nature. How can I do this, can it be done? Thanks, ryan - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From largest at largest.org Tue Jun 12 12:35:29 2001 From: largest at largest.org (Joel Grow) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: removing array from "array of arrays" Message-ID: On Tue, 12 Jun 2001, weaver wrote: > I have: @args = ("arg1", "arg2", "arg3"); > > for($i = 1; $i < $something; $i++) > { > push @args_list, @args; # or push @args_list, [ @args ]; > } > > and in a subroutine would like to remove the @args that I pushed onto > @args_list during one loop iteration, WITHOUT KNOWING THE # OF > ELEMENTS ASSIGNED TO @args. In other words, I DON'T want to use: > > @var = @_[0, 1, 2]; > > or anything of this nature. > > How can I do this, can it be done? There is a big difference between push @args_list, @args; and push @args_list, [ @args ]; The former first expands @args into a list and then pushes each element into @args_list--you do *not* get an array of arrays, just one giant array. The latter pushes one element into @args_list for each iteration of the loop, a reference to an array containing the elements of @args. This is an array of arrays, and is a good way to solve your problem. your code might look something like this: for($i = 1; $i < $something; $i++) { push @args_list, [ @args ]; } # then, later on when you want to process @args_list... for my $ra_args ( @args_list ) { process($ra_args); } sub process { my $ra_args = shift; for my $arg ( @$ra_args ) { print "I found an arg: $arg\n"; } } __END__ $Joel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cwilkes at ladro.com Tue Jun 12 11:54:49 2001 From: cwilkes at ladro.com (Chris Wilkes) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: removing array from "array of arrays" In-Reply-To: Message-ID: What you have listed for the push statement are two dramatically different items. The first way you get one long array, like: @args_list = qw(arg1 arg2 arg3 arg1 arg2 arg3 arg1 arg2 arg3); with the second way (which I think you want) you get a 2D array that looks like: @args_list = [ [arg1 arg2 arg3] [arg1 arg2 arg3] [arg1 arg2 arg3] ] The easiest way to find out that you did this is to use the Data::Dumper module, like this: #!/usr/bin/perl use Data::Dumper; use strict; my (@args, @args_list, $something); $something = 5; @args = ("arg1", "arg2", "arg3"); for my $i (1..$something) { push @args_list, [ $i, @args ]; # or push @args_list, [ @args ]; } print Dumper(@args_list); (I threw the index variable into the array so that you can see what item you're removing) To remove an element out of the @args_list array you have to use the splice command. A "perldoc -f splice" command shows you how to use it. So put in a "splice (@args_list, 3, 1)" in before the Dumper line and you'll see that you've removed the 4th element (as arrays start at 0) from your array. Of course I'm guessing as to if this is actually what you want to do. I can't imagine that you're pushing items into a 1D array and then wanting to remove a group of them w/o knowing which ones to remove. If you want you can mail me your problem. It seems like I've joined some other members of the SPUG list in looking for work ;) Chris On Tue, 12 Jun 2001, weaver wrote: > I have: > > @args = ("arg1", "arg2", "arg3"); > > for($i = 1; $i < $something; $i++) > { > push @args_list, @args; # or push @args_list, [ @args ]; > } > > and in a subroutine would like to remove the @args that I pushed onto > @args_list during one loop iteration, WITHOUT KNOWING THE # OF ELEMENTS > ASSIGNED TO @args. In other words, I DON'T want to use: > > @var = @_[0, 1, 2]; > > or anything of this nature. > > > How can I do this, can it be done? > > Thanks, > > ryan > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jimfl at colltech.com Tue Jun 12 16:31:30 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Maledictus Referentia Message-ID: <9981013.3201345090@[192.168.1.101]> Does anyone know a more elegant way than $profane = {%$sacred}; to get an 'un-blessed' hashref from a blessed one? (Don't ask.) -- Jim Flanagan Senior Consultant, Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mkorb at versuslaw.com Tue Jun 12 16:54:16 2001 From: mkorb at versuslaw.com (Martin Korb) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: running multiple scripts concurrently Message-ID: <003b01c0f38a$39a93200$9501a8c0@versuslaw.com> Here is the scenario. I have a perl scripts (first.pl) which does a system call to initiate a 2nd script (second.pl) or a 2nd executable (second.exe). I would like to initiate a 3rd script (third.pl) from first.pl while second.pl is still running. The second and third scripts are independent of each other and do different things (meaning neither task has to be completed or completed successfully for the other script to do its task). All this needs to happen on a Win32 platform. Thanks for any help and/or direction. hmk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010612/74ce6666/attachment.htm From jope-spug at jope.net Tue Jun 12 18:00:04 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Maledictus Referentia In-Reply-To: <9981013.3201345090@[192.168.1.101]> Message-ID: Note that what you're doing here is copying the blessed hash, rather than un-blessing it. Not sure whether that makes a difference for your purposes. I seem to remember Brian Ingerson having figured out (or maybe he was still plotting) a "curse" equivalent to the "bless" function, to remove the object typing from a variable. Alas, I'd had a couple beers by that the time, so it's all a bit fuzzy... =) -jp > Does anyone know a more elegant way than > $profane = {%$sacred}; > to get an 'un-blessed' hashref from a blessed one? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From algard at cardomain.com Tue Jun 12 17:58:06 2001 From: algard at cardomain.com (Alex Algard) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: running multiple scripts concurrently In-Reply-To: <003b01c0f38a$39a93200$9501a8c0@versuslaw.com> Message-ID: Check out the fork() function. On the other hand, I don't know much about Win32, and there might be alternatives to it that work better on Win32. ________________________ Alex Algard CarDomain Networks, Inc. 425-820-2244 x111 | fax: 425-820-5951 algard@cardomain.com -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Martin Korb Sent: Tuesday, June 12, 2001 2:54 PM To: spug-list@pm.org Subject: SPUG: running multiple scripts concurrently Here is the scenario. I have a perl scripts (first.pl) which does a system call to initiate a 2nd script (second.pl) or a 2nd executable (second.exe). I would like to initiate a 3rd script (third.pl) from first.pl while second.pl is still running. The second and third scripts are independent of each other and do different things (meaning neither task has to be completed or completed successfully for the other script to do its task). All this needs to happen on a Win32 platform. Thanks for any help and/or direction. hmk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010612/424b0577/attachment.htm From Richard.Anderson at raycosoft.com Tue Jun 12 19:30:32 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: running multiple scripts concurrently References: Message-ID: <02fc01c0f3a0$103109a0$1788ddd1@aciwin> As of last year, fork did not work on Windows. ActiveState was working on implementing fork in ActivePerl, don't know what the status of it on Windows 95 / 98/ NT / 2000 / ad naseum is ... Cheers, Richard ----- Original Message ----- From: "Alex Algard" To: "Martin Korb" ; Sent: Tuesday, June 12, 2001 3:58 PM Subject: RE: SPUG: running multiple scripts concurrently > Check out the fork() function. On the other hand, I don't know much about > Win32, and there might be alternatives to it that work better on Win32. > ________________________ > Alex Algard > CarDomain Networks, Inc. > 425-820-2244 x111 | fax: 425-820-5951 > algard@cardomain.com > > > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Martin Korb > Sent: Tuesday, June 12, 2001 2:54 PM > To: spug-list@pm.org > Subject: SPUG: running multiple scripts concurrently > > > Here is the scenario. > I have a perl scripts (first.pl) which does a system call to initiate a > 2nd script (second.pl) or a 2nd executable (second.exe). I would like to > initiate a 3rd script (third.pl) from first.pl while second.pl is still > running. The second and third scripts are independent of each other and do > different things (meaning neither task has to be completed or completed > successfully for the other script to do its task). All this needs to happen > on a Win32 platform. > > Thanks for any help and/or direction. > > hmk > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mmaiza at digimine.com Tue Jun 12 21:28:48 2001 From: mmaiza at digimine.com (Moncef Maiza) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: running multiple scripts concurrently Message-ID: <19C2967B601A1E4B8B13490610E189D7CF13BF@corpexch01.corp.digimine.com> If you do not mind using win32::Process then you can make use of things like win32::Process::Create or win32::Process::CreateProcessAsUser. The advantage here is that you can control your process, kill it, suspend it, waiting for it to end as well as set priorities. Here's a little example: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ use Win32::Process; $Pid = Win32::Process::Create($Process, "c:\\apps\\perl\\bin\\perl.exe", "perl test.pl", 1, CREATE_NEW_PROCES, "."); if ($Pid) { print "Process was created with ID of $Pid \n"; }else{ print "Unable to run $Command. \n"; print "Error: ".Win32::FormatMessage(Win32::GetLastError() ); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Check the ActiveState help. The 4th parameter "1" determines whether your subprocess inherits handles or not (careful, here). Moncef Maiza digiMine -----Original Message----- From: Richard Anderson [mailto:Richard.Anderson@raycosoft.com] Sent: Tuesday, June 12, 2001 5:31 PM To: Alex Algard; Martin Korb; spug-list@pm.org Subject: Re: SPUG: running multiple scripts concurrently As of last year, fork did not work on Windows. ActiveState was working on implementing fork in ActivePerl, don't know what the status of it on Windows 95 / 98/ NT / 2000 / ad naseum is ... Cheers, Richard ----- Original Message ----- From: "Alex Algard" To: "Martin Korb" ; Sent: Tuesday, June 12, 2001 3:58 PM Subject: RE: SPUG: running multiple scripts concurrently > Check out the fork() function. On the other hand, I don't know much about > Win32, and there might be alternatives to it that work better on Win32. > ________________________ > Alex Algard > CarDomain Networks, Inc. > 425-820-2244 x111 | fax: 425-820-5951 > algard@cardomain.com > > > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Martin Korb > Sent: Tuesday, June 12, 2001 2:54 PM > To: spug-list@pm.org > Subject: SPUG: running multiple scripts concurrently > > > Here is the scenario. > I have a perl scripts (first.pl) which does a system call to initiate a > 2nd script (second.pl) or a 2nd executable (second.exe). I would like to > initiate a 3rd script (third.pl) from first.pl while second.pl is still > running. The second and third scripts are independent of each other and do > different things (meaning neither task has to be completed or completed > successfully for the other script to do its task). All this needs to happen > on a Win32 platform. > > Thanks for any help and/or direction. > > hmk > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010612/6a4a1803/attachment.htm From cmeyer at helvella.org Thu Jun 14 17:38:00 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: YAPC Keynote Speach Message-ID: <20010614153800.F8845@hobart.helvella.org> For those of you who, like myself, are unfortunately not attending YAPC::NA, the keynote speech is available online, as an mp3, and the slides as a pdf file. audio: http://www.crystalflame.net/keynote.mp3 slides: http://www.yetanother.org/damian/Perl6/YAPC_talk.pdf Damian Conway ended up replacing the ill Larry as keynote speaker. He talks about the history of Perl, and the future of Perl6. More news at http://use.perl.org/ Have fun, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Jun 14 18:23:59 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Need 10 Perl Programmers Message-ID: <20010614162359.A22353@timji.consultix.wa.com> From: Elliott Dale To: "'spug@halcyon.com'" Subject: Contract Position for Perl Developers Date: Tue, 12 Jun 2001 21:28:47 -0700 X-Mailer: Internet Mail Service (5.5.2650.21) SPUG Members and Friends: I am a technical recruiter with ConsultNet in Bellevue. I have been attempting to follow your discussions for the last few months, but this is the first time that I have occasion to interrupt you with an opportunity for a temporary work arrangement. I have a client located in downtown Seattle in the internet/web development business who is embarking on a new project and is in dire need of many (10) Perl developers on a contract basis for three months. The contracts will be through us (ConsultNet), and will last for three months, with a possibility for extension and the mutual option to turn the contract into a permanent employment arrangement. We are open to considering candidates on a W-2 or 1099 basis. There is no option for telecommuting in this scenario. The expected pay range is at a rate of $40 - $55 per hour, depending on qualifications and experience. This is a mission-critical project and candidates must be available to begin working within a few days notice. We would be interested in interviewing qualified candidates immediately and sending you directly to the client site for confirmation and technical screening. Interested parties, please email your resume directly to elliott@consultnet-nw.com. Please include "Object-Oriented Perl Developer" in the subject line. I look forward to working with you. Requirements: * 5+ solid years of software development, with 3 years of strong Object-oriented PERL development experience. * Development experience must include design and architecture of distributed systems or multi-tier client/server applications. * Java experience must include focuses on J2EE, EJB, Servlets and JSP. * PERL experience must include in-depth knowledge of object-oriented PERL and use of DBI/DBD. * Strong relational database (Oracle) skills. * Experience with BEA WebLogic or Top Link is a definite plus. * Candidate must also have strong problem solving and issue resolution skills. * Knowledge of RUP, UML and XML is highly desirable. * Candidate must be a team player, able to work with cross-functional teams, and leading-edge technology. Sincerely, Elliott Dale Technical Recruiter ConsultNet Seattle/Bellevue/Redmond, WA email: elliott@consultnet-nw.com office: 425.637.9700 toll-free: 877.287.9526 cell: 206.280.5745 fax: 425.637.9600 To learn more about ConsultNet, just click: http://about.consult-net.com www.consult-net.com Empowering the World's largest network of computer professionals. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Thu Jun 14 22:44:36 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: ppm broken (activestate) Message-ID: Hello. I use ActiveState Perl version 5.6.0 build 618 on Windows 98. My PPM (version 2.1) just started breaking recently with this error: =================== PPM interactive shell (2.1) - type 'help' for available commands. PPM> search Net-FTP not well-formed at line 1, column 17, byte 17 at C:/Perl/site/lib/SOAP/Parser.pm line 73 ==================== I assume that ActiveState has made a change to their server that broke the old version of the PPM client. Their web site doesn't give much help. Some one else reported the same bug on March 8th, and it's still open. I am assuming that installing a new version of ActivePerl will fix this, but I have to do this at a client site tomorrow where I have very limited time and a slow connection. Is there a way to just upgrade the version of PPM? More specifically, I need to make sure that I can properly install the Net::Ftp module and all its dependent modules. They are under my perl\site\lib directory on my PC at home. I don't recall whether I specifically installed these via PPM, or if they came with the original install of Perl. How much danger is there in just copying the \perl\site\lib directory to a floppy and then copying them to the other machine tomorrow? Background: The system is a simple system to maintain web pages. I have a simple Perl script to build pages, and another script to upload the files via FTP. The system works great on my PC, and now I need to transfer it to the other PC, which is almost exactly the same configuration as my system at home, except I've installed a module or two on my home system since they were the exact configuration. So, a hackish solution is fine if it gets the job done. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010614/489cbfb7/attachment.htm From Richard.Anderson at raycosoft.com Fri Jun 15 08:24:31 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Crawling the web Message-ID: <011201c0f59e$8448df20$1788ddd1@aciwin> I've written a generalized, extensible Perl module for crawling the web and doing arbitrary processing of web pages. Before I release it to CPAN, I would be interested in getting feedback on the module's usability. If there is anyone interested in using this for some innovative web-crawling application, please drop me a line. Ideally, I'd like to work with someone that could coauthor an article in the Perl Journal someday ... Cheers, Richard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Fri Jun 15 10:50:59 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Crawling the web References: <011201c0f59e$8448df20$1788ddd1@aciwin> <20010615145410.B2738@ns0.astray.com> Message-ID: <013e01c0f5b2$fa107420$1788ddd1@aciwin> Good question! Haven't used WWW::Robot, but after reading the docs: Both modules are extensible via 'hooks'. (I call it a 'plugin'.) IMPORTANT: My module allows multiple plugins, WWW::Robot does not. If my module becomes popular, it may encourage authors of plugins to load them to CPAN so we could have a set of modules that would do link checking, HTML 4.0 validation, XHTML 1.0 validation, WML validation, XML validation, spell checking, grammar checking, etc. Trying to bundle all of these applications into a single WWW::Robot plugin would be a mess, in my opinion. My module can be used 'out of the box' for web page validation using some built-in basic tests (response time, min/max size of page, text string/regex matching against the page). WWW::Robot requires the user to write a plugin to use it. My module is bundled with a script that allows it to be driven from the command line using an input parameter file. (It can also be used like a module from within a user-supplied program.) My module can be used for unit testing of static or dynamic web pages: If passed a file pathname instead of a URL, it will start a local instance of Apache on a private/dynamic port, copy the file to a temporary htdocs directory, fetch the page and process it. This is easy to integrate with the 'make test' phase of a makefile. My module handles creating and passing cookies to and from the web server, even during multiple redirects; looks like WWW::Robot can accept a cookie but not create one from scratch. My module handles passing parameters (as from a form) to the web server, looks like WWW::Robot does not. My module doesn't honor the Robot Exclusion Protocol (yet), WWW:Robot does. WWW::Robot extracts all the links on each page it visits, I leave that up to the author of the plugin. (Probably should add that ..) My module exposes methods for input parameter validation and generating a detailed report (both a summary report and a report on each visited URL); looks like WWW::Robot does not have this. WWW:Robot had a single release in 1997, since then no maintenance has been done, which suggests that it is dead code. I'm actively working on my module; it's buggy but if it gets enough use and maintenance it could get to production-level quality someday. (I'm probably being a bit harsh on WWW::Robot; I haven't used it so it probably has some nifty features that I should add to my module.) Cheers, Richard ----- Original Message ----- From: "Leon Brocard" To: "Richard Anderson" Sent: Friday, June 15, 2001 6:54 AM Subject: Re: SPUG: Crawling the web > Richard Anderson sent the following bits through the ether: > > > I've written a generalized, extensible Perl module for crawling the web and > > doing arbitrary processing of web pages. > > Sure. How does it compare to WWW::Robot? > > Leon > -- > Leon Brocard.............................http://www.astray.com/ > Iterative Software...........http://www.iterative-software.com/ > > ... Holy Smoke Batman, it's the Joker! > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Fri Jun 15 12:36:48 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Crawling the web In-Reply-To: <013e01c0f5b2$fa107420$1788ddd1@aciwin>; from Richard.Anderson@raycosoft.com on Fri, Jun 15, 2001 at 08:50:59AM -0700 References: <011201c0f59e$8448df20$1788ddd1@aciwin> <20010615145410.B2738@ns0.astray.com> <013e01c0f5b2$fa107420$1788ddd1@aciwin> Message-ID: <20010615103648.A6653@ero.com> How does it compare to LWP::RobotUA? On Fri, Jun 15, 2001 at 08:50:59AM -0700, Richard Anderson wrote: > Good question! Haven't used WWW::Robot, but after reading the docs: [...] dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Fri Jun 15 16:00:58 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: combine Crawler project w/SPUG rewrite project? Message-ID: Is the SPUG web page rewrite project still in limbo? I would like to propose a very modest upgrade to the SPUG web site. I would like the same basic content, but instead of having one long page, my ideal SPUG page would have a pseudoframe on the left with links to various sections of the page. The pages would be generated with a lightweight Perl program. Basically, you'd have small HTML files that were maintained manually, and then to build the whole page, you'd run a script that would tie in the pseudoframe and other boilerplate content to all the pages. The Perl code to maintain the page would be open source, of course. I would use the Crawler module to get all the pages from the existing seattleperl.com. Thanks, Steve Howell -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010615/1591587e/attachment.htm From Richard.Anderson at raycosoft.com Fri Jun 15 18:50:03 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Crawling the web References: <011201c0f59e$8448df20$1788ddd1@aciwin> <20010615145410.B2738@ns0.astray.com> <013e01c0f5b2$fa107420$1788ddd1@aciwin> <20010615103648.A6653@ero.com> Message-ID: <01d401c0f5f5$e9070d40$1788ddd1@aciwin> LWP::RobotUA provides some methods that help in writing a robot from scratch, whereas my module (working title:: HTTP::Robot) does almost all the robot's work except for actually processing the web page. Richard ----- Original Message ----- From: "Dean Hudson" To: "Richard Anderson" Cc: "Leon Brocard" ; "spug" Sent: Friday, June 15, 2001 10:36 AM Subject: Re: SPUG: Crawling the web > How does it compare to LWP::RobotUA? > > On Fri, Jun 15, 2001 at 08:50:59AM -0700, Richard Anderson wrote: > > > Good question! Haven't used WWW::Robot, but after reading the docs: > > [...] > > dean. > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Sun Jun 17 20:56:29 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: want to call Perl functions from VB Message-ID: <7a.16779f15.285eb9cd@aol.com> Hello. I wonder if anyone has experience making VB and Perl interoperate. Here is what I need to do: 1. User starts up VB program which contains a tree-view widget. 2. VB program starts up Perl program that parses an HTML document with HTML::TreeBuilder. 3. Perl program then goes into some sort of event loop. 4. When the user moves around in VB's tree-view widget, VB calls into Perl code to get the HTML for that part of the document. The interface would be relatively simple; it could be string in, string out, four or five function calls. My best solution right now would be to do this with sockets, but I am interested in alternatives. (I know I could do the client in Perl/TK, but I'm interested in learning about the interoperability of the two languages.) Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010617/c133991a/attachment.htm From bobhilt at qwest.net Mon Jun 18 00:18:16 2001 From: bobhilt at qwest.net (Bob Hiltner) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Re: want to call Perl functions from VB References: <7a.16779f15.285eb9cd@aol.com> Message-ID: <000e01c0f7b6$15d4f3c0$5cd7b4d1@computer> check out the shellexecute api. This is a synchronous call, and getting the results back is not as easy as you'd think. In fact, you might end up having to sort of go through an interemediate file. I don't think you're going to get a memory structure back from the external program. Anyway, you'll find better info at http://msdn.microsoft.com -- search for shellexecute or other likely keywords. ----- Original Message ----- From: Showell30@aol.com To: spug-list@pm.org Sent: Sunday, June 17, 2001 6:56 PM Subject: SPUG: want to call Perl functions from VB Hello. I wonder if anyone has experience making VB and Perl interoperate. Here is what I need to do: 1. User starts up VB program which contains a tree-view widget. 2. VB program starts up Perl program that parses an HTML document with HTML::TreeBuilder. 3. Perl program then goes into some sort of event loop. 4. When the user moves around in VB's tree-view widget, VB calls into Perl code to get the HTML for that part of the document. The interface would be relatively simple; it could be string in, string out, four or five function calls. My best solution right now would be to do this with sockets, but I am interested in alternatives. (I know I could do the client in Perl/TK, but I'm interested in learning about the interoperability of the two languages.) Thanks, Steve - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From wnorth at state.mt.us Mon Jun 18 14:09:37 2001 From: wnorth at state.mt.us (North, Walter) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Win32::Process Message-ID: Greetings from Montana. I have a perl script which runs on Unix/Linux/Widoze I wanted to use Win32::Process if it was running on a Windows box. So, I put in, after many foulups BEGIN { use POSIX qw(uname); ($kernel, $hostname, $release, $version, $hardware) = uname(); if ( $kernel eq "Windows NT") { require Win32::Process; } } Everything seemed ok, but apparently some of the module did not load or loaded wrong and the script now hangs up whilst running $Result = Win32::Process::Create ( $Process, $HARBORCMD, $CMDLINE, $bInherit, $Flags, $HAR BORDIR ); if ( $Result ) { print "$MSG\n"; $Process->Wait(INFINITE); } else { print "Error: " . Win32::FormatMessage( Win32::GetLastError() ); } } A collegue who is more NT knowledgable then me assures me it is the Wait(INFINITE) part that is not working. ie it goes out and waits infinitely and never returns. Note: If instead of BEGIN I used use Win32::Process the script worked, but not on a unix box cause there is no Win32::Process module. So, finally the question: Is there a problem with Win32::Process, or is my code with the Wait in it incorrect? thanks much ----------------------------------------------------- Walter North 406-444-2914 Operating Systems Programmer wnorth@state.mt.us "Confound these ancestors.... They've stolen our best ideas!" - Ben Jonson ----------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From andy at n2h2.com Mon Jun 18 15:06:30 2001 From: andy at n2h2.com (Andrew Sweger) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Win32::Process In-Reply-To: Message-ID: 'require' and 'use' are a little different. Try this in your BEGIN: require Win32::Process; import Win32::Process; On Jun 18, 2001 @ 1:09pm, North, Walter wrote: > Greetings from Montana. > > I have a perl script which runs on Unix/Linux/Widoze > > I wanted to use Win32::Process if it was running on a Windows box. > > So, I put in, after many foulups > > BEGIN { > use POSIX qw(uname); > ($kernel, $hostname, $release, $version, $hardware) = uname(); > if ( $kernel eq "Windows NT") { > require Win32::Process; > } > } > > Everything seemed ok, but apparently some of the module did not load or > loaded wrong and the script now hangs up whilst running > > $Result = Win32::Process::Create ( $Process, $HARBORCMD, $CMDLINE, > $bInherit, $Flags, $HAR > BORDIR ); > if ( $Result ) { print "$MSG\n"; $Process->Wait(INFINITE); } > else { print "Error: " . Win32::FormatMessage( Win32::GetLastError() ); } > } > > A collegue who is more NT knowledgable then me assures me it is the > Wait(INFINITE) part that is not working. ie it goes out and waits > infinitely and never returns. > > Note: If instead of BEGIN I used use Win32::Process the script worked, but > not on a unix box cause there is no Win32::Process module. > > So, finally the question: > > Is there a problem with Win32::Process, or is my code with the Wait in it > incorrect? -Andy - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ced at carios2.ca.boeing.com Mon Jun 18 15:31:59 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Win32::Process Message-ID: <200106182031.NAA13186@carios2.ca.boeing.com> >BEGIN { >use POSIX qw(uname); >($kernel, $hostname, $release, $version, $hardware) = uname(); > if ( $kernel eq "Windows NT") { > require Win32::Process; > } >} >Everything seemed ok, but apparently some of the module did not load or >loaded wrong and the script now hangs up whilst running > $Result = Win32::Process::Create ( $Process, $HARBORCMD, $CMDLINE, >$bInherit, $Flags, $HAR >BORDIR ); > if ( $Result ) { print "$MSG\n"; $Process->Wait(INFINITE); } > else { print "Error: " . Win32::FormatMessage( Win32::GetLastError() ); } >} > >A collegue who is more NT knowledgable then me assures me it is the >Wait(INFINITE) part that is not working. ie it goes out and waits >infinitely and never returns. >Note: If instead of BEGIN I used use Win32::Process the script worked, but >not on a unix box cause there is no Win32::Process module. > So, finally the question: > s there a problem with Win32::Process, or is my code with the Wait in it >incorrect? One problem, likely to be relevant, is that 'use' imports into your namespace while while 'require' doesn't (see perldoc perlmod, perldoc -f use, perldoc -f require etc.) perl -MWin32::Process -le "print INFINITE" 4294967295 or equivalently: perl -le "BEGIN{ require Win32::Process; import Win32::Process }; print INFINITE" 4294967295 Also, you'd also need to wrap the OS specific stuff (see 'perldoc perlport' for discussion of issues here): if ( $^O =~ /MSWin32/ ) { $Result = Win32::Process::Create ( $Process, $HARBORCMD, $CMDLINE, } Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From wnorth at state.mt.us Mon Jun 18 15:51:47 2001 From: wnorth at state.mt.us (North, Walter) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: SUMMARY: Win32::Process Message-ID: Original post below summary: Thanks to Charles DeRykus and Andrew Sweger Adding import Win32::Process did the trick. And its good to know where I can look up more info on this as well thank you again ------------------------------------------------------------------ Greetings from Montana. I have a perl script which runs on Unix/Linux/Widoze I wanted to use Win32::Process if it was running on a Windows box. So, I put in, after many foulups BEGIN { use POSIX qw(uname); ($kernel, $hostname, $release, $version, $hardware) = uname(); if ( $kernel eq "Windows NT") { require Win32::Process; } } Everything seemed ok, but apparently some of the module did not load or loaded wrong and the script now hangs up whilst running $Result = Win32::Process::Create ( $Process, $HARBORCMD, $CMDLINE, $bInherit, $Flags, $HAR BORDIR ); if ( $Result ) { print "$MSG\n"; $Process->Wait(INFINITE); } else { print "Error: " . Win32::FormatMessage( Win32::GetLastError() ); } } A collegue who is more NT knowledgable then me assures me it is the Wait(INFINITE) part that is not working. ie it goes out and waits infinitely and never returns. Note: If instead of BEGIN I used use Win32::Process the script worked, but not on a unix box cause there is no Win32::Process module. So, finally the question: Is there a problem with Win32::Process, or is my code with the Wait in it incorrect? thanks much ----------------------------------------------------- Walter North 406-444-2914 Operating Systems Programmer wnorth@state.mt.us "Confound these ancestors.... They've stolen our best ideas!" - Ben Jonson ----------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From john.brittingham at attws.com Tue Jun 19 11:10:40 2001 From: john.brittingham at attws.com (Brittingham, John) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: returning variables from subs Message-ID: <23F6FCBAA611D511A74A00508BCFBE40127A0A@WA-MSG06> How do I get $summary_var, $problem_var, $subproc_xml_var into the First Subroutine. I can print the veriables in the nested sub but not in the first sub. I have tried to declare them but they show up as empty. Help. sub process_text { use XML::Twig; my $file = $_; my $twig= new XML::Twig( # create the twig TwigHandlers => { '/CCML3' => \&get_xml_text } # call sub when a module ); # element is parsed $twig->safe_parsefile( $file); # process the twig print "\nInside first sub= ".$summary_var, $problem_var, $subproc_xml_var; } sub get_xml_text { my( $twig, $module)= @_; # handlers are always called with those 2 arguments my $e_name = $module->first_child( 'SUMMARY'); # get the elements my $p_name = $module->first_child( 'PROBLEM'); # get the elements my $s_name = $module->first_child( 'FIX')->first_child( 'SUBPROC'); # get the elements my $summary = $e_name->text || print "SUMMARY not Found\n"; # get their text my $subproc_xml = $s_name->sprint(1) || print "FIX not Found\n"; # get their text my $problem = $e_name->text || print "PROBLEM not Found\n"; # get their text chomp ($summary); chomp ($problem); chomp ($subproc_xml); my $summary_var="$summary"; my $problem_var="$problem"; my $subproc_xml_var="$subproc_xml"; print "\nInside nested sub= ".$summary_var, $problem_var, $subproc_xml_var; # purge and return the info $twig->purge; # purges the twig return $summary_var, $problem_var, $subproc_xml_var; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010619/40896a94/attachment.htm From Showell30 at aol.com Tue Jun 19 12:19:59 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: returning variables from subs Message-ID: <20.18117ff2.2860e3bf@aol.com> $summary_var, $problem_var, $subproc_xml_var are "my" variables, which means they only have scope within that function, so it makes sense that the other function does not see them. You want to make them global variables, so you should declare them outside of both functions. You can adjust scope by adding braces (see below) or by using packages. { my $foo; sub foo1 { print "foo was $foo\n"; $foo = 1; } sub foo2 { print "foo was $foo\n"; $foo = 2; } } sub foo3 { # can't print foo here # print $foo; } foo1(); foo2(); foo1(); foo3(); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010619/41a1c688/attachment.htm From tim at consultix-inc.com Thu Jun 21 12:02:04 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: ; from El JoPe Magnifico on Wed, May 30, 2001 at 03:59:05PM -0700 References: Message-ID: <20010621100204.A3397@timji.consultix.wa.com> On Wed, May 30, 2001 at 03:59:05PM -0700, El JoPe Magnifico wrote: > (Apologies if this has already been discussed. I've been off the list > for the past six months, and haven't been to a meeting in eons. *gulp!*) We'll expect to see you again on 8/9, when Damian makes his next visit! 8-} > The front page of the SPUG site is a badly cluttered with old meeting > blurbs, going back over twelve months. It would be a good idea to move > those to a separate page, and just link from a description-less table > of contents on the front page, if not just from a single link. Agreed! And that matter is being addressed, albeit slowly. > And while I'm on the topic of the website... > > Is there any reason not to move it to the pm.org server? Consistency > with the other PM's aside, that server has mod_perl, which I'm guessing > Halcyon's server does not. =) Since we're not running any Perl scripts from the site currently, mod_perl hasn't become an issue. And despite our PM membership, full consistency with other PM groups (which came along after our founding, and "naming") has never been a SPUG priority (as indicated by our retention of our original name). Moreover, there are advantages to maintaining our relationship with halcyon; e.g., they provide dial-up shell-accounts, which on occasion we've used to run perl-scripting demos from Windoze boxes during SPUG meetings. > > An alternative (or companion) would be to move the site to SourceForge, > which would offer different benefit: > * ability to share site admin duties among multiple admins. > * a superbly equipped staging ground for group code collaborations; > this was discussed at one time, though that was before Vancouver > stole Brian Ingerson, who was the main proponent of the idea. Many of us still think a group coding collaboration would be a fun project, and once a "champion" for that cause comes forward, I'm sure we could make some progress on that front. Any volunteers? Or do we have to wait until Brian (Mr. Inline.pm) comes back from Vancouver? > > -jp > > PS: I'm baaaaaack...! =) I'm back too, from the Database Discovery cruise! ======================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: seattleperl.com | ======================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Jun 21 12:20:02 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: YAPC:Euro; good fares from SEA? Message-ID: <20010621102002.B3397@timji.consultix.wa.com> SPUGsters, Now that my tutorial proposal has been accepted, I suddenly find myself in need of a flight to Amsterdam to attend YAPC::Europe, 8/2-4. Does anybody have advice on economical flights to Amsterdam, or clever ploys to fly to a cheaper nearby city instead (Brussels, London, etc.)? By surfing various web-sites, I've found a non-stop SEA-AMS flight on NorthWest for $1,067, and connecting flights from the high $800s to the low $900s on other airlines. Anything better out there? -Tim P.S. The title of my half-day tutorial is "Minimal Perl for the Impatient", which shows how to write "AWKish" programs (using a Pattern/Action model of selecting data lines for munging) using Perl. I'll also probably be running a public one-day hands-on class of the same name in Kirkland in mid-August, in case anybody's interested. The schedule and pricing will appear on the Consultix web-site once it's finalized. I've attached a description of the tutorial. *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* -------------- next part -------------- TITLE: Minimal Perl for the Impatient Length: 3 hours SPEAKER: Dr. Tim Maher tim@consultix-inc.com Head Software Instructor CONSULTIX, POB 70563, Seattle WA 98107 http://www.consultix-inc.com (206) 781-UNIX/8649 Target Audience Anyone who doesn't already know Perl, needs to do simple data processing, and has a logical mindset can benefit from attending. This tutorial is particularly well suited to individuals of the following types: o Non-Programmers (poets, managers, etc.) who want to do simple data processing tasks, but without learning too much or thinking too hard, and o Programmers who already know a language or two, and want to learn just enough Perl to gain access to some of its special capabilities. Prerequisites Prior experience with programming is helpful, but anyone with a logical mindset can benefit from attending. Course Philosophy Perl is a wonderful language, that offers programmers a rich feature set, huge stylistic and syntactic liberties, and many ways to accomplish the same thing. But for the impatient beginner, these characteristics can translate into "too many complications, too much uncertainty, and too many choices." Although Perl's motto is "There's More Than One Way to Do It", this tutorial will teach students only one way -- the "Easiest Way"! What Attendees Will Learn Students will learn a carefully selected minimal subset of Perl that gives immediate access to some of its powerful capabilities, and serves as a solid foundation for additional learning. The tutorial's approach is based on the "Pattern/Action" model of programming, as featured in the influential AWK language. Upon completion of the tutorial, students will have the necessary skills to convert files, validate data, generate simple reports, and perform numerical calculations in Perl. Author & Instructor (additional biographical details attached at end) During the last two decades, Dr. Tim Maher has taught programming to thousands of high-tech professionals. As a Professor of Computer Science, and later as a Software Instructor for AT&T, Sun, DEC, HP, and CONSULTIX, Dr. Maher has consistently earned acclaim for his highly effective and entertaining style of course development and presentation. From bxs at sdc.cs.boeing.com Thu Jun 21 12:43:46 2001 From: bxs at sdc.cs.boeing.com (Barry Sharp) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: YAPC:Euro; good fares from SEA? Message-ID: <200106211743.KAA00195@calwah.sdc.cs.boeing.com> G'Day Tim: You might find someone who's willing share/sell/give you their transferable frequent flyer miles to help defray your airplane trip expenses. Other suggestions that will require some time/effort for you: 1. Call airlines such as British Airways (BA), SAS, NorthWest and inquire about standby seats and procedures. 2. Try Air Canada/Candian Airlines -- they sometimes have better rates along with their exchange rate. You have option to drive to Vancouver to save some or simply use their shuttle from SeaTac. 3. Sometimes you can get cheaper flights by traveling through a major U.S. airline hub such as Chicago, Denver, Dallas TX, San Fran, etc. Adds several hours to the travel time but if cost is an overriding factor then you benefit by it. 4. Call around and talk with Travel agents and pick their brains about specials :-) 5. Post your inquiry on the Net at several Travel Forums. 6. The other month BA was offering $99 each way to London from New York. The trick here was getting to New York from Seattle for similar cost ;-) 7. Go to SeaTac and pickup an evaluation form from BA's, SAS's desk etc and fill it out and send it in -- sometimes airlines will offer a free trip to people who have had a bad experience with their travels. 8. If you have frequent flyer miles but are just a tad low in meeting your trips mileage requirement you can sometimes 'buy' the difference and still come out ahead. 9. Try flying into UK's Stanstead/Gatwick/Manchester airports -- landing fees and airline overheads are lower at these airports than for Heathrow. Geeeeesh, they're adding runway 5 to Heathrow, so I hear! 10. If there was a bridge/tunnel between Alaska and Russia you could drive your trusty automobile ;-) Mind you, the gasoline costs plus other events might push the cost above using the airlines -- would be an interesting trip though. Hope that helps.... Regards... Barry Sharp > X-Authentication-Warning: gocho.pm.org: majordomo set sender to owner-spug-list@pm.org using -f > Date: Thu, 21 Jun 2001 10:20:02 -0700 > From: Tim Maher/CONSULTIX > To: spug-list@pm.org > Subject: SPUG: YAPC:Euro; good fares from SEA? > > SPUGsters, > > Now that my tutorial proposal has been accepted, I suddenly find myself > in need of a flight to Amsterdam to attend YAPC::Europe, 8/2-4. Does > anybody have advice on economical flights to Amsterdam, or clever ploys to > fly to a cheaper nearby city instead (Brussels, London, etc.)? By surfing > various web-sites, I've found a non-stop SEA-AMS flight on NorthWest for > $1,067, and connecting flights from the high $800s to the low $900s on > other airlines. Anything better out there? > > -Tim > P.S. The title of my half-day tutorial is "Minimal Perl for the Impatient", > which shows how to write "AWKish" programs (using a Pattern/Action model of > selecting data lines for munging) using Perl. I'll also probably be > running a public one-day hands-on class of the same name in Kirkland in > mid-August, in case anybody's interested. The schedule and pricing will > appear on the Consultix web-site once it's finalized. > > I've attached a description of the tutorial. > > *==========================================================================* > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | > | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | > | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | > *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope-spug at jope.net Thu Jun 21 12:54:00 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: <20010621100204.A3397@timji.consultix.wa.com> Message-ID: >> haven't been to a meeting in eons. *gulp!*) > We'll expect to see you again on 8/9, when Damian makes his next visit! 8-} Sorry, unavoidable conflict precluded attending Colin's talk. =( But I did hype the hell out of it to my co-workers. =) >> Is there any reason not to move it to the pm.org server? Consistency >> with the other PM's aside, that server has mod_perl, which I'm guessing >> Halcyon's server does not. =) > > Since we're not running any Perl scripts from the site currently, > mod_perl hasn't become an issue. And despite our PM membership, > full consistency with other PM groups (which came along after > our founding, and "naming") has never been a SPUG priority > (as indicated by our retention of our original name). Moreover, > there are advantages to maintaining our relationship with halcyon; > e.g., they provide dial-up shell-accounts, which on occasion > we've used to run perl-scripting demos from Windoze boxes during > SPUG meetings. I'm not suggesting this as an either-or. Is there any reason that we couldn't keep the Halcyon account, even if we move part or all of the site to the pm.org server? Hell, at very least put a redirect in place from seattle.pm.org. The consistency angle that I mentioned was simply from the perspective of seattle.pm.org being an easier URL to remember; I wasn't suggesting a need to more tightly integrate our organizational strucure with PM as a whole. The fact that we're not running any perl on the site right now is a chicken-and-egg problem if Halcyon doesn't offer the ability do so. And even if they do offer it, why shouldn't we evolve? Our site should be glowing masterpiece! A paragon of perlocity shining in the distance! A fully interactive extravaganza that can cream you in a game of chess! (well, maybe that part's a bit much) If we still want to use a Halcyon dial-up for demos, great, but that is a distinct issue from where the site resides. The mailing list is already elsewhere, so "everything must be in the same place" is not an excuse. > Or do we have to wait until Brian (Mr. Inline.pm) comes back > from Vancouver? He's coming back? Burly! -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From djames at serv.net Thu Jun 21 13:28:10 2001 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: YAPC:Euro; good fares from SEA? In-Reply-To: <20010621102002.B3397@timji.consultix.wa.com>; from Tim Maher/CONSULTIX on Thu, Jun 21, 2001 at 10:20:02AM -0700 References: <20010621102002.B3397@timji.consultix.wa.com> Message-ID: <20010621112810.A92686@itchy.serv.net> On Thu, Jun 21, 2001 at 10:20:02AM -0700, Tim Maher/CONSULTIX wrote: > Now that my tutorial proposal has been accepted, I suddenly find myself > in need of a flight to Amsterdam to attend YAPC::Europe, 8/2-4. Does > anybody have advice on economical flights to Amsterdam, or clever ploys to > fly to a cheaper nearby city instead (Brussels, London, etc.)? By surfing > various web-sites, I've found a non-stop SEA-AMS flight on NorthWest for > $1,067, and connecting flights from the high $800s to the low $900s on > other airlines. Anything better out there? That seems hard to believe. I read Frommer's travel newsletter every day (http://www.frommers.com/newsletters/today/contents.html) and there are constant mentions of deals this summer to Europe. There's bookings to Manchester right now for around $350 on US Airways (granted, that's for July), and www.go-today.com is offering packages (car and air) to Amsterdam for under $800 (unfortunately, for September). My point (and this is all way off topic for the list, so I apologize) is that, if there are such good deals in July and September, there must be something reasonable for August. I've also heard nothing bad bad things about Northwest. I'd take a transfer at Heathrow or JFK to avoid them. I'd suggest checking out a consolidator (www.tiss.com is one) or contacting (gasp) a travel agent. They should be able to do much better than what you're finding. Dan (computer programmer/travel agent wannabe) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From djames at serv.net Thu Jun 21 13:30:04 2001 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: YAPC:Euro; good fares from SEA? In-Reply-To: <20010621102002.B3397@timji.consultix.wa.com>; from Tim Maher/CONSULTIX on Thu, Jun 21, 2001 at 10:20:02AM -0700 References: <20010621102002.B3397@timji.consultix.wa.com> Message-ID: <20010621113004.B92686@itchy.serv.net> On Thu, Jun 21, 2001 at 10:20:02AM -0700, Tim Maher/CONSULTIX wrote: > SPUGsters, P.S. Just FYI, it's approximately $90 and as many minutes on train from Paris to Amsterdam. Less of course from Brussels. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From brian at tangent.org Thu Jun 21 14:11:24 2001 From: brian at tangent.org (Brian Aker) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter References: <20010621100204.A3397@timji.consultix.wa.com> Message-ID: <3B3246DC.AD5FAD3C@tangent.org> Tim Maher/CONSULTIX wrote: > > The front page of the SPUG site is a badly cluttered with old meeting > > blurbs, going back over twelve months. It would be a good idea to move > > those to a separate page, and just link from a description-less table > > of contents on the front page, if not just from a single link. > > Agreed! And that matter is being addressed, albeit slowly. I am willing to invest some time in getting up a slash site if Spug would like to having something similar to use.perl.org (or a similar site for announcing local stuff). -Brian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cmeyer at helvella.org Thu Jun 21 14:59:07 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: Intro to DBI slides Message-ID: <20010621125907.B26785@hobart.helvella.org> SPUGsters, You can view the notes to the talk I gave the other evening at: http://helvella.org/intro_dbi/ I took a little time this morning to modify the sample program so that it uses DBI's Taint mode to be more secure. Have fun, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dcd at tc.fluke.com Thu Jun 21 15:15:27 2001 From: dcd at tc.fluke.com (David Dyck) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: <3B3246DC.AD5FAD3C@tangent.org> Message-ID: I haven't been following this a closely as I should have, but with the NWNexus/Winstar merger, and Winstar's bankruptcy, and dial-up Internet access accounts being transfered to EarthLink I'd suggest looking elsewhere for a web page for SPUG. see http://www.winstartechcenter.com/earthlink_faq.htm. On Thu, 21 Jun 2001, Brian Aker wrote: > > Tim Maher/CONSULTIX wrote: > > > The front page of the SPUG site is a badly cluttered with old meeting > > > blurbs, going back over twelve months. It would be a good idea to move > > > those to a separate page, and just link from a description-less table > > > of contents on the front page, if not just from a single link. > > > > Agreed! And that matter is being addressed, albeit slowly. > I am willing to invest some time in getting up a slash site if > Spug would like to having something similar to use.perl.org > (or a similar site for announcing local stuff). > > -Brian > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Thu Jun 21 16:17:13 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter Message-ID: <200106212117.OAA18514@catmanor.com> > >I haven't been following this a closely as I should have, >but with the NWNexus/Winstar merger, and >Winstar's bankruptcy, and dial-up Internet >access accounts being transfered to EarthLink >I'd suggest looking elsewhere for a web page >for SPUG. > A lot of people have been going over to drizzle.com. They are one of the few ISs that allow shell access. Also, for a "hosting account they are a lot cheaper than halcyon. Their is a possibility that Ralph Sims may retain ownership of the halcyon domain. He said he was thinking of setting it up to do web and email forwarding. Currently, the discussions are in "halcyon.general". To continue the discussions after, they have setup a "halcyon refugees" egroup at yahoo. http://groups.yahoo.com/group/halcyonrefugees William - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope-spug at jope.net Thu Jun 21 16:58:47 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: Message-ID: Oh wow, that transition happens a week from now. And complimentary accounts are getting the boot, unless you can convince Earthlink to give you a similar deal, but I wouldn't count on it. If you're determined to have a freebie, might try Speakeasy or ZipNet, they're both perl-friendly. (heck, Speakeasy at one point offered to host our meetings in their now-incinerated cafe backroom) -jp On Thu, 21 Jun 2001, David Dyck wrote: > but with the NWNexus/Winstar merger, and Winstar's bankruptcy, > and dial-up Internet access accounts being transfered to EarthLink > I'd suggest looking elsewhere for a web page for SPUG. > > see http://www.winstartechcenter.com/earthlink_faq.htm. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Jun 21 16:57:15 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: ; from El JoPe Magnifico on Thu, Jun 21, 2001 at 02:58:47PM -0700 References: Message-ID: <20010621145715.B13384@timji.consultix.wa.com> On Thu, Jun 21, 2001 at 02:58:47PM -0700, El JoPe Magnifico wrote: > Oh wow, that transition happens a week from now. > And complimentary accounts are getting the boot, > unless you can convince Earthlink to give you a > similar deal, but I wouldn't count on it. If you're > determined to have a freebie, might try Speakeasy or > ZipNet, they're both perl-friendly. (heck, Speakeasy > at one point offered to host our meetings in their > now-incinerated cafe backroom) I remember that offer, and posted a note here about how that dreary, stinky, decrepit dungeon of a back-room wasn't fit for human occupancy. I'm sorry it got scorched, but it's reassuring to feel vindicated in my judgment 8-} -Tim ======================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: seattleperl.com | ======================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cmeyer at helvella.org Thu Jun 21 19:06:03 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: References: Message-ID: <20010621170603.B27956@hobart.helvella.org> SPUGsters, Dan Pewzner and Zipcon.net have offered to host the SPUG webpage for free. I am in the process of setting up an account with webspace. This should include a shell account. Zipcon.net is a local ISP that has been in existence for about seven years. They run on Linux and make much use of Perl. Dan runs a great ISP. In the past he has installed Perl modules from CPAN at my request (typically in a less than 48 hour turn around time) and has upgraded the Perl binary. I highly recommend Zipcon's services. -C. On Thu, Jun 21, 2001 at 02:58:47PM -0700, El JoPe Magnifico wrote: > Oh wow, that transition happens a week from now. > And complimentary accounts are getting the boot, > unless you can convince Earthlink to give you a > similar deal, but I wouldn't count on it. If you're > determined to have a freebie, might try Speakeasy or > ZipNet, they're both perl-friendly. (heck, Speakeasy > at one point offered to host our meetings in their > now-incinerated cafe backroom) > -jp > > On Thu, 21 Jun 2001, David Dyck wrote: > > but with the NWNexus/Winstar merger, and Winstar's bankruptcy, > > and dial-up Internet access accounts being transfered to EarthLink > > I'd suggest looking elsewhere for a web page for SPUG. > > > > see http://www.winstartechcenter.com/earthlink_faq.htm. > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cmeyer at helvella.org Thu Jun 21 20:09:53 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: site clutter In-Reply-To: <20010621170603.B27956@hobart.helvella.org> References: <20010621170603.B27956@hobart.helvella.org> Message-ID: <20010621180953.H27956@hobart.helvella.org> The SPUG website is now available at: http://zipcon.net/spug/ -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mkorb at versuslaw.com Thu Jun 21 18:52:26 2001 From: mkorb at versuslaw.com (Martin Korb) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: sql select on the fly Message-ID: <013601c0faad$3994c070$9501a8c0@versuslaw.com> I have a question concerning creating a sql-select statement on the fly. The user has a choice of any combination of 4 fields (either one or all 4). What is an elegant way to create a sql - select query based on the fields the user fills out. my $file = param(Filename); my $author = param(Author); my $date = param(Date); my $select_query = "Select * from table where filename =\'$file\' and author =\'$author\'"; ##### I know I an do it in a round about way by using if ($file) { push @array, "filename =\'$file\' and "; } and then do a join on the @array elements. Are there better ways to handle this? Thanks Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010621/2014da6e/attachment.htm From chris at chriskate.net Thu Jun 21 21:40:48 2001 From: chris at chriskate.net (Chris Sutton) Date: Wed Aug 4 00:08:06 2004 Subject: SPUG: sql select on the fly In-Reply-To: <013601c0faad$3994c070$9501a8c0@versuslaw.com> Message-ID: push @array, "filename='$file'" if ($file); push @array, "author='$author'" if ($author); push @array, "date='$date'" if ($date); # Just join to add the "and" between elements # that way if there is only one element, you don't get # any ands, you just get the one where clause $where = join " and ", @array; # Make sure something is in where if ($where) { $select_query = "select * from table where $where"; } else { print "No where information"; } You also want to make sure and dbi->quote the information going into the where, as something like Author="o'dea" will turn into author='o'dea' which will hoze everything. On Thu, 21 Jun 2001, Martin Korb wrote: > > I have a question concerning creating a sql-select statement on the fly. > > The user has a choice of any combination of 4 fields (either one or all 4). What is an elegant way to create a sql - select query based on the fields the user fills out. > > my $file = param(Filename); > my $author = param(Author); > my $date = param(Date); > > my $select_query = "Select * from table where filename =\'$file\' and author =\'$author\'"; > > > ##### I know I an do it in a round about way by using > > if ($file) { > push @array, "filename =\'$file\' and "; > } > > and then do a join on the @array elements. > > > Are there better ways to handle this? > > Thanks > > Martin > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jimfl at colltech.com Thu Jun 21 22:46:03 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: sql select on the fly In-Reply-To: Message-ID: <2440248.3202145163@[192.168.1.101]> --Also Sprache Chris Sutton On Thursday, June 21, 2001 7:40 PM -0700: > You also want to make sure and dbi->quote the information going into > the where, as something like Author="o'dea" will turn into > author='o'dea' which will hoze everything. If you use binding, then you don't have to worry so much about quoting. Here's an example where you have the params in a hash called %params: @columns = keys %params; $where = 'WHERE ' . join(' AND ', map {"$_ = ?"} @columns); $sth = $dbh->do(qq(SELECT * from table $where), undef, @params{@columns}); The $where string will look like 'filename = ? AND date = ?'. -- Jim Flanagan Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Fri Jun 22 14:42:06 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: YAPC:Euro; good fares from SEA? Message-ID: You might also want to look at the "Airline Ticket Consolidators and Bucket Shops FAQ" at http://www.travel-library.com/air-travel/consolidators.html Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Fri Jun 22 15:24:24 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: YAPC:Euro; good fares from SEA? In-Reply-To: ; from JALIS,ASIM (HP-FtCollins,ex1) on Fri, Jun 22, 2001 at 12:42:06PM -0700 References: Message-ID: <20010622132424.A26679@timji.consultix.wa.com> On Fri, Jun 22, 2001 at 12:42:06PM -0700, JALIS,ASIM (HP-FtCollins,ex1) wrote: > You might also want to look at the "Airline Ticket Consolidators and Bucket > Shops FAQ" > at http://www.travel-library.com/air-travel/consolidators.html Thanks to all for their helpful tips, but unfortunately I'm already thoroughly familiar with all the ins and outs of airline travel. There just aren't any reasonable fares to Amsterdam (or London, Antwerp, Brussels, or Copenhagen, etc.) to be had from Seattle these days, AFAIK. I'll be paying $908 for two tickets later today, which is the best fare I've been able to find on a real airline with a decent schedule, unless somebody has info on a substantially cheaper option. (And please don't send me any more FAQs, I'm dealing with Reality, not Theory, at this point! 8-} ). *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Fri Jun 22 19:03:14 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: site clutter References: <20010621170603.B27956@hobart.helvella.org> <20010621180953.H27956@hobart.helvella.org> Message-ID: <001401c0fb77$e894a6b0$2d88ddd1@aciwin> If this is the new official SPUG web site, should the page http://www.halcyon.com/spug/ be replaced by a forwarding page that has a message advising people to update their bookmarks? Cheers, Richard ----- Original Message ----- From: "Colin Meyer" To: Sent: Thursday, June 21, 2001 6:09 PM Subject: Re: SPUG: site clutter > The SPUG website is now available at: > > http://zipcon.net/spug/ > > -C. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tgregory at tarjema.com Fri Jun 22 19:06:58 2001 From: tgregory at tarjema.com (Timothy A. Gregory) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Socket daemons Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm sure I'm missing something very simple here, please point it out to me ;-) I've written a small script that I want to have sit listening to a port and stay there. If a connection comes in it will process the data (an XML stream to be stuffed into a database). Right now it quits at that point, but I want it to stay running so the 10 other clients trying to send it XML reports will have someone to talk to. listener.pl: #!/usr/bin/perl -w use strict; use IO::Socket; use DBI; use XML::XPath; my $server = IO::Socket::INET->new( Listen => 10, LocalAddr => '192.168.1.222', LocalPort => 8888, ReuseAddr => 1, Proto => 'tcp' ) or die "Can't create server socket $!\n"; my $client = $server->accept; my $xp = XML::XPath->new(ioref => $client); my $dbh = DBI->connect('dbi:mysql:mon', 'monitor', 'sillypass') or die $DBI::errstr; my $sth = $dbh->prepare(qq{INSERT INTO stats VALUES (?, ?, ?, ?, ?, ?)}); foreach my $row ($xp->findnodes('/semaphore:net/output')) { my $cust_name = $row->find('cust_name')->string_value; my $host_name = $row->find('host_name')->string_value; my $ip_addr = $row->find('ip_addr')->string_value; my $up_down = $row->find('up_down')->string_value; my $pmin = $row->find('pmin')->string_value; my $pmax = $row->find('pmax')->string_value; $sth->execute($cust_name, $host_name, $ip_addr, $up_down, $pmin, $pmax) || die $DBI::errstr; } Thanks! - --tag +--------------------------------------------------+ | Timothy A. Gregory http://www.tarjema.com | | *NIX SysAdmin tgregory@tarjema.com | | Arabic > English Translator IBM AIX CATE | +--------------------------------------------------+ Habit is habit and not to be flung out of the window by any man, but coaxed downstairs a step at a time. - --Mark Twain -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7M92of+LtXvUUOyoRApSHAJoCKT/30TCpKVxCD9FZ7/wLmQq7iACgilqU a+N8d9DaNKWKobo+rprXKf0= =Av0r -----END PGP SIGNATURE----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tgregory at tarjema.com Fri Jun 22 19:32:36 2001 From: tgregory at tarjema.com (Timothy A. Gregory) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Socket daemons In-Reply-To: Message-ID: I was missing something simple, and I found it - I just did this: while ($client = $server->accept()) { &process } and put all the XML stuff in sub process { ... } been a long week. --tag On Fri, 22 Jun 2001, the heavens parted and Timothy A. Gregory said: > I'm sure I'm missing something very simple here, please point it out to me > ;-) > > I've written a small script that I want to have sit listening to a port > and stay there. If a connection comes in it will process the data (an XML > stream to be stuffed into a database). Right now it quits at that point, > but I want it to stay running so the 10 other clients trying to send it > XML reports will have someone to talk to. > > listener.pl: > > #!/usr/bin/perl -w > use strict; > use IO::Socket; > use DBI; > use XML::XPath; > > my $server = IO::Socket::INET->new( > Listen => 10, > LocalAddr => '192.168.1.222', > LocalPort => 8888, > ReuseAddr => 1, > Proto => 'tcp' > ) or die "Can't create server socket $!\n"; > > my $client = $server->accept; > > my $xp = XML::XPath->new(ioref => $client); > > my $dbh = DBI->connect('dbi:mysql:mon', 'monitor', 'sillypass') > or die $DBI::errstr; > > my $sth = $dbh->prepare(qq{INSERT INTO stats VALUES (?, ?, ?, ?, ?, ?)}); > > foreach my $row ($xp->findnodes('/semaphore:net/output')) { > my $cust_name = $row->find('cust_name')->string_value; > my $host_name = $row->find('host_name')->string_value; > my $ip_addr = $row->find('ip_addr')->string_value; > my $up_down = $row->find('up_down')->string_value; > my $pmin = $row->find('pmin')->string_value; > my $pmax = $row->find('pmax')->string_value; > > $sth->execute($cust_name, $host_name, $ip_addr, $up_down, $pmin, $pmax) > || die $DBI::errstr; > > } > > Thanks! > > --tag > > > > +--------------------------------------------------+ > | Timothy A. Gregory http://www.tarjema.com | > | *NIX SysAdmin tgregory@tarjema.com | > | Arabic > English Translator IBM AIX CATE | > +--------------------------------------------------+ > Habit is habit and not to be flung out of the window by any man, but > coaxed downstairs a step at a time. > --Mark Twain > ------------ Output from gpg ------------ > gpg: Good signature from "Timothy A. Gregory " > > +--------------------------------------------------+ | Timothy A. Gregory http://www.tarjema.com | | *NIX SysAdmin tgregory@tarjema.com | | Arabic > English Translator IBM AIX CATE | +--------------------------------------------------+ Habit is habit and not to be flung out of the window by any man, but coaxed downstairs a step at a time. --Mark Twain - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cjcollier at sinclair.net Sat Jun 23 08:59:55 2001 From: cjcollier at sinclair.net (C.J. Collier) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: sql select on the fly References: <013601c0faad$3994c070$9501a8c0@versuslaw.com> Message-ID: <3B34A0DB.10C89C5E@sinclair.net> Martin, I always did something like the following: #the Vars() function, which returns the params as a hash, is in cgi-lib use CGI qw(:standard :cgi-lib); ... my %params = Vars(); my $select = "SELECT ... "; my $from = "FROM ... "; # set up where statement with '?' as placeholder my $where = "WHERE" . join(" AND ", map{ "$_ = ?" } sort keys %params) . " "; my $order = "ORDER BY ..."; my $query = $select . $from . $where . $order; my $sth = $dbh->prepare($query); # fill in the place-holders with the values of the params hash $sth->execute(values(@params{ sort keys %params })); EOF But note that Vars() doesn't grok multi-valued params, like check boxes or scrolling_list. C.J. Martin Korb wrote: > I have a question concerning creating a sql-select statement on the > fly. The user has a choice of any combination of 4 fields (either one > or all 4). What is an elegant way to create a sql - select query based > on the fields the user fills out. my $file = param(Filename);my > $author = param(Author);my $date = param(Date); my $select_query = > "Select * from table where filename =\'$file\' and author > =\'$author\'"; ##### I know I an do it in a round about way by > using if ($file) { push @array, "filename =\'$file\' and ";} and > then do a join on the @array elements. Are there better ways to > handle this? Thanks Martin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jeff at neobase.com Sat Jun 23 10:32:32 2001 From: jeff at neobase.com (jeff) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: sql select on the fly In-Reply-To: <3B34A0DB.10C89C5E@sinclair.net> Message-ID: On Sat, 23 Jun 2001, C.J. Collier wrote: > use CGI qw(:standard :cgi-lib); > ... > my %params = Vars(); > my $select = "SELECT ... "; > my $from = "FROM ... "; > # set up where statement with '?' as placeholder > my $where = "WHERE" . join(" AND ", map{ "$_ = ?" } sort keys %params) . > " "; You should probably add ' grep { !/cgi|params|you|want|to|ignore/ } ' between sort and map. > my $order = "ORDER BY ..."; > my $query = $select . $from . $where . $order; > my $sth = $dbh->prepare($query); > > # fill in the place-holders with the values of the params hash > $sth->execute(values(@params{ sort keys %params })); > EOF > > But note that Vars() doesn't grok multi-valued params, like check boxes > or scrolling_list. Vars() returns a string with "\0" between each value in a multi value param. You can separate them by: my @values = split "\0", $param; Jeff > C.J. > > Martin Korb wrote: > > > I have a question concerning creating a sql-select statement on the > > fly. The user has a choice of any combination of 4 fields (either one > > or all 4). What is an elegant way to create a sql - select query based > > on the fields the user fills out. my $file = param(Filename);my > > $author = param(Author);my $date = param(Date); my $select_query = > > "Select * from table where filename =\'$file\' and author > > =\'$author\'"; ##### I know I an do it in a round about way by > > using if ($file) { push @array, "filename =\'$file\' and ";} and > > then do a join on the @array elements. Are there better ways to > > handle this? Thanks Martin > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sun Jun 24 01:46:50 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: July Meeting: Instant Perl! Message-ID: <20010623234650.A7417@timji.consultix.wa.com> SPUGmongers, I've just received confirmation that the tutorial I submitted for the August Perl conference in Amsterdam (YAPC::Europe) was accepted. It's consistent with the "Beginner's Night" orientation of the July meeting, and I'll be happy for the opportunity to practice it, so I've volunteered as the July speaker. A description of the talk is included below, and the same info is available at the new SPUG web-site (http://www.zipcon.net/spug). Many thanks to SPUG's Colin Meyer and the folks at Zipcon.net for making the transition from Winstar NorthWest Nexus to the new host so easy! -Tim ======================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: seattleperl.com | ======================================================== -------------- next part -------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - JULY SPUG TALK Title: Minimal Perl for the Impatient Speaker: Tim Maher Head Software Instructor, CONSULTIX POB 70563, Seattle WA 98107 tim@consultix-inc.com http://www.consultix-inc.com (206) 781-UNIX/8649 Time: July 17th, 2001 (Third Tuesday), 7pm-9pm Location: Union Bank of Cal., Madison & 5th, 5th Floor Mtg Room Cost: Free! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Target Audience Anyone who doesn't already know Perl, needs to do simple data processing, and has a logical mindset can benefit from attending. This tutorial is particularly well suited to individuals of the following types: o Non-Programmers (poets, managers, etc.) who want to do simple data processing tasks, but without learning too much or thinking too hard, and o Programmers who already know a language or two, and want to learn just enough Perl to gain access to some of its special capabilities. Prerequisites Prior experience with programming is helpful, but anyone with a logical mindset can benefit from attending. Course Philosophy Perl is a wonderful language, that offers programmers a rich feature set, huge stylistic and syntactic liberties, and many ways to accomplish the same thing. But for the impatient beginner, these characteristics can translate into "too many complications, too much uncertainty, and too many choices." Although Perl's motto is "There's More Than One Way to Do It", this tutorial will teach students only one way -- the "Easiest Way"! What Attendees Will Learn Students will learn a carefully selected minimal subset of Perl that gives immediate access to some of its powerful capabilities, and serves as a solid foundation for additional learning. The tutorial's approach is based on the "Pattern/Action" model of programming, as featured in the influential AWK language. Upon completion of the tutorial, students will have the necessary skills to convert files, validate data, generate simple reports, and perform numerical calculations in Perl. Author & Instructor During the last two decades, Dr. Tim Maher has taught programming to thousands of high-tech professionals. As a Professor of Computer Science, and later as a Software Instructor for AT&T, Sun, DEC, HP, and CONSULTIX, Dr. Maher has consistently earned acclaim for his highly effective and entertaining style of course development and presentation. From tim at consultix-inc.com Sun Jun 24 11:09:09 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: web page contractor needed Message-ID: <20010624090909.H11759@timji.consultix.wa.com> Hi... I have a web site that needs some basic features added and a few problems within the existing site taken care of. I also would also like for that individual to be available for consent updates and additions to my site. Need someone ASAP! Thanks. aspen@bigplanet.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jason at strangelight.com Mon Jun 25 14:45:57 2001 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: site clutter In-Reply-To: <200106212117.OAA18514@catmanor.com> References: <200106212117.OAA18514@catmanor.com> Message-ID: At 2:17 PM -0700 6/21/01, William Julien wrote: > > >>I haven't been following this a closely as I should have, >>but with the NWNexus/Winstar merger, and >>Winstar's bankruptcy, and dial-up Internet >>access accounts being transfered to EarthLink >>I'd suggest looking elsewhere for a web page >>for SPUG. >> > >A lot of people have been going over to drizzle.com. A word of warning: drizzle's tech people don't entirely know what they're doing. E.g. they've set up their site so that users' CGI scripts run with the same UID as the web server(!), *not* as the user who owns the account. Not only that, but when I called up to complain, it took me rather a long time to explain to their Unix "guru" why this as a Bad Thing. They set up this really annoying kludge just for my account (all my scripts have to be called via a URL like http://www.mydomain.org/cgi-bin/cgiwrap/myusername/myscript.cgi ), but AFAIK everyone else's CGIs are still running as the web server. -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Mon Jun 25 16:59:22 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Perl Conference Update,Discount Extended Message-ID: <20010625145922.A26527@timji.consultix.wa.com> FYI, for those who don't already know all about this. -Tim ======================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: seattleperl.com | ======================================================== Fueling the Open Source Alternative O'Reilly Open Source Convention Sheraton San Diego Hotel & Marina, San Diego, CA July 23-27, 2001 EARLY REGISTRATION EXTENDED ONE WEEK ONLY! SAVE UP TO $400 WHEN YOU REGISTER BY MONDAY, JULY 2 CONVENTION UPDATE Preview: O'Reilly XTech 2001 Conference on XML-- The conference chair, Edd Dumbill, previews O'Reilly's XTech 2001 Conference, the essential meeting for XML developers. http://www.xml.com/pub/a/2001/06/20/xtech2001.html Microsoft's Mundie Added as Keynote Speaker-- Microsoft Senior Vice President Craig Mundie and Red Hat CTO Michael Tiemann set the stage for a wide-open keynote and panel discussion about Microsoft's Shared Source program and the response from the open source community, when they square off in this shared source vs. open source debate. http://conferences.oreilly.com/oscon/ ====================================== Register Now! Save up to $400 when you register before July 2! http://conferences.oreilly.com/oscon/ ====================================== ALSO ADDED Complimentary Subscription to Dr. Dobb's Journal -- Open Source Convention media sponsor Dr. Dobb's Journal has graciously offered a year's complimentary subscription to DDJ when you register! Already have a subscription? DDJ will add a year onto your current subscription! Register today http://conferences.oreillynet.com/cs/os2001/create/ord_os01 Special Screening of Open Source Film -- Come see Revolution OS, a documentary that chronicles the Open Source movement (free shuttle bus to and from the theater). The movie screens at 8:00 pm. The filmmaker, J.T.S. Moore will be on hand for a pre and post show talk. (Sponsored by Hewlett Packard). CONVENTION DETAILS The 3rd annual O'Reilly Open Source Convention, July 23-27, 2001, at the waterfront Sheraton Hotel and Marina in San Diego, California. This year's convention offers over 250 sessions in 16 tracks including Perl, Apache, XML, Python, PHP, MySQL, Linux, just to name a few. If you're a hard-core system administrator, programmer, or Web developer, you'll learn to understand, code, and manage these powerful tools. Whatever you're looking for is most likely here. Why attend the O'Reilly Open Source Convention? Get the latest and the deepest information on what's new in open source software --Read Tim O'Reilly's reasons why Open Source is Here to Stay. http://conferences.oreilly.com/oscon/tim_letter.html Make or renew professional contacts, network with industry colleagues, add new technologies to your resume--Check out the Convention schedule. http://conferences.oreilly.com/oscon/ Vacation with the family in beautiful San Diego -- We've added new events and services to make it easy for you to attend the Convention and safe for your family to enjoy San Diego. http://conferences.oreillynet.com/cs/os2001/pub/10/see_do.html Attendee Community Board - Logon and join other attendees in discussions about the many See & Do activities at the Open Source Convention. Learn about the O'Reilly sponsored children's program at Kid's World, San Diego sites and attractions and more. http://conferences.oreilly.com/oscon/board/ ====================================== Receive a free T-Shirt save up to $400 when you register before July 2 -- Register Today! http://conferences.oreillynet.com/cs/os2001/create/ord_os01 ====================================== Program Highlights The Perl Conference 5--Where else can you get together with Perl hackers, learn something useful, have fun, and change the world? The Camel is back, this time in San Diego. http://conferences.oreilly.com/perl/ O'Reilly XTech2001 Conference (New this year, in association with Graphic Communications Association)--The O'Reilly XTech2001 Conference is the perfect setting for a serious technical discussion between XML developers. http://conferences.oreilly.com/xml/ PHP Conference--The first ever PHP Conference brings the community together for sessions and tutorials designed to explore and strengthen PHP in the open source space. http://conferences.oreillynet.com/cs/os2001/pub/w/os2001/sessions_php.html http://conferences.oreillynet.com/cs/os2001/pub/10/php_tutorials.html The O'Reilly Summit on Open Source Strategies-- Collocated at this year's Open Source Convention this strategic summit explores the best practices in collaborative software development, allowing any organization to utilize widely distributed network resources. This conference is for technical managers and technology executives and examines innovative, open solutions to business problems. http://conferences.oreilly.com/summit/ ====================================== Register Now! Visit http://conferences.oreilly.com/oscon/ for information on what to do in and around sunny San Diego--Save up to $400 when you register before July 2! ====================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Mon Jun 25 19:49:45 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: site clutter In-Reply-To: Mail from 'Jason Lamport ' dated: Mon, 25 Jun 2001 12:45:57 -0700 Message-ID: <200106260049.RAA22728@catmanor.com> > >A word of warning: drizzle's tech people don't entirely know what >they're doing. E.g. they've set up their site so that users' CGI >scripts run with the same UID as the web server(!), *not* as the user >who owns the account. Not only that, but when I called up to >complain, it took me rather a long time to explain to their Unix >"guru" why this as a Bad Thing. Hmmm. Can you explain why it is a "Bad Thing" to have your server running as user "nobody" and group "nobody"? It would seem to me, that this would provide better security for the system if you ran scripts as an unprivlidged user. If your cgi scripts were run under setuid, a poorly written script can gain access to files (owned by them) that were not explicily permitted by the owner as world write. You can configure apache to run scripts as setuid. It is an option availble within apache (I understand it is configurable on a per-file basis via the setgid bit). But I would consider that a "Bad Thing" for the general security of the system unless you are very careful how you set it up. Apache provides strong warnings regarding this. > >They set up this really annoying kludge just for my account (all my >scripts have to be called via a URL like >http://www.mydomain.org/cgi-bin/cgiwrap/myusername/myscript.cgi ), >but AFAIK everyone else's CGIs are still running as the web server. This is simular to how the apache suexec program works. By default, and for good reason, this facility is not configured within the apache server. See.... http://httpd.apache.org/docs/suexec.html Generally, I have found the security measures on drizzle to be much more advanced than on halcyon. Their tech support did need help with the "chsh" command, but I simply pointed them to the man page. By default, this command is suid and I would have changed my own shell. But they removed the suid root bit to chsh. A Good Thing. They run "nobody" as uid 140 and gid 99. This enhances the security since intruders have to guess the "nobody" uid/gid. Sendmail runs as "nobody", as does portmapper and several other facilities. On their web server, validation is done via a nis server and the passwd files do not contain a list of the valid userids. They have locked up /home so that one can only see your own files. I'm afraid, I have to disagree. Drizzle is the most secure server I have seen to date (This includes the ones I maintain). Halcyon is much more permissive. For example, they allow cgi scripts to be located within your document root (cgi-pvt). A "Bad Thing". --- William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jason at strangelight.com Mon Jun 25 23:54:55 2001 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security (was: site clutter) In-Reply-To: <200106260049.RAA22728@catmanor.com> References: <200106260049.RAA22728@catmanor.com> Message-ID: At 5:49 PM -0700 6/25/01, William Julien wrote: > > >>A word of warning: drizzle's tech people don't entirely know what >>they're doing. E.g. they've set up their site so that users' CGI >>scripts run with the same UID as the web server(!), *not* as the user >>who owns the account. Not only that, but when I called up to >>complain, it took me rather a long time to explain to their Unix >>"guru" why this as a Bad Thing. > >Hmmm. Can you explain why it is a "Bad Thing" to have your server >running as user "nobody" and group "nobody"? It would seem to me, that >this would provide better security for the system if you ran scripts >as an unprivlidged user. If your cgi scripts were run under setuid, >a poorly written script can gain access to files (owned by them) that >were not explicily permitted by the owner as world write. The problem with running CGI scripts as "nobody" is that any files that your scripts can access can also be accessed by any other user on the system. If you're running your own dedicated web server, this isn't a problem; but in a multi-user, virtual-server setup like drizzle's this is a big problem. If a script runs as setuid, then I can make files accessible to that script while hiding those files from other users. This is a Good Thing. If a script runs as "nobody," then in order to have my script read from a file (such as a password file, for example) I have to make that file world-readable; and if the script needs to write to a file, then I need to make that file world-writable. These are Bad Things. > >Halcyon is much more permissive. For example, they allow cgi scripts to >be located within your document root (cgi-pvt). A "Bad Thing". > Now I have a question: why is allowing CGI scripts in the document root a "Bad Thing"? Most providers I've used allow this, and I personally find it very convenient: it allows me to put scripts where they belong logically in the site hierarchy rather than off in a cgi-bin directory, and lets me create prettier URLs. (One favorite trick of mine is to use index.cgi files to create "extensionless" URLs: http://www.foo.com/bar/index.cgi can be accessed as simply http://www.foo.com/bar/ ) -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From torin at daft.com Tue Jun 26 00:15:52 2001 From: torin at daft.com (Darren/Torin/Who Ever...) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: site clutter In-Reply-To: <200106260049.RAA22728@catmanor.com> References: <200106260049.RAA22728@catmanor.com> Message-ID: <873d8n254n.fsf@perv.daft.com> William Julien, in an immanent manifestation of deity, wrote: >Hmmm. Can you explain why it is a "Bad Thing" to have your server >running as user "nobody" and group "nobody"? It would seem to me, that >this would provide better security for the system if you ran scripts >as an unprivlidged user. If your cgi scripts were run under setuid, >a poorly written script can gain access to files (owned by them) that >were not explicily permitted by the owner as world write. So, if User A runs his scripts as "nobody" and User B runs her scripts as "nobody", what could User A do to User B? Darren -- Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-206-ELF-LIPZ @ @ @ Unix Sys-Admin / Perl Guru / C expert for hire @ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From kenslinux at home.com Tue Jun 26 00:45:30 2001 From: kenslinux at home.com (Ken Clarke) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: setuid & CGI security (was: site clutter) References: <200106260049.RAA22728@catmanor.com> Message-ID: <003a01c0fe03$360aac40$94c54618@gv.shawcable.net> ----- Original Message ----- From: "Jason Lamport" To: Sent: June 25, 2001 9:54 PM Subject: SPUG: setuid & CGI security (was: site clutter) > If a script runs as "nobody," then in order to have my script > read from a file (such as a password file, for example) I have to > make that file world-readable; and if the script needs to write to a > file, then I need to make that file world-writable. These are Bad > Things. I tried to explain this very thing to a tech support guy recently, but he just got mad at me, saying "Having a world writable setting on the directory is perfectly fine, you needn't worry about system attacks with that setting on this server. There should not be any further discussion of this topic." He probably got mad because I asked him to ask a sys admin before allow me to do this. Guess he WAS the sys admin! # Ken Clarke # Web Programmer / E-commerce Technologist - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From smorton at pobox.com Tue Jun 26 01:35:42 2001 From: smorton at pobox.com (Sanford Morton) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: site clutter In-Reply-To: <873d8n254n.fsf@perv.daft.com> Message-ID: On 25 Jun 2001, Darren/Torin/Who Ever... wrote: > > So, if User A runs his scripts as "nobody" and User B runs her scripts > as "nobody", what could User A do to User B? > Almost anything, edit files, remove files, compile source, run a perl debugger interactively. A couple of references: http://www.speakeasy.org/~cgires/exec.html http://www.speakeasy.org/~cgires/modules/ (see cgidebug.pl) I have frequently found these tools to be quite helpful, though also scary. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Tue Jun 26 01:39:09 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security (was: site clutter) In-Reply-To: Mail from 'Jason Lamport ' dated: Mon, 25 Jun 2001 21:54:55 -0700 Message-ID: <200106260639.XAA23007@catmanor.com> >> >>Hmmm. Can you explain why it is a "Bad Thing" to have your server >>running as user "nobody" and group "nobody"? It would seem to me, that >>this would provide better security for the system if you ran scripts >>as an unprivlidged user. If your cgi scripts were run under setuid, >>a poorly written script can gain access to files (owned by them) that >>were not explicily permitted by the owner as world write. > >The problem with running CGI scripts as "nobody" is that any files >that your scripts can access can also be accessed by any other user >on the system. If you're running your own dedicated web server, this >isn't a problem; but in a multi-user, virtual-server setup like >drizzle's this is a big problem. > >If a script runs as setuid, then I can make files accessible to that >script while hiding those files from other users. This is a Good >Thing. If a script runs as "nobody," then in order to have my script >read from a file (such as a password file, for example) I have to >make that file world-readable; and if the script needs to write to a >file, then I need to make that file world-writable. These are Bad >Things. An interesting perpective. For the sake of protecting a few select files from writing by local users (remember, regular html files still need a permission of 644 and thus are still available for global viewing), it seems your are more comfortable exposing *all* files to world read/write access to a larger anonymous web community. Hmmm. It seems to me to a better idea to restrict the larger anonymous set of users that have no local interest from read/write access to all files than to permit write access to the few files by a smaller set of local users. Also, knowledge of the local userid is protected since the /home directory is resticted from browsing (surfing) by local users. The virtual domain definition hides the owning userid of the domain. Therefore, it is difficult for a local or remote user to know that which userid is associated to a domain, unless provided within the context of the page (guilty). Given just my domain name, catmanor.com, you would have no way to know the maintanence userid. For the best security, your userid should not be listed on your web page (guilty). Without this information, even a local user, will find it difficult to know where to look. However, given access via setuid cgi, you have now provided the capability of both local an anonymous users to crack your web site. It is as simple as forgetting to strip a ';' from a sendmail command line in your cgi mailer or survey. This is a Bad thing. > >> >>Halcyon is much more permissive. For example, they allow cgi scripts to >>be located within your document root (cgi-pvt). A "Bad Thing". >> > >Now I have a question: why is allowing CGI scripts in the document >root a "Bad Thing"? Most providers I've used allow this, and I >personally find it very convenient: it allows me to put scripts where >they belong logically in the site hierarchy rather than off in a >cgi-bin directory, and lets me create prettier URLs. (One favorite >trick of mine is to use index.cgi files to create "extensionless" >URLs: http://www.foo.com/bar/index.cgi can be accessed as simply >http://www.foo.com/bar/ ) If one forgets to put an "index.html" in ones cgi-bin you can get a lot of insight to the cgi structure of the server by browsing the cgi-bin directory. It is a very common mistake. I have used this myself to learn more about how a website is structured. Also, it makes the portabiliity of the scripts more difficult. I had to edit all my html cgi pages that used the non-standard halycon 'cgi-pvt' or 'scripts' alias to the standard 'cgi-bin' syntax used by drizzle. I also found it difficult to mirror the non standard config on my local server which I use for development. By the way, I agree with you that the server side "index.cgi" is very handy. However, most often I find I can use a client side alternative. William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Tue Jun 26 02:06:13 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: setuid & CGI security (was: site clutter) In-Reply-To: Mail from '"Darren/Torin/Who Ever..." ' dated: 25 Jun 2001 22:15:52 -0700 Message-ID: <200106260706.AAA23053@catmanor.com> > >William Julien, in an immanent manifestation of deity, wrote: >>Hmmm. Can you explain why it is a "Bad Thing" to have your server >>running as user "nobody" and group "nobody"? It would seem to me, that >>this would provide better security for the system if you ran scripts >>as an unprivlidged user. If your cgi scripts were run under setuid, >>a poorly written script can gain access to files (owned by them) that >>were not explicily permitted by the owner as world write. > >So, if User A runs his scripts as "nobody" and User B runs her scripts >as "nobody", what could User A do to User B? > >Darren I'm not sure I quite understand your question. If user "A" and "B" run as nobody, they are effectively the same user. The server side id is the same. Web servers, by their nature, are "anonymous". So unless the server script maintains the user information via cookies or session persistant logins, the userid for all users resticted to the "nobody" capability defined by the server. The answer to your question can be "anything they want to do"; given the security (or lack thereof) of the server. --- William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From algard at cardomain.com Tue Jun 26 02:22:58 2001 From: algard at cardomain.com (Alex Algard) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security (was: site clutter) In-Reply-To: <200106260639.XAA23007@catmanor.com> Message-ID: > If one forgets to put an "index.html" in ones cgi-bin you can get a lot > of insight to the cgi structure of the server by browsing the cgi-bin > directory. It is a very common mistake. I have used this myself to learn > more about how a website is structured. Definitely disable autoindexing by default, and then enable it selectively on a per-directory basis as needed (just since it's such a "very common mistake"). ________________________ Alex Algard CarDomain Networks, Inc. 425-820-2244 x111 | fax: 425-820-5951 algard@cardomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From torin at daft.com Tue Jun 26 02:36:49 2001 From: torin at daft.com (Darren/Torin/Who Ever...) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: setuid & CGI security (was: site clutter) In-Reply-To: <200106260706.AAA23053@catmanor.com> References: <200106260706.AAA23053@catmanor.com> Message-ID: <87g0cnzo8e.fsf@perv.daft.com> William Julien, in an immanent manifestation of deity, wrote: >>William Julien, in an immanent manifestation of deity, wrote: >>>Hmmm. Can you explain why it is a "Bad Thing" to have your server >>>running as user "nobody" and group "nobody"? It would seem to me, that >>>this would provide better security for the system if you ran scripts >>>as an unprivlidged user. If your cgi scripts were run under setuid, >>>a poorly written script can gain access to files (owned by them) that >>>were not explicily permitted by the owner as world write. >> >>So, if User A runs his scripts as "nobody" and User B runs her scripts >>as "nobody", what could User A do to User B? >> >>Darren > >I'm not sure I quite understand your question. If user "A" and "B" run >as nobody, they are effectively the same user. The server side id is the >same. Web servers, by their nature, are "anonymous". So unless the server >script maintains the user information via cookies or session persistant >logins, the userid for all users resticted to the "nobody" capability >defined by the server. The answer to your question can be "anything they >want to do"; given the security (or lack thereof) of the server. Right. That's what makes it a "Bad Thing" for everyone to to have their scripts run as "nobody". Any user can do anything they want to any other user. I'd define that as bad. It would be trivial to find out where User B keeps her logs of e-mail contacts or her weblogs. User A could then plunder and spam all of User B's contacts or even modify and deface her weblogs... Not a good thing. Yes, if it is running as the user, a bug in their scripts could cause problems but not as bad as the other scenario. Darren -- Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-206-ELF-LIPZ @ @ @ Unix Sys-Admin / Perl Guru / C expert for hire @ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Tue Jun 26 02:49:46 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security (was: site clutter) In-Reply-To: Mail from 'Sanford Morton ' dated: Mon, 25 Jun 2001 23:35:42 -0700 (PDT) Message-ID: <200106260749.AAA23136@catmanor.com> >> >> So, if User A runs his scripts as "nobody" and User B runs her scripts >> as "nobody", what could User A do to User B? >> > >Almost anything, edit files, remove files, compile source, run a perl >debugger interactively. A couple of references: > http://www.speakeasy.org/~cgires/exec.html > http://www.speakeasy.org/~cgires/modules/ (see cgidebug.pl) > >I have frequently found these tools to be quite helpful, though also >scary. > thanks for the reminder! I have read these pages and used the techniques in the past to compile C programs on a server that had no login access. It not only taught me a lot about the cgi environment, but enabled me how to do the "impossible". For a while, halcyon restricted their shell login to their web server. It ran on a different arch, and the only way to update my C based cgi bin was via CGI. It was a bit tricky to setup, because the server as running as "nobody". But with a view promiscusous settings, I was able to recompile my code. --- William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Tue Jun 26 03:27:23 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: setuid & CGI security (was: site clutter) In-Reply-To: Mail from '"Darren/Torin/Who Ever..." ' dated: 26 Jun 2001 00:36:49 -0700 Message-ID: <200106260827.BAA23182@catmanor.com> >> >>I'm not sure I quite understand your question. If user "A" and "B" run >>as nobody, they are effectively the same user. The server side id is the >>same. Web servers, by their nature, are "anonymous". So unless the server >>script maintains the user information via cookies or session persistant >>logins, the userid for all users resticted to the "nobody" capability >>defined by the server. The answer to your question can be "anything they >>want to do"; given the security (or lack thereof) of the server. > >Right. That's what makes it a "Bad Thing" for everyone to to have their >scripts run as "nobody". Any user can do anything they want to any >other user. I'd define that as bad. It would be trivial to find out >where User B keeps her logs of e-mail contacts or her weblogs. User A >could then plunder and spam all of User B's contacts or even modify and >deface her weblogs... > >Not a good thing. > >Yes, if it is running as the user, a bug in their scripts could cause >problems but not as bad as the other scenario. > >Darren You mis-understand. It is a "Good Thing" to have everyone run under a restricted userid (like nobody) than have them have free run as a "real" user. The nobody user generaly has less privledge than a normal user. This provides better security. Of course, the degree of security depends on the degree of freedom by the server admin. For two years, I had to convince (beg and plead) my business addin to allow me CGI. Before that, all scripts were evaluated and a decision was made on a per script basis if it would be allowed on the server. After I had demonstrated my "god like" cgi capability, they gave me unrestricted access. I agree with this policy. I feel that trust should be earned. But I also see that this level of interaction is less practical in the secure commercial market. The market needs to stike a balance between security and usability. Jason should feel lucky. As an admin, I would have said "no". --- William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope at jope.net Tue Jun 26 10:37:00 2001 From: jope at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security In-Reply-To: Message-ID: I agree with using using the policy that is most secure from the perspective of the system itself, and re-evaluating for specific scripts or users. That said, I hate authority, and as a user, I can easily see how this restriction would be a pain. So... It's not an optimal solution, and only provides read protection, no write protection, but you can easily encrypt the data files. The Crypt::* modules are fun 'n easy. Another hacky workaround that would give you both read and write protection (though the security soundness is questionable), is to write a separate prog outside in your document root through which your CGI script accesses specific files, have it require an auth token at the start, and make sure the data files are also placed somewhere outside your document root. If you don't have access to a non-webspace area on the web server, or the server is running chrooted, then this isn't an option. Spot the above for security holes, I haven't had my coffee yet. =) -jp On Mon, 25 Jun 2001, Jason Lamport wrote: > The problem with running CGI scripts as "nobody" is that any files > that your scripts can access can also be accessed by any other user > on the system. If you're running your own dedicated web server, this > isn't a problem; but in a multi-user, virtual-server setup like > drizzle's this is a big problem. > > If a script runs as setuid, then I can make files accessible to that > script while hiding those files from other users. This is a Good > Thing. If a script runs as "nobody," then in order to have my script > read from a file (such as a password file, for example) I have to > make that file world-readable; and if the script needs to write to a > file, then I need to make that file world-writable. These are Bad > Things. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Tue Jun 26 11:55:40 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: setuid & CGI security (was: site clutter) In-Reply-To: <200106260827.BAA23182@catmanor.com> References: <200106260827.BAA23182@catmanor.com> Message-ID: <37200000.993574540@benzene> -- William Julien spake thusly: >>> I'm not sure I quite understand your question. If user "A" and "B" >>> run as nobody, they are effectively the same user. The server side >>> id is the same. Web servers, by their nature, are "anonymous". So >>> unless the server script maintains the user information via cookies >>> or session persistant logins, the userid for all users resticted to >>> the "nobody" capability defined by the server. The answer to your >>> question can be "anything they want to do"; given the security (or >>> lack thereof) of the server. >> >> Right. That's what makes it a "Bad Thing" for everyone to to have >> their scripts run as "nobody". Any user can do anything they want >> to any other user. I'd define that as bad. It would be trivial to >> find out where User B keeps her logs of e-mail contacts or her >> weblogs. User A could then plunder and spam all of User B's >> contacts or even modify and deface her weblogs... >> >> Not a good thing. >> >> Yes, if it is running as the user, a bug in their scripts could cause >> problems but not as bad as the other scenario. >> >> Darren > > You mis-understand. It is a "Good Thing" to have everyone run under a > restricted userid (like nobody) than have them have free run as a > "real" user. The nobody user generaly has less privledge than a > normal user. This provides better security. It seems like there are actually two issues, and you're each offering solutions for only one of them. Issue #1: Having all CGI's running as nobody opens security holes by allowing different accounts on the machine to access each other's web-related files. One particularly bad thing about this is that it introduces worry not only about your own and the admin's security procedures, but also those of every other user on the system. William claims the issues with this are solved by not allowing users to list the home directory and using non-obvious usernames, but this is just security through obscurity and I would be leary of trusting my site to it. It's like believing that disabling indexes prevents intruders from accessing unreferenced files and directories. While it's a good practice, it shouldn't be your only line of defense. Issue #2: Having all CGI's running as the owning user opens security holes by preventing users from being able to protect files from their own cgi scripts. I think the ideal solution would address both of these issues. One possibility might be having CGI's run as nobody, but run chrooted to the user's html tree, but this would either result in a lot of file duplication or severely limit the usefulness of CGI's. Another solution might be to give each user two accounts: a standard user account, which most files are owned by, and an individual web account that CGI's run as. A problem with this is that a tool would have to be provided to allow the standard user account to adjust ownership and permissions for the web account. I also know of no site that implements such a solution. You might also ask, if you can't solve both issues which one would you prefer to have to deal with? Would you rather trust your own security procedures and programming practices or would you rather trust those of everyone else on the system? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20010626/d5a944f0/attachment.bin From jason at strangelight.com Tue Jun 26 12:12:34 2001 From: jason at strangelight.com (Jason Lamport) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security In-Reply-To: References: Message-ID: At 8:37 AM -0700 6/26/01, El JoPe Magnifico wrote: > > >It's not an optimal solution, and only provides read protection, >no write protection, but you can easily encrypt the data files. >The Crypt::* modules are fun 'n easy. How do you decrypt them without making the decrypting password world-readable? > >Another hacky workaround that would give you both read and write >protection (though the security soundness is questionable), is to >write a separate prog outside in your document root through which >your CGI script accesses specific files, have it require an auth >token at the start, Again: any auth token that the CGI can access can also be accessed by any other user on the system. At 11:39 PM -0700 6/25/01, William Julien wrote: > >An interesting perpective. For the sake of protecting a few select files >from writing by local users (remember, regular html files still need >a permission of 644 and thus are still available for global viewing), it >seems your are more comfortable exposing *all* files to world read/write >access to a larger anonymous web community. Hmmm. Huh? Explain to me how I am "exposing *all* files to world read/write"? > >Also, knowledge of the local userid is protected since the /home directory >is resticted from browsing (surfing) by local users. The virtual >domain definition hides the owning userid of the domain. Therefore, >it is difficult for a local or remote user to know that which userid is >associated to a domain, unless provided within the context of the page >(guilty). Given just my domain name, catmanor.com, you would have no >way to know the maintanence userid. While I agree that it is prudent not to publish one's userid (no sense giving hackers any more information than is absolutely necessary) any setup that relies exclusively on keeping one's userid secret seems to me to be a very poor choice. The basic security model of Unix (and most other systems) is that the userid (which is usually fixed) is public and the password (which can usually be changed at will) is private. Simply knowing a person's user name should *not* allow one to gain access to their private files! (And BTW, a quick scan of likely usernames on drizzle's system just now turned up several hits in just a couple of minutes.) -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From meonkeys at hotmail.com Tue Jun 26 13:06:17 2001 From: meonkeys at hotmail.com (Adam Monsen) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: setuid & CGI security (was: site clutter) Message-ID: >Another solution might be to give each user two accounts: a standard >user account, which most files are owned by, and an individual web >account that CGI's run as. A problem with this is that a tool would >have to be provided to allow the standard user account to adjust >ownership and permissions for the web account. I also know of no site >that implements such a solution. The University of Washington student webservers (http://students.washington.edu/) operate in a manner similar to this, but with a single login. Every user is given one shell account, for instance, meonkeys.user (user.group). CGIs would run as meonkeys.www. I am able to maintain CGIs in my document root becuase the setgid bit is on in this directory. The permissions are 2750 on my document root. Consequently, any directories created in the document root are 2755 (my umask being 022). It works fine. I could even make a file with 0700 permissions that holds a secret key, and this will be denied direct access through HTTP, but a CGI can still get to it. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope-spug at jope.net Tue Jun 26 15:27:29 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: setuid & CGI security In-Reply-To: Message-ID: >> It's not an optimal solution, and only provides read protection, >> no write protection, but you can easily encrypt the data files. >> The Crypt::* modules are fun 'n easy. > > How do you decrypt them without making the decrypting password > world-readable? Hmm, I was just thinking put it in the CGI script itself. Except I forgot that CGI scripts (or any script) need to be readable as well as executable. So any local user can read the script. Curses! Oh well, encryption is a pain in the ass (*) anyway. [* day-job angst, please ignore =] >> Another hacky workaround that would give you both read and write >> protection (though the security soundness is questionable), is to >> write a separate prog outside in your document root through which >> your CGI script accesses specific files, have it require an auth >> token at the start, And same goes here. If there were some other way to reliably verify what the calling (parent) script was, that would suffice. Checking its environment is no good, because that can br modified. Is there anything else? Y'know, the more I think about it, that cgiwrap prog isn't such a bad thing. It can chroot your script, which takes much of the danger to the system out of running CGI scripts as the user, and still gives you all the freedom you are after: http://cgiwrap.unixtools.org/chroot.html Further, it is possible to avoid the cumbersome prefix in the URL path, they just need to add a couple Rewrite rules to the server config: http://cgiwrap.unixtools.org/tricks.html Maybe that's what you should be asking for, if that was your gripe. -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope-spug at jope.net Wed Jun 27 14:12:53 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: assigning to slice of anon hash? Message-ID: Quick (hopefully) perl syntax question that I ran into last night. You can assign to a slice of a hash with the following: @hash{ @fields } = @values; However, I can't figure out how to do the same with a hash ref. The following gives a runtime error, "Can't coerce array into hash", since the @{$ref} construct is generally how you deref an array ref: @{ $hash_ref }->{ @fields } = @values; And the following (which wouldn't be syntactically consistent, but I tried just in case) doesn't do the trick either: %{ $hash_ref }->{ @fields } = @values; I'm using perl 5.6.1. Assistance appreciated! =) -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jimfl at colltech.com Wed Jun 27 14:30:42 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: assigning to slice of anon hash? In-Reply-To: Message-ID: <184743.3202633842@[192.168.1.101]> --Also Sprache El JoPe Magnifico On Wednesday, June 27, 2001 12:12 PM -0700: > Quick (hopefully) perl syntax question that I ran into last night. > You can assign to a slice of a hash with the following: > > @hash{ @fields } = @values; > > However, I can't figure out how to do the same with a hash ref. > The following gives a runtime error, "Can't coerce array into hash", > since the @{$ref} construct is generally how you deref an array ref: > > @{ $hash_ref }->{ @fields } = @values; > > And the following (which wouldn't be syntactically consistent, > but I tried just in case) doesn't do the trick either: > > %{ $hash_ref }->{ @fields } = @values; You're close! @{$hashref}{@fields} = @values. -- Jim Flanagan Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dbitsef at qwest.com Wed Jun 27 14:34:16 2001 From: dbitsef at qwest.com (David Bitseff) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: assigning to slice of anon hash? In-Reply-To: References: Message-ID: <15162.13624.488386.582346@maakie.uswc.uswest.com> This appears to work: @$hash_ref{@fields} = @values; El JoPe Magnifico writes: > Quick (hopefully) perl syntax question that I ran into last night. You > can assign to a slice of a hash with the following: > @hash{ @fields } = @values; > However, I can't figure out how to do the same with a hash ref. The > following gives a runtime error, "Can't coerce array into hash", since > the @{$ref} construct is generally how you deref an array ref: > @{ $hash_ref }->{ @fields } = @values; > And the following (which wouldn't be syntactically consistent, but I > tried just in case) doesn't do the trick either: > %{ $hash_ref }->{ @fields } = @values; > I'm using perl 5.6.1. Assistance appreciated! =) -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From doug at beaver.net Wed Jun 27 15:27:46 2001 From: doug at beaver.net (Doug Beaver) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: assigning to slice of anon hash? In-Reply-To: ; from jope-spug@jope.net on Wed, Jun 27, 2001 at 12:12:53PM -0700 References: Message-ID: <20010627162746.A33231@beaver.net> On Wed, Jun 27, 2001 at 12:12:53PM -0700, El JoPe Magnifico wrote: > Quick (hopefully) perl syntax question that I ran into last night. > You can assign to a slice of a hash with the following: > > @hash{ @fields } = @values; > > However, I can't figure out how to do the same with a hash ref. > The following gives a runtime error, "Can't coerce array into hash", > since the @{$ref} construct is generally how you deref an array ref: > > @{ $hash_ref }->{ @fields } = @values; > > And the following (which wouldn't be syntactically consistent, > but I tried just in case) doesn't do the trick either: > > %{ $hash_ref }->{ @fields } = @values; require 'dumpvar.pl'; @fields = 'a'..'e'; @values = 1..5; @hash{@fields} = @values; dumpValue(\%hash); print "\n"; $h = {}; @$h{@fields} = @values; dumpValue($h); print "\n"; $h = {}; @{ $h }{@fields} = @values; dumpValue($h); print "\n"; You've already dereferenced the ref by sticking the @ in front of it, so you don't need the ->... Tested on 5.6.0. Doug - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jope-spug at jope.net Wed Jun 27 15:50:42 2001 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Re: slice question; list latency In-Reply-To: <20010627162746.A33231@beaver.net> Message-ID: Yeah, I realized that and smacked myself as soon as I saw the answer. Sheesh, I used to be a god of perl syntax, but six months of hacking exclusively in C, and look what I've devolved to. =P Unrelated question: Why is the latency on postings to this list so darned high? We get a lot of duplicate answers as a result. Just wondering. -jp On Wed, 27 Jun 2001, Doug Beaver wrote: > @{ $h }{@fields} = @values; [...] > You've already dereferenced the ref by sticking the @ in front of it, > so you don't need the ->... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at cardomain.com Wed Jun 27 20:23:44 2001 From: gardner at cardomain.com (Jonathan Gardner) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Bizarre copy of an ARRAY Message-ID: <0106271823440R.06850@avatar.cardomain.com> Bizarre copy of ARRAY in aassign at /usr/lib/perl5/5.6.0/Carp/Heavy.pm line 79. What? This is a bizarre error message. Any ideas on what this could mean (or why it is showing up?) Running in mod_perl, using (as you can see) 5.6.0. -- Jonathan Gardner Software Engineer, CarDomain Networks (425) 820-2244 x123 gardner@sounddomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ced at carios2.ca.boeing.com Wed Jun 27 23:45:16 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Bizarre copy of an ARRAY Message-ID: <200106280445.VAA27839@carios2.ca.boeing.com> > Bizarre copy of ARRAY in aassign at /usr/lib/perl5/5.6.0/Carp/Heavy.pm line 79. > What? This is a bizarre error message. Any ideas on what this could mean (or why it is showing up?) > Running in mod_perl, using (as you can see) 5.6.0. I seem to recall some seeing a discussion somewhere. You might want to try a search of Googol or p5p archives. hope this may help, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Thu Jun 28 00:47:46 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: Bizarre copy of an ARRAY References: <200106280445.VAA27839@carios2.ca.boeing.com> Message-ID: <046801c0ff95$deb0e9c0$3888ddd1@aciwin> I believe the code that throws the error is using something incorrectly in a list context. Here's an example from the perl5-porters@perl.org list: **************************************************** > for (1..4) { > push @a, $_, last if $_ == 3; > } > print "@a\n"; > __END__ > Bizarre copy of ARRAY in last at - line 1. > > The behavior is the same in Perl 5.005_04, 5.005_03, and 5.6.0. Of course > the user is wrong but why miss an opportunity to tell them so in more > florid terms? :-) It fails back to at least 5.002. But it works in Perl4 if you add brackets to the push. :-) And it's not clear in what sense that's "wrong". It certainly shouldn't attract a fatal error, tho' it would be a candidate for the proposed new warning "next/last/return/ ... used where value wanted". ****************************************************** What is the code at Heavy.pm line 79? Cheers, Richard ----- Original Message ----- From: To: ; Sent: Wednesday, June 27, 2001 9:45 PM Subject: Re: SPUG: Bizarre copy of an ARRAY > > Bizarre copy of ARRAY in aassign at /usr/lib/perl5/5.6.0/Carp/Heavy.pm line > 79. > > > What? This is a bizarre error message. Any ideas on what this could mean > (or why it is showing up?) > > > Running in mod_perl, using (as you can see) 5.6.0. > > I seem to recall some seeing a discussion somewhere. You might > want to try a search of Googol or p5p archives. > > hope this may help, > -- > Charles DeRykus > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Thu Jun 28 20:21:50 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: calling perl from java Message-ID: Does anyone on this mailing list have experience calling Perl code from Java? I have a Java application, and I want to call some Perl code from it. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010628/c5541e68/attachment.htm From achen at u.washington.edu Thu Jun 28 20:38:46 2001 From: achen at u.washington.edu (Andrew H. Chen) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: calling perl from java In-Reply-To: Message-ID: I did some work with JPL when it was a bit more experimental. I've heard it's evolved quite a bit since then, to the point where it almost works! ;) Here's the link to the tutorial:. http://sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/jpl/docs/Tutorial.h tml Guessing you have a pretty interesting project there! Good luck, Andrew -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Showell30@aol.com Sent: Thursday, June 28, 2001 6:22 PM To: spug-list@pm.org Subject: SPUG: calling perl from java Does anyone on this mailing list have experience calling Perl code from Java? I have a Java application, and I want to call some Perl code from it. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010628/a194e2d4/attachment.htm From ced at carios2.ca.boeing.com Fri Jun 29 18:50:13 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:08:07 2004 Subject: SPUG: calling perl from java Message-ID: <200106292350.QAA03938@carios2.ca.boeing.com> > I did some work with JPL when it was a bit more experimental. I've heard > it's evolved quite a bit since then, to the point where it almost works! ;) > Here's the link to the tutorial:. > .http://sunsite.ualberta.ca/Documentation/Misc/perl-5.6.1/jpl/docs/Tutorial.h tml >> Does anyone on this mailing list have experience calling Perl code from Java? If you're using newer jdk's (1.2/1.3), you'll probably need Jarkko Hietieniemi's patch unless 5.6.1 already has it in. Newer JDK's became intolerant of Perl monkeying with the environment. Here's Jarkko Hietieniemi's latest patch below if you're don't mind patching source: Rgds, -- Charles DeRykus Change 8803 by jhi@alpha on 2001/02/14 03:14:14 Duplicate environment for JPL so that JDK 1.2/1.3 don't get upset. Affected files ... ... //depot/perl/perl.c#300 edit ... //depot/perl/perl.h#315 edit Differences ... ==== //depot/perl/perl.c#300 (text) ==== Index: perl/perl.c --- perl/perl.c.~1~ Wed Feb 14 05:19:55 2001 +++ perl/perl.c Wed Feb 14 05:19:55 2001 @@ -3257,6 +3257,8 @@ char *s; SV *sv; GV* tmpgv; + char **dup_env_base = 0; + int dup_env_count = 0; argc--,argv++; /* skip name of script */ if (PL_doswitches) { @@ -3325,6 +3327,23 @@ env = environ; if (env != environ) environ[0] = Nullch; +#ifdef NEED_ENVIRON_DUP_FOR_MODIFY + { + char **env_base; + for (env_base = env; *env; env++) + dup_env_count++; + if ((dup_env_base = (char **) + safemalloc( sizeof(char *) * (dup_env_count+1) ))) { + char **dup_env; + for (env = env_base, dup_env = dup_env_base; + *env; + env++, dup_env++) + *dup_env = savepv(*env); + *dup_env = Nullch; + env = dup_env_base; + } /* else what? */ + } +#endif /* NEED_ENVIRON_DUP_FOR_MODIFY */ for (; *env; env++) { if (!(s = strchr(*env,'='))) continue; @@ -3340,7 +3359,13 @@ (void)PerlEnv_putenv(savepv(*env)); #endif } -#endif + if (dup_env_base) { + char **dup_env; + for (dup_env = dup_env_base; *dup_env; dup_env++) + Safefree(*dup_env); + Safefree(dup_env_base); + } +#endif /* USE_ENVIRON_ARRAY */ #ifdef DYNAMIC_ENV_FETCH HvNAME(hv) = savepv(ENV_HV_NAME); #endif ==== //depot/perl/perl.h#315 (text) ==== Index: perl/perl.h --- perl/perl.h.~1~ Wed Feb 14 05:19:55 2001 +++ perl/perl.h Wed Feb 14 05:19:55 2001 @@ -1692,6 +1692,13 @@ # define USE_ENVIRON_ARRAY #endif +#ifdef JPL + /* E.g. JPL needs to operate on a copy of the real environment. + * JDK 1.2 and 1.3 seem to get upset if the original environment + * is diddled with. */ +# define NEED_ENVIRON_DUP_FOR_MODIFY +#endif + #ifndef PERL_SYS_INIT3 # define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp) #endif End of Patch. Google Web Directory - Cool Jobs - Advertise with Us - Add Google to Your Site - Google in Your Language - All About Google ©2001 Google - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/