From pdarley at kinesis-cem.com Mon Apr 1 09:32:27 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Memory Leak Message-ID: Friends, First, thanks for your help with turning off warnings. I'm having a problem now with a package (PDF::API2) that seems to be leaking memory all over the place. I'm wondering if there is a way I can force it to destroy its objects at a certain time, or if there's anything else I can do besides fixing the module (Which I don't know if I could do). Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at teachmeperl.com Thu Apr 4 11:22:41 2002 From: tim at teachmeperl.com (Tim Maher) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Re: Need a running start with PERL Message-ID: <20020404092241.C8415@timji.consultix.wa.com> On Thu, Apr 04, 2002 at 08:46:13PM +1000, Hugh Blandford wrote: > Hi all, > > are there any suggestions for a good place to start getting into PERL > quickly. There is a lot of info out there and I would like to save myself > some grief. My company offers a one-day "Minimal Perl" course, which is scheduled for its next public offering in Seattle, June 7. We also provide free downloads of a shorter, self-teaching version of this course from our web page. Look under "Publications" in the left-hand frame at "teachmeperl.com". > I have done hardly any programming in my time but really can't stomach > another "Hello World" introduction to programming or producing one line > search and replaces on a text string. > > PERL modules seem to be the go for me as it looks like someone a lot better > at programming than me has done a lot of the hard work for me already. Is > it really the case of just looking through CPAN and see what grabs my > attention... > > A project that I am looking at doing at the moment is taking some NetFlow > data using the flow-tools package > (http://www.splintered.net/sw/flow-tools/ ) and putting it into a Postgres > database to use for billing. I would also like to graph the data as well > and am looking at FlowScan > (http://net.doit.wisc.edu/~plonka/list/flowscan/ ) . > > Anyway suggestions of where to start or what to avoid would be greatly > appreciated. Our "Minimal Perl" course would get you started, although it emphasizes "rolling your own" programs to do File Conversion, Data Validation, Report Generation, and Number Crunching over module usage. Our 4-day sequence called "Perl Programming, plus Modules" covers all the basics, including the use of Modules, and will be taught next in Seattle from 6/10-13. For those looking for more advanced training, we're also offering our "Intermediate Perl" and "Intro. to OO Perl" courses in Seattle during the week of 4/15! 8-} > > Thanks, > > Hugh Blandford > > -Tim *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From beckyls at u.washington.edu Thu Apr 4 13:23:41 2002 From: beckyls at u.washington.edu (Rebecca L. Schmidt) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Re: Need a running start with PERL In-Reply-To: <20020404092241.C8415@timji.consultix.wa.com> Message-ID: The University of Washington offers a Certificate Program in Perl Programming that may be of interest to you. It isn't a crash-course -- but perhaps after taking a short course you'll get hooked and want to learn more! This hands-on evening three-course program is designed for professionals working in a variety of fields who want to gain an in-depth knowledge of Perl and to practice its use. The program begins twice a year -- in the fall and again in the winter. The instructors are experts in the field, and they also belong to this list: Joel Grow (Amazon.com), Doug Treder (Amazon.com), Brian Aker (Open Source Development Network) and Keith Reed (Philips Medical Systems). You can find current program information via the following URL. Upcoming program information will be posted online in June. http://www.outreach.washington.edu/extinfo/certprog/per/per_main.asp If you have any questions about the program please don't hesitate to contact me. Best regards, Rebecca Schmidt Academic Programs University of Washington Extension (206) 221-6243 On Thu, 4 Apr 2002, Tim Maher wrote: > On Thu, Apr 04, 2002 at 08:46:13PM +1000, Hugh Blandford wrote: > > Hi all, > > > > are there any suggestions for a good place to start getting into PERL > > quickly. There is a lot of info out there and I would like to save myself > > some grief. > > My company offers a one-day "Minimal Perl" course, which is scheduled > for its next public offering in Seattle, June 7. We also provide free > downloads of a shorter, self-teaching version of this course from our > web page. Look under "Publications" in the left-hand frame at > "teachmeperl.com". > > > I have done hardly any programming in my time but really can't stomach > > another "Hello World" introduction to programming or producing one line > > search and replaces on a text string. > > > > PERL modules seem to be the go for me as it looks like someone a lot better > > at programming than me has done a lot of the hard work for me already. Is > > it really the case of just looking through CPAN and see what grabs my > > attention... > > > > A project that I am looking at doing at the moment is taking some NetFlow > > data using the flow-tools package > > (http://www.splintered.net/sw/flow-tools/ ) and putting it into a Postgres > > database to use for billing. I would also like to graph the data as well > > and am looking at FlowScan > > (http://net.doit.wisc.edu/~plonka/list/flowscan/ ) . > > > > Anyway suggestions of where to start or what to avoid would be greatly > > appreciated. > > Our "Minimal Perl" course would get you started, although it emphasizes > "rolling your own" programs to do File Conversion, Data Validation, > Report Generation, and Number Crunching over module usage. > > Our 4-day sequence called "Perl Programming, plus Modules" covers all > the basics, including the use of Modules, and will be taught next in > Seattle from 6/10-13. For those looking for more advanced training, > we're also offering our "Intermediate Perl" and "Intro. to OO Perl" > courses in Seattle during the week of 4/15! 8-} > > > > > Thanks, > > > > Hugh Blandford > > > > > > -Tim > *==============================================================================* > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | > | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | > *------------------------------------------------------------------------------* > | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | > | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | > *==============================================================================* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From rg at sexypoint.com.ar Sun Apr 7 21:26:14 2002 From: rg at sexypoint.com.ar (ShemalesPoint.com) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Shemales and Transsexuals !!! Message-ID: <191412-2200241822614230@sexypoint.com.ar> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 7733 bytes Desc: logochic.jpg Url : http://mail.pm.org/archives/spug-list/attachments/20020407/a309bad8/attachment.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 6382 bytes Desc: shem01b.jpg Url : http://mail.pm.org/archives/spug-list/attachments/20020407/a309bad8/attachment-0001.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 520 bytes Desc: bot-punto.jpg Url : http://mail.pm.org/archives/spug-list/attachments/20020407/a309bad8/attachment-0002.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 520 bytes Desc: bot-punto.jpg Url : http://mail.pm.org/archives/spug-list/attachments/20020407/a309bad8/attachment-0003.jpg From asimjalis at yahoo.com Mon Apr 8 00:37:40 2002 From: asimjalis at yahoo.com (Asim Jalis) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <191412-2200241822614230@sexypoint.com.ar> Message-ID: <20020408053740.16905.qmail@web14203.mail.yahoo.com> "ShemalesPoint.com" wrote: [ad deleted] I get more spam through SPUG than all the other lists combined. Why is this? Is it because the word "SPUG" sounds vaguely naughty? Asim __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.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://seattleperl.org From tim at teachmeperl.com Mon Apr 8 02:04:33 2002 From: tim at teachmeperl.com (Tim Maher) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408053740.16905.qmail@web14203.mail.yahoo.com>; from Asim Jalis on Sun, Apr 07, 2002 at 10:37:40PM -0700 References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> Message-ID: <20020408000433.A6335@timji.consultix.wa.com> On Sun, Apr 07, 2002 at 10:37:40PM -0700, Asim Jalis wrote: > "ShemalesPoint.com" wrote: > [ad deleted] > > I get more spam through SPUG than all the other > lists combined. Why is this? Is it because the > word "SPUG" sounds vaguely naughty? Eureka! That's the logical explanation I've been searching for! 8-} "In other news," I've been trying to talk our Perl Mongers "majordomo administrator" into installing "spamassassin" or something similar, and he says he'll get around to that when he can. -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== > > Asim > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Tax Center - online filing with TurboTax > http://taxes.yahoo.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://seattleperl.org > > -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From richard at richard-anderson.org Mon Apr 8 10:35:10 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:08:51 2004 Subject: SPUG: Re: SPUG Spam (was Shemales and Transsexuals !!!) References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> <20020408000433.A6335@timji.consultix.wa.com> Message-ID: <013e01c1df12$fab89250$1588ddd1@aciwin> Tim, one reason that SPUG is getting spammed may be that the address spug@seattleperl.org is listed our address on the SPUG web page. The spammers use robots that crawl the web and collect e-mail addresses for their lists. If you want to reduce our spam, take all e-mail addresses off the page and replace them with a form and CGI script. If the e-mail list postings are archived on a web page, this may also be part of the problem. Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Tim Maher" To: "Asim Jalis" Cc: Sent: Monday, April 08, 2002 12:04 AM Subject: Re: SPUG: Shemales and Transsexuals !!! > On Sun, Apr 07, 2002 at 10:37:40PM -0700, Asim Jalis wrote: > > "ShemalesPoint.com" wrote: > > [ad deleted] > > > > I get more spam through SPUG than all the other > > lists combined. Why is this? Is it because the > > word "SPUG" sounds vaguely naughty? > > Eureka! That's the logical explanation I've been searching for! 8-} > > "In other news," I've been trying to talk our Perl Mongers > "majordomo administrator" into installing "spamassassin" or > something similar, and he says he'll get around to that when he can. > > -Tim > ====================================================== > | Tim Maher, Ph.D. tim@timmaher.org | > | SPUG Founder & Leader spug@seattleperl.org | > | Seattle Perl Users Group www.seattleperl.org | > ====================================================== > > > > Asim > > > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Tax Center - online filing with TurboTax > > http://taxes.yahoo.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://seattleperl.org > > > > > > -- > *=========================================================================== ===* > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | > | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | > *--------------------------------------------------------------------------- ---* > | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | > | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | > *=========================================================================== ===* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From mako at debian.org Mon Apr 8 11:29:54 2002 From: mako at debian.org (Mako Hill) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408000433.A6335@timji.consultix.wa.com> References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> <20020408000433.A6335@timji.consultix.wa.com> Message-ID: <20020408162954.GA5990@nozomi.hampshire.edu> > "In other news," I've been trying to talk our Perl Mongers "majordomo > administrator" into installing "spamassassin" or something similar, and > he says he'll get around to that when he can. Well there's nothing keeping you from doing it now on your local machine or your mail server. That's what I've been doing and I was totally (and happily) confused by your message referring to spam I've never seen. Many people are rather opposed to the idea of the spam filtering on the listserver since they believe this is not the correct place to do since false positives do happen. Often a compromise is reached when you only filter mail from non list members. Even in these cases, the list usually relays the message, simply marking it at "probably spam"--something you can usually parse from the subject anyway. If you don't want to see it, you may end up needing some filtering on your end again anyway. -- Mako Hill mako@debian.org http://people.debian.org/~mako/ -------------- 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/20020408/725026aa/attachment.bin From ben at reser.org Mon Apr 8 11:32:46 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408000433.A6335@timji.consultix.wa.com>; from tim@teachmeperl.com on Mon, Apr 08, 2002 at 12:04:33AM -0700 References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> <20020408000433.A6335@timji.consultix.wa.com> Message-ID: <20020408093246.P6388@gyrus.brain.org> On Mon, Apr 08, 2002 at 12:04:33AM -0700, Tim Maher wrote: > "In other news," I've been trying to talk our Perl Mongers > "majordomo administrator" into installing "spamassassin" or > something similar, and he says he'll get around to that when he can. spamassassin should not be installed on a mailing list. Part of the point of spamassassin is that even when installed globally on a machine users are still allowed to configure how it behaves for the most part. On a mailing list users don't have that option. Furthermore, spamassassin won't decrease the amount of spam people receive it'll just tag it all for them. Unless you want to be very brave and just toss things spamassassin doesn't like... -- Ben Reser http://ben.reser.org What difference does it make to the dead, the orphans, and the homeless, whether the mad destruction is wrought under the name of totalitarianism or the holy name of liberty and democracy? - Ghandi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From djames at serv.net Mon Apr 8 13:13:02 2002 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408162954.GA5990@nozomi.hampshire.edu>; from Mako Hill on Mon, Apr 08, 2002 at 12:29:54PM -0400 References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> <20020408000433.A6335@timji.consultix.wa.com> <20020408162954.GA5990@nozomi.hampshire.edu> Message-ID: <20020408111302.A75002@itchy.serv.net> > Many people are rather opposed to the idea of the spam filtering on > the listserver since they believe this is not the correct place to do > since false positives do happen. Often a compromise is reached when > you only filter mail from non list members. Even in these cases, the > list usually relays the message, simply marking it at "probably > spam"--something you can usually parse from the subject anyway. Any reason we wouldn't want to prohibit messages from non-members? Most of the lists I've been on have been set up that way. Unless of course some people on this list welcome this sort of 'information' :-) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tuck at whistlingfish.net Mon Apr 8 14:02:55 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408093246.P6388@gyrus.brain.org> References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> <20020408000433.A6335@timji.consultix.wa.com> <20020408093246.P6388@gyrus.brain.org> Message-ID: <9690000.1018292571@flashingchance.whistlingfish.net> -- Ben Reser spake thusly: > spamassassin should not be installed on a mailing list. Part of the > point of spamassassin is that even when installed globally on a > machine users are still allowed to configure how it behaves for the > most part. On a mailing list users don't have that option. > Furthermore, spamassassin won't decrease the amount of spam people > receive it'll just tag it all for them. Unless you want to be very > brave and just toss things spamassassin doesn't like... I suspect that even tagging messages as probably spam would be enough for most people that care about it, and is the way to go. One huge advantage the list server has over my system is that it knows who the list of subscribed users is. I find that my most successful spam rule is the one that tags anything bcc'd to me as spam unless the sender is known. Unfortunately, this doesn't usually seem to work for lists; for some reason spam to lists almost always includes the list address. -------------- 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/20020408/477fd274/attachment.bin From dlkirkland at rhyton.com Mon Apr 8 14:16:07 2002 From: dlkirkland at rhyton.com (Douglas Kirkland) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: SPUG Spam Message-ID: <0204081216070H.31424@mooky.kennel> Just wondering if the spammer have to be signup to the list? This email address is not or should not be a part of the list. Douglas douglas@slugstone.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From douglas at slugstone.net Mon Apr 8 15:32:55 2002 From: douglas at slugstone.net (Douglas Kirkland) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408111302.A75002@itchy.serv.net> References: <191412-2200241822614230@sexypoint.com.ar> <20020408162954.GA5990@nozomi.hampshire.edu> <20020408111302.A75002@itchy.serv.net> Message-ID: <0204081332550P.31424@mooky.kennel> On Monday 08 April 2002 11:13 am, Daniel James wrote: > > Many people are rather opposed to the idea of the spam filtering on > > the listserver since they believe this is not the correct place to do > > since false positives do happen. Often a compromise is reached when > > you only filter mail from non list members. Even in these cases, the > > list usually relays the message, simply marking it at "probably > > spam"--something you can usually parse from the subject anyway. > > Any reason we wouldn't want to prohibit messages from non-members? Most of > the lists I've been on have been set up that way. > I believe this is already done. I have test sending as a non-member and the list did not get the message. Some how the spammer are signing up on the list then sending to the list. Some how we should make it more difficult for spammers to subscribe to the list, while allowing new membership to the list. That was obvious. I have said this before. Only allow emails to the list that are in the to field to post to the list. That should reduce about 60% of the spamming to the list. Maybe even more. Douglas - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From humbaba9 at yahoo.com Mon Apr 8 17:43:41 2002 From: humbaba9 at yahoo.com (Meryll Larkin) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: SPUG Spam In-Reply-To: <0204081216070H.31424@mooky.kennel> Message-ID: <20020408224341.77359.qmail@web12806.mail.yahoo.com> 4/8/02 Hi Folks, I've been on this list for almost 4 years and I read just about every email. I'll let you all know when I'm at the point that I understand half of it :-) , but I have a very good memory and this much I do know: 1. ALL of you "list regulars" post in plain text, and ALMOST all of the spam has been posted either in a language other than English or in HTML (for the visual ad value). 2. SPUG doesn't sound like anything obscene, it sounds like a potato. I've had my email address on my domain for years and it hasn't brought me significant spam. Posting my résumé on job boards has brought me some spam. However, you can easily put a yahoo (they have good spam-guards) address on the domain instead of the list address and use that to sign up new members. 3. There are companies that make money selling spam lists, once your address is on one, you have to start agressively reporting the spam (to the domain of origin, and to agencies) in order to get off. If you are not yet getting daily spam that might work. It did work once for me. 4. Any spam filter that is not also monitored by a human being will be imperfect: it will either let too much spam go through to the list, or it will filter out legitimate mail. So it is important for someone to be able to review what is being received by the list and not forwarded on to all the members. However, this doesn't have to be done on an hourly basis! that's my 2 cents and I hope that some of it makes sense to you, too. Meryll __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.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://seattleperl.org From tim at teachmeperl.com Mon Apr 8 19:33:03 2002 From: tim at teachmeperl.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Shemales and Transsexuals !!! In-Reply-To: <20020408162954.GA5990@nozomi.hampshire.edu>; from Mako Hill on Mon, Apr 08, 2002 at 12:29:54PM -0400 References: <191412-2200241822614230@sexypoint.com.ar> <20020408053740.16905.qmail@web14203.mail.yahoo.com> <20020408000433.A6335@timji.consultix.wa.com> <20020408162954.GA5990@nozomi.hampshire.edu> Message-ID: <20020408173303.A12214@timji.consultix.wa.com> On Mon, Apr 08, 2002 at 12:29:54PM -0400, Mako Hill wrote: > > "In other news," I've been trying to talk our Perl Mongers "majordomo > > administrator" into installing "spamassassin" or something similar, and > > he says he'll get around to that when he can. > > Well there's nothing keeping you from doing it now on your local machine > or your mail server. That's what I've been doing and I was totally (and > happily) confused by your message referring to spam I've never seen. I personally *am* running spamassassin on my system, but that's not much consolation to those who are complaining about the incoming spam load. 9-} (And it's not perfect; it periodically goes crazy and consumes all the virtual memory in the universe, crashing X11.) Unless we can keep most of this junk out of our members in-boxes, I'm afraid we'll be losing some subscribers to the list. Our Majordomo "taboo-headers" and "taboo-body" filters (that I modified from the set of 8,300 regexes provided by Bill Campbell) have been doing an excellent job of weeding out about 80% of the spam that hits the list; I'm hoping that some additional fine-tuning can be applied to eliminate most of the rest. As discussed earlier, we've thus far avoided closing the list (preventing non-subscribers from posting, which would instantly kill the spam), because keeping it open has been advantageous for those who post from multiple systems. However, if SPAM continues at unacceptably high levels, we just might have to close the list. (Prospective SPAMsters could still SPAM us after subcsribing, but they're unlikely to bother doing that, IMHO.) Some people would need to subscribe under multiple addresses so they could continue posting from different sites, but most of our subscribers would see no difference except for a drastic reaction in SPAM. So what do *you* think? Is it time to close the list, or should we endure the current level of SPAM to accommodate the "peripatetic posters"? > > > -- > Mako Hill > mako@debian.org > http://people.debian.org/~mako/ -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Mon Apr 8 20:48:51 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Closing SPUG-list Message-ID: <20020408184851.A13052@timji.consultix.wa.com> "SPAMogrified" SPUGsters, That posting from the Boeing subscriber who was in fear of being disciplined (or maybe worse) for subscribing to the (newly) "pornographied" SPUG-list has helped me decide to immediately restrict posting to subscribers at this time. I'm not sure I can actually accomplish this at the moment, because it requires knowledge of the exact pathname of a file on the (very remote) server, but I'll try a few logical guesses and see if I get lucky (while I await a response to my urgent Email to the PM majordomo admin). Apologies to those who may be inconvenienced by this action (namely, the handful of subscribers who post from multiple accounts), but given the relative burdens of a) getting to the correct system via ssh before posting or 2) risking one's job by subscribing, it's obvious whose needs deserve preferential consideration here. The "peripatetic posters" can be happy they had 4 years (maximum) of easy access, and we can all henceforth enjoy the greater comfort of a more protected list environment. -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Mon Apr 8 22:31:07 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Closing SPUG-list In-Reply-To: <20020408184851.A13052@timji.consultix.wa.com>; from Tim Maher on Mon, Apr 08, 2002 at 06:48:51PM -0700 References: <20020408184851.A13052@timji.consultix.wa.com> Message-ID: <20020408203107.B13603@timji.consultix.wa.com> On Mon, Apr 08, 2002 at 06:48:51PM -0700, Tim Maher wrote: > > Apologies to those who may be inconvenienced by this action (namely, > the handful of subscribers who post from multiple accounts), but given > the relative burdens of a) getting to the correct system via ssh before > posting or 2) risking one's job by subscribing, it's obvious whose needs > deserve preferential consideration here. I've just determined that those using the "mutt" mailer have an even easier option; they can just force a change to their "From:" string, while working on any system, to the SPUG-subscribed address using this syntax in .mutt/muttrc: my_hdr From: Tim Maher Or, for those who arrange for their incoming SPUG mail to flow into a special folder: folder-hook /home/tim/SPUG my_hdr From: Tim Maher -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From cwilkes-spug at ladro.com Tue Apr 9 03:17:41 2002 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Closing SPUG-list In-Reply-To: <20020408203107.B13603@timji.consultix.wa.com>; from tim@consultix-inc.com on Mon, Apr 08, 2002 at 08:31:07PM -0700 References: <20020408184851.A13052@timji.consultix.wa.com> <20020408203107.B13603@timji.consultix.wa.com> Message-ID: <20020409011741.A43603@www.ladro.com> On Mon, Apr 08, 2002 at 08:31:07PM -0700, Tim Maher wrote: > > I've just determined that those using the "mutt" mailer have an even > easier option; they can just force a change to their "From:" string, > while working on any system, to the SPUG-subscribed address using this > syntax in .mutt/muttrc: > > my_hdr From: Tim Maher > > Or, for those who arrange for their incoming SPUG mail to flow into a > special folder: > folder-hook /home/tim/SPUG my_hdr From: Tim Maher That works or the 'set' notation. From my ~/.muttrc: set envelope_from=yes set spoolfile=~/Maildir/ mailboxes !spug folder-hook spug set from=\"Chris Wilkes \" set editor="/usr/local/bin/vim -c 'set textwidth=72'" folder-hooks are extremely handy. I had to set the envelope_from equal to 'yes' or else my return-path is set to just 'cwilkes@ladro.com' which screws up Qmail's ezmlm mailing list admin tool. Setting vim's column length to 72 is also very handy. That combined with mapping the F1 key in my .exrc (vim script) to Text::AutoFormat has made Mutt my favorite mail client. Chris - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 9 08:34:06 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: SPUG spam Message-ID: <20020409063406.D13973@timji.consultix.wa.com> NOTE: Posting on this list is now restricted to subscribers (specifically, your From: header must show an address that matches one on the list). This message was forwarded as a convenience to the poster, but I won't be doing this (manually) for long! 8-} -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== ----- Forwarded message from owner-spug-list@pm.org ----- From: owner-spug-list@pm.org Date: Tue, 9 Apr 2002 01:53:53 -0500 X-Authentication-Warning: mail.pm.org: majordomo set sender to owner-spug-list@pm.org using -f To: spug-list-approval@pm.org Subject: BOUNCE spug-list@pm.org: Non-member submission from [dancerboy ] >From tim@consultix-inc.com Tue Apr 9 01:53:51 2002 Received: from mail.cablespeed.com (mail.cablespeed.com [216.45.96.99]) by mail.pm.org (8.11.6/8.11.3) with SMTP id g396roM27741 for ; Tue, 9 Apr 2002 01:53:50 -0500 Received: (qmail 1584 invoked by uid 0); 9 Apr 2002 06:50:10 -0000 Received: from unknown (HELO ?64.255.216.47?) (64.255.216.47) by mail.cablespeed.com with SMTP; 9 Apr 2002 06:50:10 -0000 Mime-Version: 1.0 X-Sender: etranger/strangelight.com@europa.your-site.com Message-Id: In-Reply-To: <20020408224341.77359.qmail@web12806.mail.yahoo.com> References: <20020408224341.77359.qmail@web12806.mail.yahoo.com> Date: Mon, 8 Apr 2002 23:49:51 -0700 To: Meryll Larkin , Douglas Kirkland , spug-list@pm.org From: dancerboy Subject: Re: SPUG: SPUG Spam Content-Type: text/plain; charset="us-ascii" ; format="flowed" At 3:43 pm -0700 2002-04-08, Meryll Larkin wrote: >4/8/02 > >Hi Folks, > >I've been on this list for almost 4 years and I read >just about every email. I'll let you all know when >I'm at the point that I understand half of it :-) , >but I have a very good memory and this much I do know: > >1. ALL of you "list regulars" post in plain text, and >ALMOST all of the spam has been posted either in a >language other than English or in HTML (for the visual >ad value). I for one would be entirely in favor of simply filtering out all HTML messages. (I personally find HTML email rather irritating, even when it's not spam.) > >2. SPUG doesn't sound like anything obscene, it sounds >like a potato. Meryll, you have an *obscenely* clean mind! ;-) -jason ----- End forwarded message ----- -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From otter101 at hotmail.com Tue Apr 9 09:55:34 2002 From: otter101 at hotmail.com (Steve Cartoon) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: The Spam Problem Message-ID: G'day! I agree with Dancerboy back there. I've read all the posts (albeit as more of a lurker than much else) and I've yet to find a one that wasn't plaintext. And that's a very easy regexp to make to catch/strip HTML tags of any kind in a message. Or certain keywords that would never be used in the general context of this group. But the real (and rather trivial) reason I'm writing here is the word SPUG. It does sound like a potato (and if we constructed a User's Directory, we would be.), but I've seen the actual word in use in some comics. Batman and Judge Dredd, I think they were. Unfortunately, in both instances it was used in the context of a henchman/gang member. So much for culture. Feh. Is it just me, or does the job market in Seattle actually appear to be picking up a bit? I got a phone call AND a rejection yesterday, and that's more than I got in the last six months. Back to the shadows, again... Steve Cartoon "Where am I?" "Well, you can't get there from here." "But I'm looking for the same old place!" "Oh, you must mean the old Same place. It's right out back." _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From ben at reser.org Tue Apr 9 12:16:26 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Closing SPUG-list In-Reply-To: <20020409011741.A43603@www.ladro.com>; from cwilkes-spug@ladro.com on Tue, Apr 09, 2002 at 01:17:41AM -0700 References: <20020408184851.A13052@timji.consultix.wa.com> <20020408203107.B13603@timji.consultix.wa.com> <20020409011741.A43603@www.ladro.com> Message-ID: <20020409101625.C6388@gyrus.brain.org> On Tue, Apr 09, 2002 at 01:17:41AM -0700, Chris Wilkes wrote: > folder-hook spug set from=\"Chris Wilkes \" set from is inteneded only for use to set your default from address. my_hdr is the prefered method. IIRC set from will not work properly in some places (send hooks for example). set envelope_from is a good idea however. -- Ben Reser http://ben.reser.org What difference does it make to the dead, the orphans, and the homeless, whether the mad destruction is wrought under the name of totalitarianism or the holy name of liberty and democracy? - Ghandi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From creede at penguinsinthenight.com Tue Apr 9 12:30:22 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: The Spam Problem In-Reply-To: Message-ID: On Tue, 9 Apr 2002, Steve Cartoon wrote: > G'day! > I agree with Dancerboy back there. I've read all the posts (albeit as > more of a lurker than much else) and I've yet to find a one that wasn't > plaintext. And that's a very easy regexp to make to catch/strip HTML tags > of any kind in a message. Or certain keywords that would never be used in > the general context of this group. > Actually it's fairly trivial with Mail::Audit (I figured since this is a Perl newsgroup, I could mention Mail::Audit, which I've been enamored of ever since Simon Cozens described it in The Perl Journal): my $type = $mail->get('content-type'); chomp $type; if ($type =~ m#text/html#) { $mail->put_header("X-Fall-Through: This could be spam!"); $mail->accept($spam_mailbox); } This traps about 3/4 of my spam, as well as letters from my sister, bless her heart, who loves to send me these cute HTML-ized greeting cards that I have to jump through hoops to read. If it wasn't for her and the possibility that I might get a mail from someone I haven't heard from in a long time who doesn't know better (which has happened to me a few times), I'd use the following instead: $mail->reject("Quit sending me HTML mail, dag nabbit!"); Of course this is more useful to people using Unixish mail setups than those who are on Exchange, which is a pity, because Windows could use the capability to implement this kind of filtering. -- * .~. `( ---------------------------------------------------------------- ` / V \ . Creede Lambard : The box said 'Requires Win 98 or /( )\ creede@penguinsinthenight.com : better', so I installed Linux. ^^-^^ ---------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From lists at forevermore.net Tue Apr 9 13:01:36 2002 From: lists at forevermore.net (Chris Petersen) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: unsupported %SIG in ActivePerl?? Message-ID: Hi, on the advice of a coworker, I signed up for the spug-list.. hopefully someone here can help me out with a particular problem I'm having with ActivePerl... Basically, I have a rather large collection of web robots (300+), and I've written a scheduler for them based on the pre-forking server model presented in the perl documentation (with a few modifications since that one doesn't work quite right under linux - and NOTHING works in windows). Most people in alt.perl.* just tell me not to use NT/2k (which is my opinion, too) but that's not really an option, and I'm hoping that someone here can help me out with a workaround. Sorry for the lack of re-editing, but it's a lot easier to just forward the message I sent to ActiveState than try to rewrite it - all of the information is the same. -Chris ----------------- you list the standard perl IPC docs at: http://aspn.activestate.com/ASPN/Products/ActivePerl/lib/Pod/perlipc.html However, I've copied this code almost verbatim into a pre-forking server that I wrote (it works perfectly in linux and under cygwin).. However, it never receives $SIG{CHLD} handlers when I run it in Windows (98, NT and 2000). Again following the code you list, I ran: use Config; foreach $name (split(' ', $Config{sig_name})) { print "$name\n"; } This resulted in a rather lengthy list of signal handlers, including CHLD. This tells me that NT should be supporting the signal properly. The pre-forking server is designed to run $Max forked processes (which basically "require" a subscript and then exit), and to fork off new ones when the old ones die off.. However, since $SIG{CHLD} is never received, it merely runs $Max scripts and then hangs, waiting for them to finish, even when the processes themselves consist entirely of something to the extent of: #!/usr/bin/perl print "test\n"; exit; $SIG{INT} and other similar signals *do* work, so it's seemingly only the CHLD (and possibly other related) signal that doesn't. I've tracked the memory usage of perl while the pre-forking server runs, and the block does grow appropriately for each instance of a forked process, and eventually deflates back down after a few seconds, as the subscripts finish (telling me that fork itself is working fine). I need to confirm with you that this is a bug in your software or a glitch in Windows (I'm pretty sure it's not my code since it's the same code that pops up all over the place in the perl IPC docs - includin the ones you publish on your site). If it is a fixable error, do you have any idea when a working version of ActivePerl might be available? Thanks, Chris Petersen Programmer, VersusLaw Inc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 9 13:58:14 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Testing - ignore Message-ID: <20020409115814.A19470@timji.consultix.wa.com> Just testing, please ignore -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From creede at penguinsinthenight.com Tue Apr 9 14:20:57 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: unsupported %SIG in ActivePerl?? In-Reply-To: Message-ID: On Tue, 9 Apr 2002, Chris Petersen wrote: > $SIG{INT} and other similar signals *do* work, so it's seemingly only the > CHLD (and possibly other related) signal that doesn't. There's a number of signals that Windows just doesn't implement and Perl can't fake. CHLD must be one of them, but it's been a while since I worked with ActivePerl so I can't tell you which ones they are. -- * .~. `( ------------------------------------------------ ` / V \ . Creede Lambard : Geek by nature. /( )\ creede@penguinsinthenight.com : Linux by choice. ^^-^^ ------------------------------------------------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From lists at forevermore.net Tue Apr 9 14:35:44 2002 From: lists at forevermore.net (Chris Petersen) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: unsupported %SIG in ActivePerl?? In-Reply-To: Message-ID: > > $SIG{INT} and other similar signals *do* work, so it's seemingly only the > > CHLD (and possibly other related) signal that doesn't. > There's a number of signals that Windows just doesn't implement and Perl > can't fake. CHLD must be one of them, but it's been a while since I worked > with ActivePerl so I can't tell you which ones they are. That's what I originally thought, but the Config module reports that CHLD is supported. My only guess is that it has something to do with the fact that ActivePerl uses its own thread manager to handle fork (its own PID's etc - totally separate from the OS), rather than creating separate Windows processes. But that's just a theory. Anyway, I'm still open for suggestions if anyone else has any ideas they're willing to offer -Chris - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Tue Apr 9 14:37:21 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: unsupported %SIG in ActivePerl?? In-Reply-To: Message-ID: Windows doesn't actually have all of the signals that UNIX does. The following signals are listed in the MSDN Library: signal Description -------------------------------- SIGABRT Abnormal termination SIGFPE Floating-point error SIGILL Illegal instruction SIGINT CTRL+C signal SIGSEGV Illegal storage access SIGTERM Termination request My experience with ActiveState Perl on Windows 2000 leads me to believe that the rest of the signals that one would expect (including CHLD) don't ever fire under Windows. So they would have to be emulated somehow in Perl to work at all. Moreover there are some weird caveats even for the ones that _do_ exist. Like I don't think you can raise them all, some of them can only be raised by the operating system (or something like that). >From the ActiveState documentation (under Windows Specifics/Quirks): Signals are unsupported by the Win32 API. The C Runtime provides crude support for signals, but there are serious caveats, such as inability to die() or exit() from a signal handler. Perl itself does not guarantee that signal handlers will not interrupt critical operations such as memory allocation, which means signal invocation may throw perl internals into disarray. For these reasons, signals are unsupported at this time. So in general, it isn't wise to depend upon signals in code that has to run on Windows. Better to find some other mechanism to achieve the same goal. Marc M. Adkins MMADKI@Doorways.org P.S. I just submitted a resume to admin@veruslaw.com...is that you guys? > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Chris Petersen > Sent: Tuesday, April 09, 2002 11:02 AM > To: spug-list@pm.org > Subject: SPUG: unsupported %SIG in ActivePerl?? > > > Hi, on the advice of a coworker, I signed up for the spug-list.. > hopefully someone here can help me out with a particular problem I'm > having with ActivePerl... > > Basically, I have a rather large collection of web robots (300+), and I've > written a scheduler for them based on the pre-forking server model > presented in the perl documentation (with a few modifications since that > one doesn't work quite right under linux - and NOTHING works in > windows). > Most people in alt.perl.* just tell me not to use NT/2k (which is my > opinion, too) but that's not really an option, and I'm hoping that someone > here can help me out with a workaround. > > Sorry for the lack of re-editing, but it's a lot easier to just forward > the message I sent to ActiveState than try to rewrite it - all of the > information is the same. > > -Chris > > ----------------- > > you list the standard perl IPC docs at: > > http://aspn.activestate.com/ASPN/Products/ActivePerl/lib/Pod/perlipc.html > > However, I've copied this code almost verbatim into a pre-forking server > that I wrote (it works perfectly in linux and under cygwin).. However, it > never receives $SIG{CHLD} handlers when I run it in Windows (98, NT and > 2000). Again following the code you list, I ran: > > use Config; > > foreach $name (split(' ', $Config{sig_name})) { > print "$name\n"; > } > > > This resulted in a rather lengthy list of signal handlers, > including CHLD. > This tells me that NT should be supporting the signal properly. > > The pre-forking server is designed to run $Max forked processes (which > basically "require" a subscript and then exit), and to fork off new ones > when the old ones die off.. However, since $SIG{CHLD} is never received, > it merely runs $Max scripts and then hangs, waiting for them to finish, > even when the processes themselves consist entirely of something to the > extent of: > > #!/usr/bin/perl > print "test\n"; > exit; > > $SIG{INT} and other similar signals *do* work, so it's seemingly only the > CHLD (and possibly other related) signal that doesn't. I've tracked the > memory usage of perl while the pre-forking server runs, and the > block does > grow appropriately for each instance of a forked process, and eventually > deflates back down after a few seconds, as the subscripts finish (telling > me that fork itself is working fine). > > I need to confirm with you that this is a bug in your software or > a glitch > in Windows (I'm pretty sure it's not my code since it's the same > code that > pops up all over the place in the perl IPC docs - includin the ones you > publish on your site). If it is a fixable error, do you have any idea > when a working version of ActivePerl might be available? > > Thanks, > > Chris Petersen > Programmer, VersusLaw Inc. > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From dancerboy at strangelight.com Tue Apr 9 15:22:28 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: SPUG spam In-Reply-To: <20020409063406.D13973@timji.consultix.wa.com> References: <20020409063406.D13973@timji.consultix.wa.com> Message-ID: Oops! Forgot that I had originally subbed to this list from a different address. I've re-subbed from my correct address now. Sorry about that. (When I first subscribed, I was worried that "dancerboy" didn't sound "professional" enough for a Perl list... I've since realized that hey, this is Seattle: if I can show up to a job interview with blue hair and a face full of piercings, I can certainly participate in a Perl discussion group with the screen name "dancerboy" :-P ) -jason At 6:34 am -0700 2002-04-09, Tim Maher wrote: >NOTE: Posting on this list is now restricted to subscribers (specifically, >your From: header must show an address that matches one on the list). >This message was forwarded as a convenience to the poster, but I won't be >doing this (manually) for long! 8-} > >-Tim > >====================================================== >| Tim Maher, Ph.D. tim@timmaher.org | >| SPUG Founder & Leader spug@seattleperl.org | >| Seattle Perl Users Group www.seattleperl.org | >====================================================== >----- Forwarded message from owner-spug-list@pm.org ----- > >From: owner-spug-list@pm.org >Date: Tue, 9 Apr 2002 01:53:53 -0500 >X-Authentication-Warning: mail.pm.org: majordomo set sender to >owner-spug-list@pm.org using -f >To: spug-list-approval@pm.org >Subject: BOUNCE spug-list@pm.org: Non-member submission from >[dancerboy ] > >>From tim@consultix-inc.com Tue Apr 9 01:53:51 2002 >Received: from mail.cablespeed.com (mail.cablespeed.com [216.45.96.99]) > by mail.pm.org (8.11.6/8.11.3) with SMTP id g396roM27741 > for ; Tue, 9 Apr 2002 01:53:50 -0500 >Received: (qmail 1584 invoked by uid 0); 9 Apr 2002 06:50:10 -0000 >Received: from unknown (HELO ?64.255.216.47?) (64.255.216.47) > by mail.cablespeed.com with SMTP; 9 Apr 2002 06:50:10 -0000 >Mime-Version: 1.0 >X-Sender: etranger/strangelight.com@europa.your-site.com >Message-Id: >In-Reply-To: <20020408224341.77359.qmail@web12806.mail.yahoo.com> >References: <20020408224341.77359.qmail@web12806.mail.yahoo.com> >Date: Mon, 8 Apr 2002 23:49:51 -0700 >To: Meryll Larkin , > Douglas Kirkland , spug-list@pm.org >From: dancerboy >Subject: Re: SPUG: SPUG Spam >Content-Type: text/plain; charset="us-ascii" ; format="flowed" > >At 3:43 pm -0700 2002-04-08, Meryll Larkin wrote: >>4/8/02 >> >>Hi Folks, >> >>I've been on this list for almost 4 years and I read >>just about every email. I'll let you all know when >>I'm at the point that I understand half of it :-) , >>but I have a very good memory and this much I do know: >> >>1. ALL of you "list regulars" post in plain text, and >>ALMOST all of the spam has been posted either in a >>language other than English or in HTML (for the visual >>ad value). > >I for one would be entirely in favor of simply filtering out all HTML >messages. (I personally find HTML email rather irritating, even when >it's not spam.) > >> >>2. SPUG doesn't sound like anything obscene, it sounds >>like a potato. > >Meryll, you have an *obscenely* clean mind! ;-) > >-jason > >----- End forwarded message ----- > >-- >*==============================================================================* >| Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask >for FAX# | >| tim@consultix-inc.com teachmeperl.com teachmeunix.com >teachmelinux.net | >| APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl >JULY: Perl | >*------------------------------------------------------------------------------* >| NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; >Seattle, 7/15-18 | >| Adv. OOP * Adv. Module Implementation Techniques * Programming >in Perl 6 | >*==============================================================================* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Tue Apr 9 16:26:55 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: unsupported %SIG in ActivePerl?? In-Reply-To: Message-ID: > Anyway, I'm still open for suggestions if anyone else has any ideas > they're willing to offer In looking back at your original post you talk about 300+ processes. All of these are going to be running as threads under a single perl interpreter. This may in itself be bad. There are warnings about using up system resources in this way, since your single scheduler process will end up with the sum total of all open file handles for all of its forked children. The Win32::Process module provides a way to create sub-processes via Win32 that are real processes. It might be better to hack your code to use these routines instead of fork() in your scheduler. Of course, you're still lacking the $SIG{CHLD}...you still need to actively track the status of the child processes. Part of the answer to your question will depend on the top-level structure of your scheduler. BTW, if you recompile Perl without ithreads you can enable the older Thread.pm module which apparently works just fine. This would give you extra thread(s) for tracking the child processes without messing up your scheduler's top-level structure. mma - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 9 19:44:32 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Apr Meeting: "Damianiacal Modules" Message-ID: <20020409174432.A21749@timji.consultix.wa.com> NOTE: See comments below about pre-meeting Dinner and Drinks April 2002 Seattle Perl User's Group Meeting ------------------------------------------------------ Title: "Damianiacal Modules", Part #1 Speaker: Various SPUGsters Time: Tuesday, April 16, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ Topics: The theme for this meeting, as well as those for May and June (if participation alows), will be a look at some of the many modules contributed by Damian Conway to the CPAN. The idea is that SPUGsters who are using his modules can describe them to us, show us how they're using them in their work, and give us a greater appreciation for what Damian has made available and how we might increase our productivity by using his software. Alternatively, those who have merely been *thinking* about using a certain module might seize this opportunity to lead a discussion on it, to inspire them to learn more about them. (There's nothing like committing to teaching somebody about something to motivate you to increase your understanding of it!) Not coincidentally, the timing of these meetings will allow any questions that arise about "Damianiacal Modules" to be answered by The Damian himself, when he visits us in July. Those wishing to participate please post a short message to the list indicating what module(s) you want to cover, how you are currently using it (if so), and for which meeting you'd like your presentation scheduled. I'll serve as moderator, and get back to you with Module "Bindings". Also not coincidentally, those attending these meetings will be told how they can help continue the flow of Damianiacal Modules, by contributing to The Perl Foundation. Please bring your checkbooks along! 8-} Here's a list of Damian's currently released modules, from which you can pick and choose when designing your presentation: Damian's CPAN Modules Acme-Bleach Attribute-Handlers Attribute-Handlers-Prospective Attribute-Types Class-Contract Class-Delegation Class-Multimethods Coy Filter-Simple Getopt-Declare Hook-LexWrap Inline-Files Lingua-EN-Inflect Lingua-Romana-Perligata Parse-RecDescent Perl6-Variables Quantum-Superpositions Regexp-Common Switch Text-Autoformat Text-Balanced Text-Reform Tie-SecureHash The recommended pre-meeting diner is the Cedars restaurant, at 50th St. and Brooklyn, in the University District, near the Safeco building where the meeting will take place. The phone number is 527-5247. If you're planning to be there, please post a message to the list indicating your expected arrival time. (Tim is teaching "Intermediate Perl" next week, and will be lucky to just arrive at the meeting on time). As usual, those seeking liquid input may choose to congregate at the Bigtime Brewery and Alehouse, to conduct their preparations for the 7pm meeting. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From beckyls at u.washington.edu Wed Apr 10 12:28:20 2002 From: beckyls at u.washington.edu (Rebecca L. Schmidt) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX/Linux Administration Program Message-ID: I think some folks on this list might be interested in this new, intensive UW UNIX/Linux Administration Certificate Program so I'm posting the information here. If you have any questions feel free to contact me. The UNIX/Linux Administration Certificate Program is for people with basic UNIX or Linux knowledge who wish to plan, support and administer UNIX/Linux networks. This program is especially useful for individuals seeking career change or advancement, and preparing for LPI Linux Certification. For more information see: http://www.outreach.washington.edu/extinfo/certprog/uad/uad_main.asp We will be holding a free information meeting on Thursday, May 2, 2002, 6-6:45 p.m., at UW Educational Outreach, 2445 140th Ave. NE, Suite B-100 in Bellevue. At this meeting you'll have a chance to meet the instructor in person and learn more about the program. Please feel free to attend and let me know if you need directions. Here's more information about the program: Classes in the hands-on, intensive eight-week format meet in UW Extension's Bellevue computer lab on Tuesdays and Thursdays, June 11-August 1, 2002. Applications for this program are now being accepted. The deadline for submitting an application is 5 p.m. on May 17, 2002. You can find application information via the URL above. The instructor is Phil Nesser, a recognized authority on networking, security and data communications. He taught many classes for the UW. He has worked with the Internet Engineering Task Force since 1994 and has authored and contributed to numerous technical reports. A graduate of MIT, he served as an advisor to the President's Y2K Task Force. If you have any questions about the program please do not hesitate to contact me directly. My contact info is below. Best regards, Rebecca Schmidt Academic Programs University of Washington Extension 5001 25th Ave NE, Seattle, WA 98105-4190 rschmidt@ese.washington.edu (206) 221-6243 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From joesaphiloff at onebox.com Sat Apr 13 20:20:43 2002 From: joesaphiloff at onebox.com (Joe Saphiloff) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX/Linux Administration Program Message-ID: <20020414012043.OIUC4919.mta05.onebox.com@onebox.com> just FYI, there is NO GI bill support for this program... I checked. -- "Let your brain go and see what it brings back" Joe Saphilof joesaphiloff@onebox.com - email (425) 586-6719 - voice mail/fax ---- "Rebecca L. Schmidt" wrote: > > I think some folks on this list might be interested in this new, intensive > UW UNIX/Linux Administration Certificate Program so I'm posting the > information here. If you have any questions feel free to contact me. > > The UNIX/Linux Administration Certificate Program is for people with > basic > UNIX or Linux knowledge who wish to plan, support and administer > UNIX/Linux networks. This program is especially useful for individuals > seeking career change or advancement, and preparing for LPI Linux > Certification. For more information see: > > http://www.outreach.washington.edu/extinfo/certprog/uad/uad_main.asp > > We will be holding a free information meeting on Thursday, May 2, 2002, > 6-6:45 p.m., at UW Educational Outreach, 2445 140th Ave. NE, Suite > B-100 > in Bellevue. At this meeting you'll have a chance to meet the instructor > in person and learn more about the program. Please feel free to attend > and let me know if you need directions. > > Here's more information about the program: > > Classes in the hands-on, intensive eight-week format meet in UW > Extension's Bellevue computer lab on Tuesdays and Thursdays, June 11-August > 1, 2002. Applications for this program are now being accepted. The > deadline for submitting an application is 5 p.m. on May 17, 2002. > You can > find application information via the URL above. > > The instructor is Phil Nesser, a recognized authority on networking, > security and data communications. He taught many classes for the UW. > He > has worked with the Internet Engineering Task Force since 1994 and > has > authored and contributed to numerous technical reports. A graduate > of > MIT, he served as an advisor to the President's Y2K Task Force. > > If you have any questions about the program please do not hesitate > to > contact me directly. My contact info is below. > > > Best regards, > > Rebecca Schmidt > Academic Programs > University of Washington Extension > 5001 25th Ave NE, Seattle, WA 98105-4190 > rschmidt@ese.washington.edu > (206) 221-6243 > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - > 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://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Mon Apr 15 00:20:00 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX::Sysadmin (forwarded) Message-ID: <20020414222000.A4396@timji.consultix.wa.com> Hey people, I am looking to write some tools for a system of mine, so that people will be able to, without extensive unix knowledge, be able to respond to a problem with the server. Granted, the most I expect is that it can restart processes, and maybe some diagnostics, but for the most part, that's why people page me. I was just going to use unix system(), but then I thought there might be a module someone's already written. I ran into UNIX::Sysadmin, but haven't had any luck finding any docs about it. Has anyone had any experience with this module, and if so, is this the module for me, or is there a better package to look into? _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.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://seattleperl.org From timm at gleason.to Mon Apr 15 06:00:24 2002 From: timm at gleason.to (Timm Gleason) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX::Sysadmin (forwarded) In-Reply-To: <20020414222000.A4396@timji.consultix.wa.com> Message-ID: I haven't looked at this module, but I did find this thread, started by the author od Unix::Sysadmin in the modules-authors@perl.org list: http://archive.develooper.com/module-authors@perl.org/msg00089.html I appears to have some useful information. Monday, April 15 2002 -- | As easy as Timm Gleason | 3.14159265358979323846264338327950288 http://www.gleason.to/ | 419716 http://www.uranushertz.to/ | Quis custodiet iposos custodes? | -----PGP PUBLIC KEY BLOCK AVAILABLE----- On Sun, 14 Apr 2002, Tim Maher wrote: > Hey people, > > I am looking to write some tools for a system of mine, so that people will > be able to, without extensive unix knowledge, be able to respond to a > problem with the server. Granted, the most I expect is that it can restart > processes, and maybe some diagnostics, but for the most part, that's why > people page me. > > I was just going to use unix system(), but then I thought there might be a > module someone's already written. I ran into UNIX::Sysadmin, but haven't > had any luck finding any docs about it. Has anyone had any experience with > this module, and if so, is this the module for me, or is there a better > package to look into? > > _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ > -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ > MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.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://seattleperl.org > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From james at banshee.com Mon Apr 15 09:05:18 2002 From: james at banshee.com (James Moore) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX::Sysadmin (forwarded) In-Reply-To: Message-ID: <004101c1e486$935de780$797ba8c0@gealach> Have you looked at http://www.webmin.com/? ------------------------------------------------------------ James M. Moore james@banshee.com Banshee Software: Web software development Open Source / .NET / Embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From dragon at dreamhaven.net Mon Apr 15 09:11:24 2002 From: dragon at dreamhaven.net (Mikel Tidwell) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX::Sysadmin (forwarded) In-Reply-To: <004101c1e486$935de780$797ba8c0@gealach> Message-ID: Hrmm, this looks promising, especially the FreeBSD support. The only problem is it doesn't work when the web server stops responding, like it did midday Sunday, which prompted my whole "build a tool so someone else can fix it" idea. I think I need a shell based tool this time. Very useful for some other projects though... ;> Thanks. _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - On Mon, 15 Apr 2002, James Moore wrote: -> Have you looked at http://www.webmin.com/? -> -> ------------------------------------------------------------ -> James M. Moore -> james@banshee.com -> Banshee Software: Web software development -> Open Source / .NET / Embedded -> -> -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From james at banshee.com Mon Apr 15 09:24:54 2002 From: james at banshee.com (James Moore) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: UNIX::Sysadmin (forwarded) In-Reply-To: Message-ID: <004201c1e489$52900ff0$797ba8c0@gealach> True, but don't forget it's using its own web server, not Apache. Probably less likely to go down, as webmin is the only thing using it and it's unaffected by any user code that may reside somewhere like cgi-bin. (Not saying you're not right to want a shell tool, just adding info.) ------------------------------------------------------------ James M. Moore james@banshee.com Banshee Software: Web software development Open Source / .NET / Embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Mon Apr 15 13:35:39 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Kahn on Coy and Haikus Message-ID: <20020415113525.A6269@timji.consultix.wa.com> SPUGsters, You'll find below information submitted by Jeremy Kahn, who has volunteered to talk about The Damian's "Coy.pm" module, and his own variation on it, in which he has divorced the Haiku generator from the error-code stuff. And, by the way, there's still room on the agenda for others who wish to contribute a talk on another Damianiacal module for tomorrow's meeting (4/16, 7pm, Safeco Building, Seattle). To paraphrase from our group's charter, "SPUG is an educational cooperative, where people share their knowledge about Perl". This being the case, SPUG works best when people step forward to contribute. So please consider making a presentation at tomorrow's talk (after contacting me first), or if you need more lead time, for the May or June meetings (all of which are dedicated to Exploring Damian's Perl contributions). Currently, Tim Maher and Colin Meyer are the other SPUGsters who will be making presentations. JEREMY KAHN SAYS: What will I cover? << Coy.pm to my(Lingua::EN::Haiku), or "How to Hack the Damian and Live" >> I'll talk about: * what Coy does * how to use it * how it works * how I subverted Coy -- well, at least the language parts -- for my own evil purposes in an attempt at rebuilding a separate module and a "Warning to Newbies:" "do not use this approach on Damian's modules without strong drink" * some possible directions to take Coy and/or Lingua::EN::Haiku Who is Jeremy Kahn? * a computational linguist and software engineer at Conversay, where he irritates people by saying "oh, that's an easy tool in Perl" too often, and where he started a company PUG. * the instructor for WashTech's Perl courses (http://www.washtech.org/wt/training) starting in May. * somebody who has never met the man, but thinks Sean M. Burke is pretty cool, based strictly on his contributions to The Perl Journal. * the guy who reads Email delivered to . ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Mon Apr 15 19:49:10 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Filter::Simple by J.P. tomorrow too Message-ID: <20020415174910.B7019@timji.consultix.wa.com> --->SPUG alert<--- "El JoPe Magnifico" , otherwise known as JP, has volunteered to talk about the use of the Damianiacal "Filter::Simple" module to allow indentation within Here-Documents (as in the Korn and Bash shells). As JP himself puts it: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Normal Perl here-doc syntax is like this: ## Consider this column 0. ## Consider this the current indentation level. do_something(); print < Message-ID: <00c101c1e554$a7272aa0$3388ddd1@aciwin> What's wrong with this (paraphrased from my memory of the Camel book section on here docs, may not have the syntax right): ($test = < To: Sent: Monday, April 15, 2002 5:49 PM Subject: SPUG: Filter::Simple by J.P. tomorrow too > --->SPUG alert<--- > > "El JoPe Magnifico" , otherwise known as JP, has > volunteered to talk about the use of the Damianiacal "Filter::Simple" > module to allow indentation within Here-Documents (as in the Korn and > Bash shells). > > As JP himself puts it: > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > Normal Perl here-doc syntax is like this: > > ## Consider this column 0. > ## Consider this the current indentation level. > do_something(); > print < some text > END_MARKER > do_something_else(); > > The here'd text and end-marker breaks up code indentation. > > In bash, however, you can prepend a hyphen to your end-marker, > to indicate that leading tabs should be stripped from following > lines up to and including the end-marker, e.g.: > > do_something > cat - <<-END_MARKER > some text > END_MARKER > do_something_else > > This allows you to maintain proper indentation. My talk will be an > attempt to grok this same behavior with Filter::Simple. Which in fact, > may not be possible, but along the way to discovering this, much is > illustrated. =) > > -jp > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > There's still room for additional talks on tomorrow's agenda, so let me > know if YOU (yes *you*, you chronic Lurker you) are willing to share your > knowledge with your fellow SPUGsters. > > *=========================================================================== ===* > | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | > | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | > | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | > *--------------------------------------------------------------------------- ---* > | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | > | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | > *=========================================================================== ===* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 16 10:15:56 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Re: Filter::Simple by J.P. tomorrow too In-Reply-To: <00c101c1e554$a7272aa0$3388ddd1@aciwin> References: <20020415174910.B7019@timji.consultix.wa.com> <00c101c1e554$a7272aa0$3388ddd1@aciwin> Message-ID: <20020416081556.A2529@timji.consultix.wa.com> On Tue, Apr 16, 2002 at 07:40:03AM -0700, Richard Anderson wrote: > What's wrong with this (paraphrased from my memory of the Camel book section > on here docs, may not have the syntax right): > > ($test = < This is > my indented > here document. > END > > Cheers, > Richard > richard@richard-anderson.org > www.richard-anderson.org > www.raycosoft.com You have to fudge the "Framing Word" to include the quotes too, and add /gm: ($test = <<' END' ) =~ s/^\s+//gm; This is my indented here document. END print "$test"; What's wrong is that this is a kludge imposed as a burden on the user to simulate a convenient feature provided by the modern UNIX shells. Sure, you can write the hideous code shown above , but I think most would agree that it would be nicer to have Perl handle this itself. Because it doesn't (currently), patching the language through Source Filtering is a way to get that funtionality. My guess is that this has been a sufficient annoyance to JP that he seized the opportunity to use this as a test case for explorations in the world of Source Filtering (the excuses of needing Klingon and Latin functionality were already taken) 8-} -Tim *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 16 10:21:40 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Re: Filter::Simple by J.P. tomorrow too In-Reply-To: <00c101c1e554$a7272aa0$3388ddd1@aciwin> References: <20020415174910.B7019@timji.consultix.wa.com> <00c101c1e554$a7272aa0$3388ddd1@aciwin> Message-ID: <20020416082140.A2592@timji.consultix.wa.com> On Tue, Apr 16, 2002 at 07:40:03AM -0700, Richard Anderson wrote: > What's wrong with this (paraphrased from my memory of the Camel book section > on here docs, may not have the syntax right): > > ($test = < This is > my indented > here document. > END > > Cheers, > Richard > richard@richard-anderson.org > www.richard-anderson.org > www.raycosoft.com The whole gruesome story on kludging Here-Docs to act nicely follows. Enjoy! 8-} -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== $ perldoc -tq document Found in /usr/lib/perl5/5.6.1/pod/perlfaq4.pod Why don't my <op_ppaddr)() ); @@@ TAINT_NOT; @@@ return 0; @@@ } MAIN_INTERPRETER_LOOP Or with a fixed amount of leading whitespace, with remaining indentation correctly preserved: $poem = fix< I seem to be asking as many c questions as perl questions on this list, but I get great responses...so here's another. ;) I'm including "ndbm.h" for some basic database store/fetch routines in a c program. I'd like to be able to compile my program easily on different *nixes with different base database libraries. I know "gdbm.h" and the berkeley "db.h" provide compatibility with ndbm, as well as things like "db1/ndbm.h" on linux. Is there a standard way to detect which database library is present and include that one? Should I be use preprocessor directives like IFDEF...or a Makefile? Also, I notice that sometimes I need to link with a shared library version during compilation with an option like "-l ndbm". How would I detect if a shared library needs to be used? Any relevant info sources or examples would be great. Thanks, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Tue Apr 16 13:54:15 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Meeting preparations In-Reply-To: <20020409174432.A21749@timji.consultix.wa.com> Message-ID: Is anyone showing up at either of the pre-meeting locales? I'm new to SPUG, would like to meet a few people, but if no one is going to be there I'd rather just go to the meeting. Thx, Marc M. Adkins MMADKI@Doorways.org > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Tim Maher > Sent: Tuesday, April 09, 2002 5:45 PM > To: spug-list@pm.org > Subject: SPUG: Apr Meeting: "Damianiacal Modules" > > > NOTE: See comments below about pre-meeting Dinner and Drinks > > April 2002 Seattle Perl User's Group Meeting > ------------------------------------------------------ > Title: "Damianiacal Modules", Part #1 > Speaker: Various SPUGsters > Time: Tuesday, April 16, 2002 7-9pm > Location: SAFECO bldg, Brooklyn St. and NE 45th St. > Cost: Admission is free and open to the general public. > Info: http://seattleperl.org/ > > Topics: > The theme for this meeting, as well as those for May and > June (if participation alows), will be a look at some of > the many modules contributed by Damian Conway to the CPAN. > > The idea is that SPUGsters who are using his modules can > describe them to us, show us how they're using them in > their work, and give us a greater appreciation for what > Damian has made available and how we might increase our > productivity by using his software. Alternatively, those > who have merely been *thinking* about using a certain > module might seize this opportunity to lead a discussion > on it, to inspire them to learn more about them. > (There's nothing like committing to teaching somebody > about something to motivate you to increase your > understanding of it!) > > Not coincidentally, the timing of these meetings will > allow any questions that arise about "Damianiacal > Modules" to be answered by The Damian himself, when he > visits us in July. > > Those wishing to participate please post a short message > to the list indicating what module(s) you want to cover, > how you are currently using it (if so), and for which > meeting you'd like your presentation scheduled. I'll serve > as moderator, and get back to you with Module "Bindings". > > Also not coincidentally, those attending these meetings > will be told how they can help continue the flow of > Damianiacal Modules, by contributing to The Perl > Foundation. Please bring your checkbooks along! 8-} > > Here's a list of Damian's currently released modules, from > which you can pick and choose when designing your > presentation: > > Damian's CPAN Modules > Acme-Bleach > Attribute-Handlers > Attribute-Handlers-Prospective > Attribute-Types > Class-Contract > Class-Delegation > Class-Multimethods > Coy > Filter-Simple > Getopt-Declare > Hook-LexWrap > Inline-Files > Lingua-EN-Inflect > Lingua-Romana-Perligata > Parse-RecDescent > Perl6-Variables > Quantum-Superpositions > Regexp-Common > Switch > Text-Autoformat > Text-Balanced > Text-Reform > Tie-SecureHash > > The recommended pre-meeting diner is the Cedars restaurant, at > 50th St. and Brooklyn, in the University District, near the Safeco > building where the meeting will take place. The phone number is > 527-5247. If you're planning to be there, please post a message to > the list indicating your expected arrival time. (Tim is teaching > "Intermediate Perl" next week, and will be lucky to just arrive at > the meeting on time). > > As usual, those seeking liquid input may choose to congregate at > the Bigtime Brewery and Alehouse, to conduct their preparations > for the 7pm meeting. > > ====================================================== > | Tim Maher, Ph.D. tim@timmaher.org | > | SPUG Founder & Leader spug@seattleperl.org | > | Seattle Perl Users Group www.seattleperl.org | > ====================================================== > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 16 13:45:32 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Meeting preparations In-Reply-To: References: <20020409174432.A21749@timji.consultix.wa.com> Message-ID: <20020416114532.B3490@timji.consultix.wa.com> I would normally be at one of the pre-meeting gathering places, but today I'm teaching my "Intermediate Perl" class, and will be lucky to get to the meeting on time 8-} Anybody else planning to dine at Cedars, or get lubricated at the Big Time Brewery? If so, please post a message, so Marc (and others can hook up with you. -Tim *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* > Is anyone showing up at either of the pre-meeting locales? I'm new to SPUG, > would like to meet a few people, but if no one is going to be there I'd > rather just go to the meeting. > > Thx, > Marc M. Adkins > MMADKI@Doorways.org > > > -----Original Message----- > > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > > Tim Maher > > Sent: Tuesday, April 09, 2002 5:45 PM > > To: spug-list@pm.org > > Subject: SPUG: Apr Meeting: "Damianiacal Modules" > > > > > > NOTE: See comments below about pre-meeting Dinner and Drinks > > > > April 2002 Seattle Perl User's Group Meeting > > ------------------------------------------------------ > > Title: "Damianiacal Modules", Part #1 > > Speaker: Various SPUGsters > > Time: Tuesday, April 16, 2002 7-9pm > > Location: SAFECO bldg, Brooklyn St. and NE 45th St. > > Cost: Admission is free and open to the general public. > > Info: http://seattleperl.org/ > > > > Topics: > > The theme for this meeting, as well as those for May and > > June (if participation alows), will be a look at some of > > the many modules contributed by Damian Conway to the CPAN. > > > > The idea is that SPUGsters who are using his modules can > > describe them to us, show us how they're using them in > > their work, and give us a greater appreciation for what > > Damian has made available and how we might increase our > > productivity by using his software. Alternatively, those > > who have merely been *thinking* about using a certain > > module might seize this opportunity to lead a discussion > > on it, to inspire them to learn more about them. > > (There's nothing like committing to teaching somebody > > about something to motivate you to increase your > > understanding of it!) > > > > Not coincidentally, the timing of these meetings will > > allow any questions that arise about "Damianiacal > > Modules" to be answered by The Damian himself, when he > > visits us in July. > > > > Those wishing to participate please post a short message > > to the list indicating what module(s) you want to cover, > > how you are currently using it (if so), and for which > > meeting you'd like your presentation scheduled. I'll serve > > as moderator, and get back to you with Module "Bindings". > > > > Also not coincidentally, those attending these meetings > > will be told how they can help continue the flow of > > Damianiacal Modules, by contributing to The Perl > > Foundation. Please bring your checkbooks along! 8-} > > > > Here's a list of Damian's currently released modules, from > > which you can pick and choose when designing your > > presentation: > > > > Damian's CPAN Modules > > Acme-Bleach > > Attribute-Handlers > > Attribute-Handlers-Prospective > > Attribute-Types > > Class-Contract > > Class-Delegation > > Class-Multimethods > > Coy > > Filter-Simple > > Getopt-Declare > > Hook-LexWrap > > Inline-Files > > Lingua-EN-Inflect > > Lingua-Romana-Perligata > > Parse-RecDescent > > Perl6-Variables > > Quantum-Superpositions > > Regexp-Common > > Switch > > Text-Autoformat > > Text-Balanced > > Text-Reform > > Tie-SecureHash > > > > The recommended pre-meeting diner is the Cedars restaurant, at > > 50th St. and Brooklyn, in the University District, near the Safeco > > building where the meeting will take place. The phone number is > > 527-5247. If you're planning to be there, please post a message to > > the list indicating your expected arrival time. (Tim is teaching > > "Intermediate Perl" next week, and will be lucky to just arrive at > > the meeting on time). > > > > As usual, those seeking liquid input may choose to congregate at > > the Bigtime Brewery and Alehouse, to conduct their preparations > > for the 7pm 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://seattleperl.org From davidpa at avaya.com Tue Apr 16 15:36:37 2002 From: davidpa at avaya.com (Patterson, David S (Pat)) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: c question ;) Message-ID: <34D5B8848AEDE44ABAED1C52C1F04DC2159289@WA2005AVEXU1.global.avaya.com> May I suggest you redirect your question to a C/C++ group such as www.nwcpp.org . You can post questions to nwcpp-talk@dragoncat.net once you join the list. --- "Oh, no. not another learning experience!..." D. S. "Pat" Patterson Software Engineer Avaya, Inc. 6464 185th Ave NE Redmond, WA 98052-6736 425-558-8672 888-425-8727 Pgr davidpa@avaya.com -----Original Message----- From: Benjamin Franks [mailto:benjamin@dzhan.com] Sent: Tuesday, April 16, 2002 9:56 AM To: spug-list@pm.org Subject: SPUG: c question ;) I seem to be asking as many c questions as perl questions on this list, but I get great responses...so here's another. ;) I'm including "ndbm.h" for some basic database store/fetch routines in a c program. I'd like to be able to compile my program easily on different *nixes with different base database libraries. I know "gdbm.h" and the berkeley "db.h" provide compatibility with ndbm, as well as things like "db1/ndbm.h" on linux. Is there a standard way to detect which database library is present and include that one? Should I be use preprocessor directives like IFDEF...or a Makefile? Also, I notice that sometimes I need to link with a shared library version during compilation with an option like "-l ndbm". How would I detect if a shared library needs to be used? Any relevant info sources or examples would be great. Thanks, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From allyn at well.com Tue Apr 16 15:36:57 2002 From: allyn at well.com (Mark Allyn) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Meeting preparations In-Reply-To: Message-ID: I was planning to show up at ceders. Mark - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Tue Apr 16 18:11:33 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Meeting preparations In-Reply-To: <20020416114532.B3490@timji.consultix.wa.com> Message-ID: Oops...I just found out I'm leaving town tomorrow for work. Not having had an income in a while this takes priority. Sorry...I won't be there tonight...gotta pack and so forth. Thanks for the responses...maybe next time! Marc M. Adkins > > Is anyone showing up at either of the pre-meeting locales? I'm > new to SPUG, > > would like to meet a few people, but if no one is going to be there I'd > > rather just go to the meeting. > > > > Thx, > > Marc M. Adkins > > MMADKI@Doorways.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Tue Apr 16 17:10:46 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: RE: SPUG preparations Message-ID: <20020416151046.B4022@timji.consultix.wa.com> NOTE: I'm forwarding this message to the list, although it was initially rejected due to the wrong sender-address being on the attempted posting. -Tim For the 33rd straight meeting I am unable to attend, but I had to report that I nearly blew some Diet Coke out my nose reading Tim's message - imagining either the world's most amazing "out of office assistant" or Tim sitting at the front of the class surreptitiously sneaking a keystroke here or there like someone tunnelling out of their cell with a thumb-tack. I guess potty breaks are included in our august leader's "Intermediate Perl" class... Thanks, Ross. -----Original Message----- From: Tim Maher [mailto:tim@consultix-inc.com] Sent: Tuesday, April 16, 2002 11:46 AM Subject: Re: SPUG: Meeting preparations I would normally be at one of the pre-meeting gathering places, but today I'm teaching my "Intermediate Perl" class, and will be lucky to get to the meeting on time 8-} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From dancerboy at strangelight.com Tue Apr 16 18:27:16 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Meeting preparations In-Reply-To: <20020416114532.B3490@timji.consultix.wa.com> References: <20020409174432.A21749@timji.consultix.wa.com> <20020416114532.B3490@timji.consultix.wa.com> Message-ID: At 11:45 am -0700 2002-04-16, Tim Maher wrote: >... or get lubricated at the Big Time >Brewery? If so, please post a message, so Marc (and others can hook up with >you. "get lubricated"? Just what exactly goes on these SPUG meetings? They're starting to sound a lot more interesting than I thought. ;) Seriously, I'm planning on showing up to the meeting -- I may or may not make it to the Big Time Brewery beforehand. If I do: I'll be the one with the eyebrow piercing and the semi-weird blonde hair (no, it's not blue -- at least not this week) sitting next to a stack of geek books. -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://seattleperl.org From tim at consultix-inc.com Wed Apr 17 07:36:49 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: Testing - please ignore Message-ID: <20020417053649.D5633@timji.consultix.wa.com> Can't you follow directions? I said IGNORE this, darn it! -Tim *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From dancerboy at strangelight.com Fri Apr 19 01:42:24 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:52 2004 Subject: SPUG: shell script event loops + wrapping shell utilities Message-ID: So, I wanted to add some minor functionality to a couple of shell programs (telnet and ftp, specifically) and the simplest way seemed to be simply to wrap them in a Perl script, i/e simply make a Perl script that opens the program, and pipes input from the terminal (keystrokes) through to the program, and passes characters output from the program back to the terminal -- occasionally adding some extra keystrokes of its own (the added functionality) but mostly just acting as a "bidirectional pipe" between the program and the terminal. Here is the main wrapper part of the ftp version of the script (greatly stripped-down for clarity): ____________________________ #!/usr/bin/perl use strict; use Fcntl; use IPC::Open3; $| = 1; my $from_term; my $from_shell; my $pipe_error; open(TTY, "+ SPUGsters, Hope lots of you will be able to participate in the unique opportunities described below to socialize with and learn from Perl Guru Damian Conway! And remember the special SPUG-only deal I announced at last Tuesday's meeting: anybody who sends me a check payaable to The Perl Foundation (Damian's sponsor) for at least $100 will be entered into a drawing to win a free seat in one of Damian's July classes. -Tim *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* -------------- next part -------------- From: Tim Maher, CONSULTIX Subject: New Summer Classes; Damian Classes & Cruise *** NEW SUMMER SCHEDULE We've just announced some new Perl classes for June and July; the full schedule is included below. *** ADVANCED PERL WORKSHOP, now open for Registration! As is our custom in July, we'll be presenting the "Mad Doctor of Perl", Dr. Damian Conway, for a series of Seattle-area classes. This time he'll be offering his new "Advanced Perl Workshop", consisting of four courses: "Adv. OO Perl", "Adv. Module Implementation Techniques", "Programming in Perl 6", and "Beyond Regexes: Text Parsing with Perl Modules". You can register for individual classes or the whole set, at www.teachmeperl.com. *** CRUISE/DINNER WITH "THE DAMIAN" Those who register for two or more days of classes with Damian get a free cruise/dinner with him on 7/14, and a few others who register the earliest will be eligible to win that prize in a drawing. See http://www.teachmeperl.com for more information and to register. Detailed course information is always available at our web site, http://consultix-inc.com (aka teachmelinux.net, teachmeunix.com, and teachmeperl.com). CONSULTIX SUMMER PUBLIC CLASSES, Kirkland WA --------------------------------------------------------- COURSE DATES Days CLASSES BY Dr. Tim Maher: Perl Programming 6/03-6/05 3 Creating Perl Modules 6/06-6/07 1.5 ->Perl Prog + Modules 6/03-6/07 4.5 UNIX Fundamentals 6/10-6/13 4 Minimal Perl 6/14 1 OO Perl Fundamentals 7/08-7/11 3.5 CLASSES BY Dr. Damian Conway: Adv. OO Perl 7/15-7/16 2 Adv. Module Techniques 7/17 1 Programming Perl 6 7/18 1 Text Parsing with Modules 7/18 1 NOTE: First ones to register/pay eligible to win 7/14 dinner/cruise with Damian! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * COMMENTS FROM RECENT STUDENTS: Intermediate Perl Programming (4/15-17/02): "The overall course was superb. It was tailored to the level of the students, which ensured we got the most out of the information being presented." Tech Lead, AT&T Wireless Perl Programming: "The overall quality of the instruction was excellent. The instructor was able to provide knowledge to each student without slowing the faster students. One of the best courses I have attended." Curt Wolfer, MIS Manager, Menlo Worldwide +-----------------------------------------------------------+ CONSULTIX ON-LINE RESOURCES General Information: http://www.consultix-inc.com On-Site Training: http://www.consultix-inc.com/on-site.html Course Listings: UNIX/Shell, http://teachmeunix.com/unixlist.html Perl, http://teachmeperl.com/perllist.html Registration and Pricing: http://www.consultix-inc.com/reg.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Course Evaluations: http://www.consultix-inc.com/course_evals.html From moonbeam at catmanor.com Fri Apr 19 18:29:48 2002 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities Message-ID: <200204192329.g3JNTmJ13056@catmanor.com> I have done something simular, but I used a client/server approach. The client sets up a bi-directional socket communication with the server. The server just waits for commands and runs commands or does actions on behalf of the client. In this case, it just stats a file for directory, or tells them who is logged in. A fun little toy. The nice thing about this approach, the client and server don't have to be on the same computer. In the following example, the server does not fork, so it can only handle one client at a time. This I leave as an exercise to the reader. In perl, there is always more than one way to do it. Here is some sample code: -->cat biclient.pl #!/usr/bin/perl -w # # biclient - bidirectional forking client use strict; use IO::Socket; my($port, $host, $handle, $line, $kidpid); $port = "1999"; $host = "localhost"; # create a tcp connection to the specified host and port $handle = IO::Socket::INET->new(Proto => "tcp", PeerAddr => $host, PeerPort => $port) or die "can't connect to port $port on $host: $!"; $handle->autoflush(1); # so output gets there right away print "[Connected to $host:$port]\n"; # split the program into two processes, identical twins die "can't fork: $!" unless defined($kidpid = fork()); if ($kidpid) { # parent copies the socket to standard output while (defined ($line = <$handle>)) { print $line; } #kill("TERM" => $kidpid); # send SIGTERM to child } else { # child copies standard input to the socket while (defined ($line = <>)) { print $handle $line; } } -->cat stat_server.pl #!/usr/bin/perl -Tw # # server to listen on port 1999 and return a stat of a file # ### # # modules # use strict; use IO::Socket; # # secure environment # $ENV{PATH}=""; # # declare variables # my ($socket, # client socket connection $client, # client handle @stat, # file stat data ); # # make a socket connection to port 1999 # $socket = IO::Socket::INET->new(Proto=>"tcp", LocalPort=>"1999", Listen=>1 ) or die "Cannot create server socket: $!\n"; # # loop forever for client connections # while (1) { $client = $socket->accept; $client->autoflush(1); while (<$client>) { chomp; s/\r//; # client is done if ( "$_" eq "." ) { close $client; last; } # say hello (we are a friendly server) if ( "$_" eq "hello" ) { print $client "Hello. Nice to meet you.\n"; print $client "Please enter a file name.\n"; next; } # run a command if ( $_ eq "w" ) { print $client `/usr/bin/w`; next; } # server kill command if ( "$_" eq "kill" ) { close $client; close $socket; exit; } # stat a file or a directory if ( -e "$_" ) { @stat = stat("$_"); print $client "$_: @stat\n"; } else { print $client "File Not Found: $_\n"; } next; } } Sample Run: # # start the server # -->stat_server.pl & [2] 13035 # # Connect as a client # -->biclient.pl [Connected to localhost:1999] hello Hello. Nice to meet you. Please enter a file name. /vmlinuz /vmlinuz: 770 171 33188 1 0 0 0 972211 1015755887 1015755887 1015755887 4096 1910 /home/moonbeam /home/moonbeam: 779 80481 16877 47 502 100 0 8192 1019216446 1019089720 1019089720 4096 16 w 4:17pm up 37 days, 22:22, 6 users, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT moonbeam pts/2 gamymede.catmano 27Mar02 1:39 2.14s 0.05s mailx moonbeam pts/3 gamymede.catmano 3Apr02 23:15m 0.36s 0.05s -su moonbeam pts/4 gamymede.catmano 2Apr02 0.00s 55.19s 0.19s /usr/bin/perl - moonbeam pts/6 gamymede.catmano 6Apr02 5days 0.46s 0.46s -ksh moonbeam pts/7 whitecat.catmano Tue 4pm 2days 0.11s 0.11s -ksh moonbeam pts/8 whitecat.catmano Tue 7pm 2days 0.21s 0.21s -ksh /home/moonbeam/junk File Not Found: /home/moonbeam/junk . # # reconnect as a client and drop the server # -->biclient.pl [Connected to localhost:1999] hello Hello. Nice to meet you. Please enter a file name. kill [2] + Done stat_server.pl & --- 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";;";;"' > >So, I wanted to add some minor functionality to a couple of shell >programs (telnet and ftp, specifically) and the simplest way seemed >to be simply to wrap them in a Perl script, i/e simply make a Perl >script that opens the program, and pipes input from the terminal >(keystrokes) through to the program, and passes characters output >from the program back to the terminal -- occasionally adding some >extra keystrokes of its own (the added functionality) but mostly just >acting as a "bidirectional pipe" between the program and the terminal. > >Here is the main wrapper part of the ftp version of the script >(greatly stripped-down for clarity): > >____________________________ >#!/usr/bin/perl > >use strict; >use Fcntl; >use IPC::Open3; > >$| = 1; > >my $from_term; >my $from_shell; >my $pipe_error; > >open(TTY, "+fcntl( TTY, F_SETFL, O_NONBLOCK ); > >my $pid = open3( \*TO_SHELL, \*FROM_SHELL, \*SHELL_ERR, > 'ftp -v strangelight.com' >); > >fcntl( FROM_SHELL, F_SETFL, O_NONBLOCK ); >fcntl( SHELL_ERR, F_SETFL, O_NONBLOCK ); > >my $oldfh = select(FROM_SHELL); $| = 1; select($oldfh); >$oldfh = select(SHELL_ERR); $| = 1; select($oldfh); >$oldfh = select(TTY); $| = 1; select($oldfh); > >$SIG{PIPE} = sub { ++$pipe_error; }; > >while ( not $pipe_error ) { > while( defined( $from_term = getc(TTY) ) ) { > print TO_SHELL $from_term; > } > while( defined( $from_shell = getc(FROM_SHELL) ) ) { > print $from_shell; > } > while( defined( $from_shell = getc(SHELL_ERR) ) ) { > print $from_shell; > } >} > >__END__ > >Now, I have two questions. > >My first question is, admittedly, one of those "I could probably >figure it out on my own but I'm lazy so I'll ask the folks on SPUG >instead" questions: > >While my script works fairly well as-is, it's a real processor hog, >as you can probably guess. All of those getc() calls are >non-blocking, so even when there's no input or output to process, the >main while() loop still keeps executing over and over again, doing >absolutely nothing as fast as it possibly can. What's the >best/simplest way to tell Perl to "go to sleep, but wake up as soon >as something interesting happens"? > >My second question is one I've banged my head on for a while and >haven't been able to figure out at all: > >Even with setting $|=1 on all the open pipes, I still don't always >get my I/O flushed promptly -- in particular, the responses I read >back from FROM_SHELL seem often to be one or two lines behind what I >should be getting. (My work-around has been to send a no-op command >like 'pwd', the response to which usually forces the lines that I >want to see out of the buffer.) What else can I do to get my pipes >"piping hot" (as the perldocs say)? > >-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://seattleperl.org > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From doug at beaver.net Fri Apr 19 19:25:37 2002 From: doug at beaver.net (Doug Beaver) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities In-Reply-To: ; from dancerboy@strangelight.com on Thu, Apr 18, 2002 at 11:42:24PM -0700 References: Message-ID: <20020419202537.A49165@beaver.net> On Thu, Apr 18, 2002 at 11:42:24PM -0700, dancerboy wrote: > #!/usr/bin/perl > > use strict; > use Fcntl; > use IPC::Open3; > > $| = 1; > > my $from_term; > my $from_shell; > my $pipe_error; > > open(TTY, "+ fcntl( TTY, F_SETFL, O_NONBLOCK ); > > my $pid = open3( \*TO_SHELL, \*FROM_SHELL, \*SHELL_ERR, > 'ftp -v strangelight.com' > ); > > fcntl( FROM_SHELL, F_SETFL, O_NONBLOCK ); > fcntl( SHELL_ERR, F_SETFL, O_NONBLOCK ); > > my $oldfh = select(FROM_SHELL); $| = 1; select($oldfh); > $oldfh = select(SHELL_ERR); $| = 1; select($oldfh); > $oldfh = select(TTY); $| = 1; select($oldfh); > > $SIG{PIPE} = sub { ++$pipe_error; }; > > while ( not $pipe_error ) { > while( defined( $from_term = getc(TTY) ) ) { > print TO_SHELL $from_term; > } > while( defined( $from_shell = getc(FROM_SHELL) ) ) { > print $from_shell; > } > while( defined( $from_shell = getc(SHELL_ERR) ) ) { > print $from_shell; > } > } > > __END__ > > Now, I have two questions. > > My first question is, admittedly, one of those "I could probably > figure it out on my own but I'm lazy so I'll ask the folks on SPUG > instead" questions: > > While my script works fairly well as-is, it's a real processor hog, > as you can probably guess. All of those getc() calls are > non-blocking, so even when there's no input or output to process, the > main while() loop still keeps executing over and over again, doing > absolutely nothing as fast as it possibly can. What's the > best/simplest way to tell Perl to "go to sleep, but wake up as soon > as something interesting happens"? You want to use either select() or IO::Select. Check out your system manpage for select(2) to get a general idea of what it does and then check out the perldoc -f for select, it has an example of selecting on multiple filehandles. If it looks too daunting, you could use IO::Select's OO api too. select has a timeout option, so you can make it block forever or timeout after a given number of seconds. I bet the perl cookbook even has an example or two of select on filehandles, it's a common idiom. I don't have a copy handy, otherwise I would give you a pointer. The perldoc says you shouldn't mix select with buffered i/o, so maybe you want to use select & sysread instead. > My second question is one I've banged my head on for a while and > haven't been able to figure out at all: > > Even with setting $|=1 on all the open pipes, I still don't always > get my I/O flushed promptly -- in particular, the responses I read > back from FROM_SHELL seem often to be one or two lines behind what I > should be getting. (My work-around has been to send a no-op command > like 'pwd', the response to which usually forces the lines that I > want to see out of the buffer.) What else can I do to get my pipes > "piping hot" (as the perldocs say)? Sorry, I don't know about this. Maybe it has something to do with buffered i/o. You could try using sysread instead of <> for the i/o and see if that solves your problem. That combined with the select just might do the trick... Just be careful not to mix sysread with buffered reads (like read() or <>). Doug -- Space Ghost: Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. Moltar: Okay, but that's not the cd burner... Space Ghost: Moltar! Yes! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tuck at whistlingfish.net Fri Apr 19 20:00:59 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities In-Reply-To: References: Message-ID: <207810000.1019264459@[192.168.30.55]> -- dancerboy spake thusly: > So, I wanted to add some minor functionality to a couple of shell > programs (telnet and ftp, specifically) and the simplest way seemed > to be simply to wrap them in a Perl script, i/e simply make a Perl > script that opens the program, and pipes input from the terminal > (keystrokes) through to the program, and passes characters output > from the program back to the terminal -- occasionally adding some > extra keystrokes of its own (the added functionality) but mostly just > acting as a "bidirectional pipe" between the program and the terminal. I know this is a Perl list and all that, but have you considered using expect? It seems like it's designed for this sort of thing. -------------- 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/20020419/b2c104d6/attachment.bin From dancerboy at strangelight.com Sat Apr 20 16:11:41 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities In-Reply-To: <200204192329.g3JNTmJ13056@catmanor.com> References: <200204192329.g3JNTmJ13056@catmanor.com> Message-ID: At 4:29 pm -0700 2002-04-19, William Julien wrote: >I have done something simular, but I used a client/server approach. >The client sets up a bi-directional socket communication with the >server. The server just waits for commands and runs commands or does >actions on behalf of the client. In this case, it just stats a file >for directory, or tells them who is logged in. A fun little toy. The >nice thing about this approach, the client and server don't have to >be on the same computer. In the following example, the server does >not fork, so it can only handle one client at a time. This I leave >as an exercise to the reader. ??? I don't really understand what this has to do with my problem. As for the other suggestions: select(), whether invoked directly or via IO::Select, seems to block forever, regardless of what's coming in through the TTY. E.g. I tried adding this before my "event loop" (as per perldoc -f select): >sub fhbits { > my(@fhlist) = split(' ',$_[0]); > my($bits); > for (@fhlist) { > vec($bits,fileno($_),1) = 1; > } > return $bits; >} > >my $rin = fhbits('TTY FROM_SHELL SHELL_ERR'); And added this to the loop: > select( $rin, undef, undef, undef ); But this just blocked forever, even when there was definitely input on TTY. (Then, after I'd killed the hung process, all the lines that I had typed while the process was running were still in the buffer, and would get passed to the shell that had invoked the script.) I got similar results when I used IO::Select. My current solution, which works pretty well, is to use the select call as just a fine-grained "sleep" call: >while ( not $pipe_error ) { > while( sysread(TTY, $from_term, 1) ) { > print TO_SHELL $from_term; > } > while( sysread(FROM_SHELL, $from_shell, 1) ) { > myprint "$from_shell" if defined($from_shell); > } > while( sysread(SHELL_ERR, $from_shell, 1) ) { > myprint "$from_shell" if defined($from_shell); > } > select( undef, undef, undef, 0.1 ); >} The 0.1 second wait is short enough that it's not really noticeable, but long enough that it keeps the process from hogging the CPU. (I had earlier tried a similar trick with sleep(), but the 1-second delay -- the smallest that one can get with sleep() -- was really irritating.) Still, I wish I knew, just for my own edification, why select() isn't working the way it's supposed to. As for "Expect": it does look pretty cool. I'll have to look at it more when I get a chance... -jason > >In perl, there is always more than one way to do it. > >Here is some sample code: > >-->cat biclient.pl >#!/usr/bin/perl -w ># ># biclient - bidirectional forking client > >use strict; >use IO::Socket; >my($port, $host, $handle, $line, $kidpid); > >$port = "1999"; >$host = "localhost"; > ># create a tcp connection to the specified host and port >$handle = IO::Socket::INET->new(Proto => "tcp", > PeerAddr => $host, > PeerPort => $port) > or die "can't connect to port $port on $host: $!"; > >$handle->autoflush(1); # so output gets there right away >print "[Connected to $host:$port]\n"; > ># split the program into two processes, identical twins >die "can't fork: $!" unless defined($kidpid = fork()); > >if ($kidpid) { ># parent copies the socket to standard output > while (defined ($line = <$handle>)) { > print $line; > } > #kill("TERM" => $kidpid); # send SIGTERM to child >} >else { > # child copies standard input to the socket > while (defined ($line = <>)) { > print $handle $line; > } >} > >-->cat stat_server.pl >#!/usr/bin/perl -Tw ># ># server to listen on port 1999 and return a stat of a file ># >### > ># ># modules ># >use strict; >use IO::Socket; > ># ># secure environment ># >$ENV{PATH}=""; > ># ># declare variables ># >my ($socket, # client socket connection > $client, # client handle > @stat, # file stat data > ); > ># ># make a socket connection to port 1999 ># >$socket = IO::Socket::INET->new(Proto=>"tcp", > LocalPort=>"1999", > Listen=>1 > ) > or die "Cannot create server socket: $!\n"; > ># ># loop forever for client connections ># >while (1) { > $client = $socket->accept; > $client->autoflush(1); > > while (<$client>) { > chomp; > s/\r//; > # client is done > if ( "$_" eq "." ) { > close $client; > last; > } > # say hello (we are a friendly server) > if ( "$_" eq "hello" ) { > print $client "Hello. Nice to meet you.\n"; > print $client "Please enter a file name.\n"; > next; > } > # run a command > if ( $_ eq "w" ) { > print $client `/usr/bin/w`; > next; > } > # server kill command > if ( "$_" eq "kill" ) { > close $client; > close $socket; > exit; > } > # stat a file or a directory > if ( -e "$_" ) { > @stat = stat("$_"); > print $client "$_: @stat\n"; > } else { > print $client "File Not Found: $_\n"; > } > next; > } >} > >Sample Run: > ># ># start the server ># >-->stat_server.pl & >[2] 13035 > ># ># Connect as a client ># >-->biclient.pl >[Connected to localhost:1999] >hello >Hello. Nice to meet you. >Please enter a file name. >/vmlinuz >/vmlinuz: 770 171 33188 1 0 0 0 972211 1015755887 1015755887 >1015755887 4096 1910 >/home/moonbeam >/home/moonbeam: 779 80481 16877 47 502 100 0 8192 1019216446 >1019089720 1019089720 4096 16 >w > 4:17pm up 37 days, 22:22, 6 users, load average: 0.00, 0.00, 0.00 >USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT >moonbeam pts/2 gamymede.catmano 27Mar02 1:39 2.14s 0.05s mailx >moonbeam pts/3 gamymede.catmano 3Apr02 23:15m 0.36s 0.05s -su >moonbeam pts/4 gamymede.catmano 2Apr02 0.00s 55.19s 0.19s >/usr/bin/perl - >moonbeam pts/6 gamymede.catmano 6Apr02 5days 0.46s 0.46s -ksh >moonbeam pts/7 whitecat.catmano Tue 4pm 2days 0.11s 0.11s -ksh >moonbeam pts/8 whitecat.catmano Tue 7pm 2days 0.21s 0.21s -ksh >/home/moonbeam/junk >File Not Found: /home/moonbeam/junk >. > ># ># reconnect as a client and drop the server ># >-->biclient.pl >[Connected to localhost:1999] >hello >Hello. Nice to meet you. >Please enter a file name. >kill >[2] + Done stat_server.pl & > >--- > 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";;";;"' > >> >>So, I wanted to add some minor functionality to a couple of shell >>programs (telnet and ftp, specifically) and the simplest way seemed >>to be simply to wrap them in a Perl script, i/e simply make a Perl >>script that opens the program, and pipes input from the terminal >>(keystrokes) through to the program, and passes characters output >>from the program back to the terminal -- occasionally adding some >>extra keystrokes of its own (the added functionality) but mostly just >>acting as a "bidirectional pipe" between the program and the terminal. >> >>Here is the main wrapper part of the ftp version of the script >>(greatly stripped-down for clarity): >> >>____________________________ >>#!/usr/bin/perl >> >>use strict; >>use Fcntl; >>use IPC::Open3; >> >>$| = 1; >> >>my $from_term; >>my $from_shell; >>my $pipe_error; >> >>open(TTY, "+>fcntl( TTY, F_SETFL, O_NONBLOCK ); >> >>my $pid = open3( \*TO_SHELL, \*FROM_SHELL, \*SHELL_ERR, >> 'ftp -v strangelight.com' >>); >> >>fcntl( FROM_SHELL, F_SETFL, O_NONBLOCK ); >>fcntl( SHELL_ERR, F_SETFL, O_NONBLOCK ); >> >>my $oldfh = select(FROM_SHELL); $| = 1; select($oldfh); >>$oldfh = select(SHELL_ERR); $| = 1; select($oldfh); >>$oldfh = select(TTY); $| = 1; select($oldfh); > > >>$SIG{PIPE} = sub { ++$pipe_error; }; >> >>while ( not $pipe_error ) { >> while( defined( $from_term = getc(TTY) ) ) { >> print TO_SHELL $from_term; >> } >> while( defined( $from_shell = getc(FROM_SHELL) ) ) { >> print $from_shell; >> } >> while( defined( $from_shell = getc(SHELL_ERR) ) ) { >> print $from_shell; >> } >>} >> >>__END__ >> >>Now, I have two questions. >> >>My first question is, admittedly, one of those "I could probably >>figure it out on my own but I'm lazy so I'll ask the folks on SPUG >>instead" questions: >> >>While my script works fairly well as-is, it's a real processor hog, >>as you can probably guess. All of those getc() calls are >>non-blocking, so even when there's no input or output to process, the >>main while() loop still keeps executing over and over again, doing >>absolutely nothing as fast as it possibly can. What's the >>best/simplest way to tell Perl to "go to sleep, but wake up as soon >>as something interesting happens"? >> >>My second question is one I've banged my head on for a while and >>haven't been able to figure out at all: >> >>Even with setting $|=1 on all the open pipes, I still don't always >>get my I/O flushed promptly -- in particular, the responses I read >>back from FROM_SHELL seem often to be one or two lines behind what I >>should be getting. (My work-around has been to send a no-op command >>like 'pwd', the response to which usually forces the lines that I >>want to see out of the buffer.) What else can I do to get my pipes > >"piping hot" (as the perldocs say)? > > >>-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://seattleperl.org >> > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From andrew at sweger.net Sat Apr 20 18:20:06 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities In-Reply-To: Message-ID: On Sat, 20 Apr 2002, dancerboy wrote: > And added this to the loop: > > > select( $rin, undef, undef, undef ); > > But this just blocked forever, even when there was definitely input > on TTY. select($rin, undef, undef, 0); Having that undef as the timeout means "block until we have something to read". If your application can stand a little idle time in the event loop (if it's primary job is waiting for input), it won't hurt to put a timeout value greater than zero in. This will reduce the amount of CPU time your application will burn too. select($rin, undef, undef, 0.01); # 10ms timeout (select() is one of those really cool functions that twists your brain around the fork tines the first few times, then it's just fun. Do *not* mix with buffered IO!) -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From dancerboy at strangelight.com Sun Apr 21 00:44:08 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities In-Reply-To: References: Message-ID: At 4:20 pm -0700 2002-04-20, Andrew Sweger wrote: >On Sat, 20 Apr 2002, dancerboy wrote: > >> And added this to the loop: >> >> > select( $rin, undef, undef, undef ); >> >> But this just blocked forever, even when there was definitely input >> on TTY. > >select($rin, undef, undef, 0); > >Having that undef as the timeout means "block until we have something to >read". Hmmm... was my post not clear? This is exactly what I *wanted*: "block until we have something to read". The problem is, it seems to continue blocking *even when there IS something to read*. The select call never returns, ever, no matter what, and the input just keeps piling up in the buffer until I manually kill the process (at which point the calling shell gets the input that was intended for the Perl script -- which can have "interesting" results, depending on what I was typing...) > If your application can stand a little idle time in the event loop >(if it's primary job is waiting for input), it won't hurt to put a timeout >value greater than zero in. This will reduce the amount of CPU time your >application will burn too. > >select($rin, undef, undef, 0.01); # 10ms timeout As I said, this is exactly what I did: select( undef, undef, undef, 0.1); because that was the *only* way that the select call would *ever* return. (And since it was invariably waiting until the timeout, it didn't matter what I put as the first argument.) > >(select() is one of those really cool functions that twists your brain >around the fork tines the first few times, then it's just fun. Do *not* >mix with buffered IO!) The concept doesn't seem difficult -- my problem is that as far as I can tell, it's not behaving as documented. And I'm not using buffered I/O -- all my input is done with sysread. -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://seattleperl.org From andrew at sweger.net Sun Apr 21 13:39:54 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities In-Reply-To: Message-ID: On Sat, 20 Apr 2002, dancerboy wrote: > Hmmm... was my post not clear? This is exactly what I *wanted*: Okay, sorry. Don't get your knickers in a twist. It was clear. I just wasn't reading carefully enough (it's just way too sunny and warm here to read carefully). Beats me. I did some more digging and I wonder if this might be an example of open3 deadlock. It's hard to say exactly what ftp is doing on the other side of those filehandles (well, not true; the source is available). Not necessarily related, but when I did a simple redirect of ftp's stdin, stdout, & stderr (ftp < /dev/tty5 > /dev/tty6 2> /dev/tty7), it (ftp) was still smart enough to prompt for the password on my shell's original tty. I see you're checking on the parent's TTY and sending that back TO_SHELL. That might be sending the "password:" prompt back to the ftp binary's stdin (now on a pipe). In my experiment, while ftp was waiting for a password (on my original tty), echo was turned back on for tty5 (because ftp wasn't reading from there, instead waiting for my reply on the shell's tty). So, ftp isn't doing anything to help make it simple. It might be necessary to disconnect your program's stdin/stdout from the tty before creating the pipes (and maybe creating new filehandles to talk to the tty). That would put your program completely between the tty and the child binary. Since you're just wanting to add simple functionality, it might be simpler to use expect. It deals with all the ugliness and still allows user interaction. But then it wouldn't be as much fun, eh? -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Sun Apr 21 14:24:42 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities Message-ID: <20020421122442.A23345@timji.consultix.wa.com> A message to the SPUG-list from lists@dansanderson.com follows; but first, a brief message from our sponsor! 8-} * * * * * * * * * * * * * * * * * * * * * * * * * * * * This message was an attempted post from a SPUG member using an address other than the one that was subscribed. As a service to the list, for a short time, I will periodically scan my in-box for such "bounced" messages, and re-post them. However, I won't be willing to do this forever, so SPUGsters should make sure they know what address they're subscribed under, and henceforth use that address when posting (perhaps by faking it, by using mutt's "my_hdr" directive). This is the price we have paid for eradicating SPAM from our list (touch wood!), and I think you'll agree it's been worth it! So everybody please take care to post from the correct address! If you don't know what address you subscribed under, get in touch with me and I'll attempt to help you determine it. ====================================================== | Tim Maher tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== * * * * * * * * * * * * * * * * * * * * * * * * * * * * If you're on a *nix system, I recommend using Exceed for this kind of thing. Tcl configured, but it's not too hard. There's an O'Reilly book for it and everything. Not to discourage a discussion on the subject, I'd very much like to know how to do this efficiently in Perl. -- Dan On Thu, 18 Apr 2002, dancerboy wrote: > So, I wanted to add some minor functionality to a couple of shell > programs (telnet and ftp, specifically) and the simplest way seemed > to be simply to wrap them in a Perl script, i/e simply make a Perl > script that opens the program, and pipes input from the terminal > (keystrokes) through to the program, and passes characters output > from the program back to the terminal -- occasionally adding some > extra keystrokes of its own (the added functionality) but mostly just > acting as a "bidirectional pipe" between the program and the terminal. > > Here is the main wrapper part of the ftp version of the script > (greatly stripped-down for clarity): > > ____________________________ > #!/usr/bin/perl > > use strict; > use Fcntl; > use IPC::Open3; > > $| = 1; > > my $from_term; > my $from_shell; > my $pipe_error; > > open(TTY, "+ fcntl( TTY, F_SETFL, O_NONBLOCK ); > > my $pid = open3( \*TO_SHELL, \*FROM_SHELL, \*SHELL_ERR, > 'ftp -v strangelight.com' > ); > > fcntl( FROM_SHELL, F_SETFL, O_NONBLOCK ); > fcntl( SHELL_ERR, F_SETFL, O_NONBLOCK ); > > my $oldfh = select(FROM_SHELL); $| = 1; select($oldfh); > $oldfh = select(SHELL_ERR); $| = 1; select($oldfh); > $oldfh = select(TTY); $| = 1; select($oldfh); > > $SIG{PIPE} = sub { ++$pipe_error; }; > > while ( not $pipe_error ) { > while( defined( $from_term = getc(TTY) ) ) { > print TO_SHELL $from_term; > } > while( defined( $from_shell = getc(FROM_SHELL) ) ) { > print $from_shell; > } > while( defined( $from_shell = getc(SHELL_ERR) ) ) { > print $from_shell; > } > } > > __END__ > > Now, I have two questions. > > My first question is, admittedly, one of those "I could probably > figure it out on my own but I'm lazy so I'll ask the folks on SPUG > instead" questions: > > While my script works fairly well as-is, it's a real processor hog, > as you can probably guess. All of those getc() calls are > non-blocking, so even when there's no input or output to process, the > main while() loop still keeps executing over and over again, doing > absolutely nothing as fast as it possibly can. What's the > best/simplest way to tell Perl to "go to sleep, but wake up as soon > as something interesting happens"? > > My second question is one I've banged my head on for a while and > haven't been able to figure out at all: > > Even with setting $|=1 on all the open pipes, I still don't always > get my I/O flushed promptly -- in particular, the responses I read > back from FROM_SHELL seem often to be one or two lines behind what I > should be getting. (My work-around has been to send a no-op command > like 'pwd', the response to which usually forces the lines that I > want to see out of the buffer.) What else can I do to get my pipes > "piping hot" (as the perldocs say)? > > -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://seattleperl.org > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Sun Apr 21 14:47:04 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities Message-ID: <20020421124704.B23335@timji.consultix.wa.com> This sounds like a job for the CPAN Expect module. It's designed specifically to run interactive programs automatically, even those like * NOTE: The first word on the following line (after regex application) is not allowed by Majordomo's standard filters. I re-weaseled it to let this posting through. -Tim (spug-list-ownerspuk@seattleperl.org) P.S Unless you want to confine your discussions to "beer," this standard Majordomo filtration really sucks. passw(or){0}d that specifically don't want to be run automatically. On Thu, Apr 18, 2002 at 11:42:24PM -0700, dancerboy wrote: >So, I wanted to add some minor functionality to a couple of shell >programs (telnet and ftp, specifically) and the simplest way seemed >to be simply to wrap them in a Perl script, i/e simply make a Perl >script that opens the program, and pipes input from the terminal >(keystrokes) through to the program, and passes characters output >from the program back to the terminal -- occasionally adding some >extra keystrokes of its own (the added functionality) but mostly just >acting as a "bidirectional pipe" between the program and the terminal. > >Here is the main wrapper part of the ftp version of the script >(greatly stripped-down for clarity): > >____________________________ >#!/usr/bin/perl > >use strict; >use Fcntl; >use IPC::Open3; > >$| = 1; > >my $from_term; >my $from_shell; >my $pipe_error; > >open(TTY, "+fcntl( TTY, F_SETFL, O_NONBLOCK ); > >my $pid = open3( \*TO_SHELL, \*FROM_SHELL, \*SHELL_ERR, > 'ftp -v strangelight.com' >); > >fcntl( FROM_SHELL, F_SETFL, O_NONBLOCK ); >fcntl( SHELL_ERR, F_SETFL, O_NONBLOCK ); > >my $oldfh = select(FROM_SHELL); $| = 1; select($oldfh); >$oldfh = select(SHELL_ERR); $| = 1; select($oldfh); >$oldfh = select(TTY); $| = 1; select($oldfh); > >$SIG{PIPE} = sub { ++$pipe_error; }; > >while ( not $pipe_error ) { > while( defined( $from_term = getc(TTY) ) ) { > print TO_SHELL $from_term; > } > while( defined( $from_shell = getc(FROM_SHELL) ) ) { > print $from_shell; > } > while( defined( $from_shell = getc(SHELL_ERR) ) ) { > print $from_shell; > } >} > >__END__ > >Now, I have two questions. > >My first question is, admittedly, one of those "I could probably >figure it out on my own but I'm lazy so I'll ask the folks on SPUG >instead" questions: > >While my script works fairly well as-is, it's a real processor hog, >as you can probably guess. All of those getc() calls are >non-blocking, so even when there's no input or output to process, the >main while() loop still keeps executing over and over again, doing >absolutely nothing as fast as it possibly can. What's the >best/simplest way to tell Perl to "go to sleep, but wake up as soon >as something interesting happens"? > >My second question is one I've banged my head on for a while and >haven't been able to figure out at all: > >Even with setting $|=1 on all the open pipes, I still don't always >get my I/O flushed promptly -- in particular, the responses I read >back from FROM_SHELL seem often to be one or two lines behind what I >should be getting. (My work-around has been to send a no-op command >like 'pwd', the response to which usually forces the lines that I >want to see out of the buffer.) What else can I do to get my pipes >"piping hot" (as the perldocs say)? > >-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://seattleperl.org > -- 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/ ``Good luck to all you optimists out there who think Microsoft can deliver 35 million lines of quality code on which you can operate your business.'' -- John C. Dvorak ----- End forwarded message ----- -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com teachmeperl.com teachmeunix.com teachmelinux.net | | APR: Shell; Int/OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl JULY: Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Sun Apr 21 16:36:12 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Minor humor In-Reply-To: <20020421124704.B23335@timji.consultix.wa.com> Message-ID: >From a take-off on the movie The Matrix...check the bottom-right image for the relevant joke: http://www.detonate.net/matrixse/18.htm mma - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Ryan.Parr at wwireless.com Mon Apr 22 03:01:58 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: shell script event loops + wrapping shell utilities Message-ID: <6D6F0541E2B1D411A75B0002A513016D02800447@wacorpml03.wwireless.com> I know this may not be the answer you're looking for, but why aren't you just using Net::Telnet and Net::FTP? The inconvenience of these mods seems to be far less than the inconvenience of your current situation. ... The Camel Book 3rd Edition states on page 431 regarding IPC::Open2 and IPC::Open3: "Even simple, apparently interactive programs like ftp fail here because they won't do line buffering on a pipe. The'll only do it on a tty device. The IO::Pty and Expect modules from CPAN can help out with this because they provide a real tty (actually, a real pseudo-tty, but it acts like a real one). This gets you line buffering in the other process without modifying its program." The same page also recommends using the IO::Select module to avoid your issue with the fine grained sleep. However using the Time::HiRes module you can just do the following: use Time::HiRes qw(usleep); my $microseconds = 100_000; # 0.1 seconds usleep($microseconds); -- Ryan Parr Common sense is the collection of prejudices acquired by age eighteen. -- Albert Einstein -----Original Message----- From: dancerboy [mailto:dancerboy@strangelight.com] Sent: Thursday, April 18, 2002 11:42 PM To: Seattle Perl Users Group Subject: SPUG: shell script event loops + wrapping shell utilities So, I wanted to add some minor functionality to a couple of shell programs (telnet and ftp, specifically) and the simplest way seemed to be simply to wrap them in a Perl script, i/e simply make a Perl script that opens the program, and pipes input from the terminal (keystrokes) through to the program, and passes characters output from the program back to the terminal -- occasionally adding some extra keystrokes of its own (the added functionality) but mostly just acting as a "bidirectional pipe" between the program and the terminal. Here is the main wrapper part of the ftp version of the script (greatly stripped-down for clarity): ____________________________ #!/usr/bin/perl use strict; use Fcntl; use IPC::Open3; $| = 1; my $from_term; my $from_shell; my $pipe_error; open(TTY, "+ Hi, On the NoCatAuth mailing list someone posted with the annoying subject of "Why Perl Blows" (which immediately got all my goats) which boiled down to that it took up a lot of disk space. The linux kernel and bootloader came in at 1MB, the file system at 2MB, and perl at 2MB (way compressed, with all the .pod's stripped out). I thought there was a perl for embedded system project out there but I couldn't find it. Anyone have experience with building an ultra-stripped down version of perl? He ended his post with "when is the C version of this code is coming out?" The obvious response is "when you get around to writing it" I couldn't see what size of memory card he was using, I believe it is this model http://www.musenki.com/m-1.html which starts off with 32MB. Chris - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tim at consultix-inc.com Wed Apr 24 16:57:50 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Need Webmaster for Ballard Co. Message-ID: <20020424145750.A1096@timji.consultix.wa.com> SPUG Members, I represent a local company that is looking for an experienced webmaster to fill a direct salaried, full-time position. Company offers good benefits and strong growth. Applicants must have several years prior experience as a webmaster as well as experience with perl programming and cold fusion. Strong preference will be given to candidates that have a graphic design or artistic background. Client company is open to the possibility of telecommuting - their office is located in the Ballard area. Salary is negotiable depending on experience. Please contact me at kriss@isomedia.com for further information. Kris Schreiber * Kirkbride Associates, Inc. Phone: 425.557.4298 * 877.455.1527 Fax: 425.391.6991 "Opportunities are multiplied as they are seized." Sun Tsu www.kirkbrideassoc.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://seattleperl.org From davidpa at avaya.com Wed Apr 24 17:15:04 2002 From: davidpa at avaya.com (Patterson, David S (Pat)) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Reducing perl's footprint? (embedded system lacks space) Message-ID: <34D5B8848AEDE44ABAED1C52C1F04DC21702D9@WA2005AVEXU1.global.avaya.com> One easy way is to use perl 4.016; It is pretty darn good and runs under in 800kb of RAM. -Pat -----Original Message----- From: Chris Wilkes [mailto:cwilkes-spug@ladro.com] Sent: Wednesday, April 24, 2002 7:46 AM To: spug-list@pm.org Subject: SPUG: Reducing perl's footprint? (embedded system lacks space) Hi, On the NoCatAuth mailing list someone posted with the annoying subject of "Why Perl Blows" (which immediately got all my goats) which boiled down to that it took up a lot of disk space. The linux kernel and bootloader came in at 1MB, the file system at 2MB, and perl at 2MB (way compressed, with all the .pod's stripped out). I thought there was a perl for embedded system project out there but I couldn't find it. Anyone have experience with building an ultra-stripped down version of perl? He ended his post with "when is the C version of this code is coming out?" The obvious response is "when you get around to writing it" I couldn't see what size of memory card he was using, I believe it is this model http://www.musenki.com/m-1.html which starts off with 32MB. Chris - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From dancerboy at strangelight.com Wed Apr 24 22:43:35 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? Message-ID: So, I've been having all sorts of weird behaviour with CPAN on my MacOS X box at home, and I suddenly realized what I think the problem is: my firewall setup requires that I do all my ftp'ing in passive mode. I've looked through the CPAN configuration options, and can't seem to find anything that would tell it to do it's ftp'ing passively. Is there a way to do this? -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://seattleperl.org From Ryan.Parr at wwireless.com Wed Apr 24 23:54:48 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? Message-ID: <6D6F0541E2B1D411A75B0002A513016D02800487@wacorpml03.wwireless.com> Feeling tired and lazy I didn't go through the doco, but from the code it doesn't look like you can. You may be able to with CPANPLUS though... If you're using CPAN version 1.59_54 then this ought to do it. If you're using some other version then you get the picture. If you don't want to do it in such an inelegant fashion, I don't blame you. 2127c2127 < my $ftp = Net::FTP->new($host); --- > my $ftp = Net::FTP->new($host, Passive => 1); Of course, that makes it *always* passive. -- Ryan Parr Common sense is the collection of prejudices acquired by age eighteen. -- Albert Einstein -----Original Message----- From: dancerboy [mailto:dancerboy@strangelight.com] Sent: Wednesday, April 24, 2002 8:44 PM To: Seattle Perl Users Group Subject: SPUG: CPAN & passive ftp? So, I've been having all sorts of weird behaviour with CPAN on my MacOS X box at home, and I suddenly realized what I think the problem is: my firewall setup requires that I do all my ftp'ing in passive mode. I've looked through the CPAN configuration options, and can't seem to find anything that would tell it to do it's ftp'ing passively. Is there a way to do this? -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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From andrew at sweger.net Thu Apr 25 01:05:00 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? In-Reply-To: <6D6F0541E2B1D411A75B0002A513016D02800487@wacorpml03.wwireless.com> Message-ID: You can also define the $FTP_PASSIVE environment variable which is picked up by the Net::FTP module. E.g., % FTP_PASSIVE=1 yourscript -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From creede at penguinsinthenight.com Thu Apr 25 01:27:29 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? In-Reply-To: Message-ID: On Wed, 24 Apr 2002, dancerboy wrote: > So, I've been having all sorts of weird behaviour with CPAN on my > MacOS X box at home, and I suddenly realized what I think the problem > is: my firewall setup requires that I do all my ftp'ing in passive > mode. I've looked through the CPAN configuration options, and can't > seem to find anything that would tell it to do it's ftp'ing > passively. Is there a way to do this? > > -jason > I think ncftpget (one of the methods CPAN can use) uses passive mode as a default. I don't know whether lynx -source uses passive mode or not. It might use http, which would bypass the question entirely. In the main CPAN module there's a line that says my $ftp = Net::FTP->new($host); You should be able to force passive mode by changing that line to my $ftp = Net::FTP->new($host, Passive=>1); I think. :) Hopefully one of those will work for you. Good luck! Caveat: I haven't tried this, so save a backup. * .~. `( --------------------------------------------------------- ` / V \ . Creede Lambard : Never rush a miracle man. /( )\ creede@penguinsinthenight.com : You get rotten miracles. ^^-^^ --------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From ben at reser.org Thu Apr 25 01:32:57 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? In-Reply-To: References: Message-ID: <20020425063257.GF2195@titanium.brain.org> On Wed, Apr 24, 2002 at 08:43:35PM -0700, dancerboy wrote: > So, I've been having all sorts of weird behaviour with CPAN on my > MacOS X box at home, and I suddenly realized what I think the problem > is: my firewall setup requires that I do all my ftp'ing in passive > mode. I've looked through the CPAN configuration options, and can't > seem to find anything that would tell it to do it's ftp'ing > passively. Is there a way to do this? Presumably you can get through your firewall with HTTP. Why not just you an HTTP URL to CPAN? -- Ben Reser http://ben.reser.org What difference does it make to the dead, the orphans, and the homeless, whether the mad destruction is wrought under the name of totalitarianism or the holy name of liberty and democracy? - Ghandi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tuck at whistlingfish.net Thu Apr 25 04:18:33 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? In-Reply-To: References: Message-ID: <6230000.1019726309@flashingchance.whistlingfish.net> -- dancerboy spake thusly: > So, I've been having all sorts of weird behaviour with CPAN on my > MacOS X box at home, and I suddenly realized what I think the problem > is: my firewall setup requires that I do all my ftp'ing in passive > mode. I've looked through the CPAN configuration options, and can't > seem to find anything that would tell it to do it's ftp'ing > passively. Is there a way to do this? The way to set this permanently and globally for Perl is to alter Net/Config.pm (do 'locate Net/Config.pm'). Look for the ftp_ext_passive line and set it to 1. -------------- 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/20020425/ae0811fb/attachment.bin From Andrew.Pearson at pnl.gov Thu Apr 25 12:24:36 2002 From: Andrew.Pearson at pnl.gov (Pearson, Andrew S) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: set ruid? Message-ID: <1B1080D3ADDF8D4AB59832DE0A02C52AB3FD35@pnlmse06.pnl.gov> Hello everyone, I am very new to Perl and to computer programming in general, but have been amazed at all the cool stuff that it can do. Recently I've been working on a program to run loops of S-plus scripts. I can get the program to run 1 s-plus batch script but when it attempts to run multiple scripts in loops I get a message that says: "setruid( ) not implemented at sdos.pl lone 10". I'm not sure what this means and I couldn't fin it in any of the Perl books that I have. I would much appreciate any help I can get to fix this problem. I'm running ActivePerl 5.6 on a Windows 98 system. Thanks Andrew S. Pearson - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From andrew at sweger.net Thu Apr 25 14:24:58 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: CPAN & passive ftp? In-Reply-To: <6230000.1019726309@flashingchance.whistlingfish.net> Message-ID: Cool. You can also (using the same facility) set a per-user preference. From Net::Config, The configuration data is held globally in a file in the perl installation tree, but a user may override any of these values by providing their own. This can be done by having a ".libnetrc" file in their home directory. This file should return a reference to a HASH containing the keys described below. For example # .libnetrc { nntp_hosts => [ "my_prefered_host" ], ph_hosts => [ "my_ph_server" ], } On Thu, 25 Apr 2002, Matt Tucker wrote: > The way to set this permanently and globally for Perl is to alter > Net/Config.pm (do 'locate Net/Config.pm'). Look for the ftp_ext_passive > line and set it to 1. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From creede at penguinsinthenight.com Fri Apr 26 08:39:34 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: set ruid? In-Reply-To: <1B1080D3ADDF8D4AB59832DE0A02C52AB3FD35@pnlmse06.pnl.gov> Message-ID: On Thu, 25 Apr 2002, Pearson, Andrew S wrote: > Hello everyone, > > I am very new to Perl and to computer programming in general, but > have been amazed at all the cool stuff that it can do. Recently I've been > working on a program to run loops of S-plus scripts. I can get the program > to run 1 s-plus batch script but when it attempts to run multiple scripts in > loops I get a message that says: > "setruid( ) not implemented at sdos.pl lone 10". > I'm not sure what this means and I couldn't fin it in any of the > Perl books that I have. I would much appreciate any help I can get to fix > this problem. I'm running ActivePerl 5.6 on a Windows 98 system. > Thanks > Andrew S. Pearson > Perl was developed as a tool for Unix, so there's a lot of Unix-specific stuff that doesn't apply to Windows, or is implemented differently in Windows because, basically, they have to fake it. On first glance the message above sounds like one of those issues. However, it's odd that you can run one instance of the script, but not more. That's what makes me think it might an implementation problem. Also, because of the differences in the architectures, some things behave differently on Windows 9x than they do in NT. Any chance you can try this on NT to see what happens? Care to share your code with us? Sometimes that's the easiest way to see what's going on. Good luck with Perl. Of all the languages I've ever used, to me it's the most fun. -- * .~. `( --------------------------------------------------------- ` / V \ . Creede Lambard : Never rush a miracle man. /( )\ creede@penguinsinthenight.com : You get rotten miracles. ^^-^^ --------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Thu Apr 25 14:10:54 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: set ruid? In-Reply-To: <1B1080D3ADDF8D4AB59832DE0A02C52AB3FD35@pnlmse06.pnl.gov> Message-ID: Well, the basic problem is that Windows doesn't support setruid(). There are a number of functions that are present in Perl due to its UNIX origins that don't work on Windows. In the general case you can use the Config module to check these things: use Config; if ($Config{d_setruid}) { print "Supports setruid()\n"; } else { print "Doesn't support setruid()\n"; } However, this doesn't completely answer your question. It is apparent that somewhere in sdos.pl setruid() is being called -- only it isn't actually part of any Perl library. Instead, (as per the perldiag chapter in the Core library) it is called due to an assignment to the pseudo-variable $<. You can double-check this by running the following one-line Perl script: $< = 23; and getting the same error message. So the long and the short of it is that you're running on Windows and some Perl stuff isn't portable in that environment. I mostly run Perl under Windows so I run into this sort of thing on an irregular basis (it is in fact remarkable that so much does work on Windows). I don't know anything about the particular scripts you're running so I'm not going to be much help with an actual fix. Maybe fork()ing off sub-processes (which are actually threads on Windows, another non-portability issue) or segregating them in eval{} blocks would create localized contexts in which this wouldn't happen. Or you could dig into the code that's blowing up and see what's what. What scripts are these? Did you get them from CPAN? Marc M. Adkins > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Pearson, Andrew S > Sent: Thursday, April 25, 2002 10:25 AM > To: 'spug-list@pm.org' > Subject: SPUG: set ruid? > > > Hello everyone, > > I am very new to Perl and to computer programming in general, but > have been amazed at all the cool stuff that it can do. Recently I've been > working on a program to run loops of S-plus scripts. I can get > the program > to run 1 s-plus batch script but when it attempts to run multiple > scripts in > loops I get a message that says: > "setruid( ) not implemented at sdos.pl lone 10". > I'm not sure what this means and I couldn't fin it in any of the > Perl books that I have. I would much appreciate any help I can get to fix > this problem. I'm running ActivePerl 5.6 on a Windows 98 system. > Thanks > Andrew S. Pearson > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From beckyls at u.washington.edu Mon Apr 29 17:05:46 2002 From: beckyls at u.washington.edu (Rebecca L. Schmidt) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: UNIX/Linux meeting In-Reply-To: Message-ID: Hi, Thanks to all of you who expressed your interest in the UW's UNIX/Linux Administration Program. We will be holding an Information Meeting this Thursday, May 2nd where you will have the opportunity to learn more about the program and meet the instructor, Phil Nesser. I encourage you to attend! We will also discuss our Data and Internet Security Program as well as our Oracle Administration Program. Here are the details: What: Information Meeting When: Thursday, May 2nd, 6-6:45 PM Where: UW Educational Outreach, 2445 140th Ave. NE, Suite B-100, Bellevue. Please let me know if you have any questions! Best regards, Rebecca Schmidt Academic Programs University of Washington Extension 5001 25th Ave NE, Seattle, WA 98105-4190 rschmidt@ese.washington.edu (206) 221-6243 > > > ---------- Forwarded message ---------- > Date: Wed, 10 Apr 2002 10:28:20 -0700 (PDT) > From: Rebecca L. Schmidt > To: spug-list@pm.org > Subject: SPUG: UNIX/Linux Administration Program > > > I think some folks on this list might be interested in this new, intensive > UW UNIX/Linux Administration Certificate Program so I'm posting the > information here. If you have any questions feel free to contact me. > > The UNIX/Linux Administration Certificate Program is for people with basic > UNIX or Linux knowledge who wish to plan, support and administer > UNIX/Linux networks. This program is especially useful for individuals > seeking career change or advancement, and preparing for LPI Linux > Certification. For more information see: > > http://www.outreach.washington.edu/extinfo/certprog/uad/uad_main.asp > > We will be holding a free information meeting on Thursday, May 2, 2002, > 6-6:45 p.m., at UW Educational Outreach, 2445 140th Ave. NE, Suite B-100 > in Bellevue. At this meeting you'll have a chance to meet the instructor > in person and learn more about the program. Please feel free to attend > and let me know if you need directions. > > Here's more information about the program: > > Classes in the hands-on, intensive eight-week format meet in UW > Extension's Bellevue computer lab on Tuesdays and Thursdays, June 11-August > 1, 2002. Applications for this program are now being accepted. The > deadline for submitting an application is 5 p.m. on May 17, 2002. You can > find application information via the URL above. > > The instructor is Phil Nesser, a recognized authority on networking, > security and data communications. He taught many classes for the UW. He > has worked with the Internet Engineering Task Force since 1994 and has > authored and contributed to numerous technical reports. A graduate of > MIT, he served as an advisor to the President's Y2K Task Force. > > If you have any questions about the program please do not hesitate to > contact me directly. My contact info is below. > > > Best regards, > > Rebecca Schmidt > Academic Programs > University of Washington Extension > 5001 25th Ave NE, Seattle, WA 98105-4190 > rschmidt@ese.washington.edu > (206) 221-6243 > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > 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://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From pdarley at kinesis-cem.com Tue Apr 30 13:25:06 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question Message-ID: Friends, I currently have a hash that looks like $Item{Children}{[child #]}{other stuff} A couple of examples would be: $Item{Children}{1}{name} $Item{Children}{1}{content} $Item{Children}{2}{name} $Item{Children}{2}{content} I'm getting at the Children of Item using: for $SubItem (values %{$$Item{Children}}) which gives me an unsorted list of items. I would like to have it sorted in the order of the keys of the %{$Item{Children}}. I found lots of info on how to step through the keys of a hash sorted by value, but not anything on stepping through the values of a has sorted by key. Is this easily doable, or should I do something like: for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) { $SubItem = $$Item{Children}{$SubItem}; ... } I would be greatfull for any suggestion! :) Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Daniel.Pommert at verizonwireless.com Tue Apr 30 14:26:03 2002 From: Daniel.Pommert at verizonwireless.com (Pommert, Daniel) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question Message-ID: <9B30436F511ED5118EDF0002A55C31800119D913@cairvexmb03.irvn.ca.vzwcorp.com> It seems that your simplest solution would be to change your {[child #]} to be an array reference from a hash reference. The only reason why you wouldn't want to do this (that I can think of) is that your subscripts are very sparce (i.e. lots of gaps in the numbers). If they are dense (i.e. no gaps), then you should change your array to: $Item{Children}[child #]{other stuff} With your examples becoming: $Item{Children}[1]{name} $Item{Children}[1]{content} $Item{Children}[2]{name} $Item{Children}[2]{content} Get the Children of Item using: for $SubItem (@{$Item{Children}}) { next unless defined $SubItem; # Handle [0] element which gives you an ordered list. Your second loop becomes: for $SubItem (@{$Item{Children}}) { next unless defined $SubItem; # Handle [0] element . . . } I hope this helps. -- Daniel Pommert Verizon Wireless 425-603-8612 -----Original Message----- From: Peter Darley [mailto:pdarley@kinesis-cem.com] Sent: Tuesday, April 30, 2002 11:25 AM To: SPUG Subject: SPUG: Sorting hash question Friends, I currently have a hash that looks like $Item{Children}{[child #]}{other stuff} A couple of examples would be: $Item{Children}{1}{name} $Item{Children}{1}{content} $Item{Children}{2}{name} $Item{Children}{2}{content} I'm getting at the Children of Item using: for $SubItem (values %{$$Item{Children}}) which gives me an unsorted list of items. I would like to have it sorted in the order of the keys of the %{$Item{Children}}. I found lots of info on how to step through the keys of a hash sorted by value, but not anything on stepping through the values of a has sorted by key. Is this easily doable, or should I do something like: for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) { $SubItem = $$Item{Children}{$SubItem}; ... } I would be greatfull for any suggestion! :) Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From tuck at whistlingfish.net Tue Apr 30 15:11:16 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question In-Reply-To: References: Message-ID: <38420000.1020197475@[192.168.30.55]> -- Peter Darley spake thusly: > I currently have a hash that looks like > $Item{Children}{[child #]}{other stuff} > > A couple of examples would be: > $Item{Children}{1}{name} > $Item{Children}{1}{content} > $Item{Children}{2}{name} > $Item{Children}{2}{content} > > I'm getting at the Children of Item using: > for $SubItem (values %{$$Item{Children}}) Why are you dereferencing it like this? %{$Item{Children}} is sufficient. Additionally, if you're using numbers, why not just use an array? Something like: $Item{Children}[1]{name} $Item{Children}[1]{content} $Item{Children}[2]{name} $Item{Children}[2]{content} Unless, of course, the numbering is more sparse than the example you give, in which case hashes probably make sense. > which gives me an unsorted list of items. I would like to have it > sorted in the order of the keys of the %{$Item{Children}}. I found > lots of info on how to step through the keys of a hash sorted by > value, but not anything on stepping through the values of a has > sorted by key. Is this easily doable, or should I do something like: > > for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) > { > $SubItem = $$Item{Children}{$SubItem}; > ... > } This is a perfectly reasonable way to do it, although I would suggest not repurposing the $SubItem variable. A better snippet would be: for my $subkey (sort {$a<=>$b} keys %{$Item{Children}}) { my $subItem = $Item{Children}{$subkey}; ... } -------------- 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/20020430/de8a64d8/attachment.bin From pdarley at kinesis-cem.com Tue Apr 30 15:46:49 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question In-Reply-To: <9B30436F511ED5118EDF0002A55C31800119D913@cairvexmb03.irvn.ca.vzwcorp.com> Message-ID: Daniel, The problem with this is that I'm not smart enough to keep track of weather any particular element is a hash or an array, so in defense I just use hashes. It's clear that what you're suggesting is probably a more efficient way to use the language, but it would make me go crazy. Thanks, Peter Darley -----Original Message----- From: Pommert, Daniel [mailto:Daniel.Pommert@VerizonWireless.com] Sent: Tuesday, April 30, 2002 12:26 PM To: 'Peter Darley'; SPUG Subject: RE: SPUG: Sorting hash question It seems that your simplest solution would be to change your {[child #]} to be an array reference from a hash reference. The only reason why you wouldn't want to do this (that I can think of) is that your subscripts are very sparce (i.e. lots of gaps in the numbers). If they are dense (i.e. no gaps), then you should change your array to: $Item{Children}[child #]{other stuff} With your examples becoming: $Item{Children}[1]{name} $Item{Children}[1]{content} $Item{Children}[2]{name} $Item{Children}[2]{content} Get the Children of Item using: for $SubItem (@{$Item{Children}}) { next unless defined $SubItem; # Handle [0] element which gives you an ordered list. Your second loop becomes: for $SubItem (@{$Item{Children}}) { next unless defined $SubItem; # Handle [0] element . . . } I hope this helps. -- Daniel Pommert Verizon Wireless 425-603-8612 -----Original Message----- From: Peter Darley [mailto:pdarley@kinesis-cem.com] Sent: Tuesday, April 30, 2002 11:25 AM To: SPUG Subject: SPUG: Sorting hash question Friends, I currently have a hash that looks like $Item{Children}{[child #]}{other stuff} A couple of examples would be: $Item{Children}{1}{name} $Item{Children}{1}{content} $Item{Children}{2}{name} $Item{Children}{2}{content} I'm getting at the Children of Item using: for $SubItem (values %{$$Item{Children}}) which gives me an unsorted list of items. I would like to have it sorted in the order of the keys of the %{$Item{Children}}. I found lots of info on how to step through the keys of a hash sorted by value, but not anything on stepping through the values of a has sorted by key. Is this easily doable, or should I do something like: for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) { $SubItem = $$Item{Children}{$SubItem}; ... } I would be greatfull for any suggestion! :) Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From damian at conway.org Tue Apr 30 16:09:08 2002 From: damian at conway.org (Damian Conway) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question References: Message-ID: <3CCF07EF.C874C1D3@conway.org> Peter Darley wrote: > I would like to have it [a multi-level hash] sorted > in the order of the keys of the %{$Item{Children}}. The others who have suggested an array at the thrid level are right, but seeing that you have a morbid fear of mixed data structures (;-) here's a way to iterate through a hash, but in a sorted order: # walk through values of %hash in numeric order of its keys... for $next ( @hash{sort {$a<=>$b} keys %hash} ) { # do something with $next } This uses a hash slice, slicing on the pre-sorted the keys of the hash. In your case that becomes: for $SubItem (@{$Item{Children}}{sort {$a<=>$b} keys %{$Item{Children}}}) { # do something with $SubItem } Frankly, you might want to reconsider the array-based solution ;-) Damian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From pdarley at kinesis-cem.com Tue Apr 30 16:26:57 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question In-Reply-To: <38420000.1020197475@[192.168.30.55]> Message-ID: Matt, The variable $Item is actually a reference in a scalar, rather than a hash, so I need to re-reference it to $$Item{Children} before dereferencing it to %{$$Item{Children}}, if that makes any sense. If I don't need to do this, I would be ecstatic, but it has been the only way I could figure out to do it. Any suggestions? Thanks, Peter Darley -----Original Message----- From: Matt Tucker [mailto:tuck@whistlingfish.net] Sent: Tuesday, April 30, 2002 1:11 PM To: Peter Darley Cc: SPUG Subject: Re: SPUG: Sorting hash question -- Peter Darley spake thusly: > I currently have a hash that looks like > $Item{Children}{[child #]}{other stuff} > > A couple of examples would be: > $Item{Children}{1}{name} > $Item{Children}{1}{content} > $Item{Children}{2}{name} > $Item{Children}{2}{content} > > I'm getting at the Children of Item using: > for $SubItem (values %{$$Item{Children}}) Why are you dereferencing it like this? %{$Item{Children}} is sufficient. Additionally, if you're using numbers, why not just use an array? Something like: $Item{Children}[1]{name} $Item{Children}[1]{content} $Item{Children}[2]{name} $Item{Children}[2]{content} Unless, of course, the numbering is more sparse than the example you give, in which case hashes probably make sense. > which gives me an unsorted list of items. I would like to have it > sorted in the order of the keys of the %{$Item{Children}}. I found > lots of info on how to step through the keys of a hash sorted by > value, but not anything on stepping through the values of a has > sorted by key. Is this easily doable, or should I do something like: > > for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) > { > $SubItem = $$Item{Children}{$SubItem}; > ... > } This is a perfectly reasonable way to do it, although I would suggest not repurposing the $SubItem variable. A better snippet would be: for my $subkey (sort {$a<=>$b} keys %{$Item{Children}}) { my $subItem = $Item{Children}{$subkey}; ... } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From damian at conway.org Tue Apr 30 16:48:17 2002 From: damian at conway.org (Damian Conway) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question References: Message-ID: <3CCF111B.F9FC7D2A@conway.org> Peter Darley wrote: > The variable $Item is actually a reference in a scalar, rather than a hash, > so I need to re-reference it to $$Item{Children} before dereferencing it to > %{$$Item{Children}}, if that makes any sense. If I don't need to do this, I > would be ecstatic, but it has been the only way I could figure out to do it. > Any suggestions? You'll still need to dereference, but it's better written as: %{$Item->{Children}} Which would make my suggestion: for $SubItem (@{$Item->{Children}}{sort {$a<=>$b} keys %{$Item->{Children}}}) { ... } Damian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From Marc.M.Adkins at Doorways.org Tue Apr 30 17:44:14 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question Message-ID: You might try the Tie-SortHash module on CPAN: http://search.cpan.org/doc/CTWETEN/Tie-SortHash-1.01/SortHash.pm It is designed to return keys in sorted order. Don't know how much more efficient it will be than your default solution. mma > I'm getting at the Children of Item using: > for $SubItem (values %{$$Item{Children}}) > > which gives me an unsorted list of items. I would like to > have it sorted > in the order of the keys of the %{$Item{Children}}. I found lots > of info on > how to step through the keys of a hash sorted by value, but not > anything on > stepping through the values of a has sorted by key. Is this > easily doable, > or should I do something like: > > for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) > { > $SubItem = $$Item{Children}{$SubItem}; > ... > } > > I would be greatfull for any suggestion! :) > Thanks, > Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org From pdarley at kinesis-cem.com Tue Apr 30 18:27:45 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:53 2004 Subject: SPUG: Sorting hash question In-Reply-To: Message-ID: Marc, I took a look at this. Since I have hashes of hashes of hashes I think this would get to be pretty unwieldy pretty quickly. Thanks for the suggestion tho! Thanks, Peter Darley -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Marc M. Adkins Sent: Tuesday, April 30, 2002 3:44 PM To: SPUG Subject: SPUG: Sorting hash question You might try the Tie-SortHash module on CPAN: http://search.cpan.org/doc/CTWETEN/Tie-SortHash-1.01/SortHash.pm It is designed to return keys in sorted order. Don't know how much more efficient it will be than your default solution. mma > I'm getting at the Children of Item using: > for $SubItem (values %{$$Item{Children}}) > > which gives me an unsorted list of items. I would like to > have it sorted > in the order of the keys of the %{$Item{Children}}. I found lots > of info on > how to step through the keys of a hash sorted by value, but not > anything on > stepping through the values of a has sorted by key. Is this > easily doable, > or should I do something like: > > for $SubItem (sort {$a<=>$b} keys %{$$Item{Children}}) > { > $SubItem = $$Item{Children}{$SubItem}; > ... > } > > I would be greatfull for any suggestion! :) > Thanks, > Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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://seattleperl.org