From MichaelRunningWolf at att.net Sun Mar 2 15:07:47 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:simple graphics Message-ID: I'd like to create simple (rectangles and polygons with centered text) graphics for some labels in my apartment -- some large, some small: - apartment door - parking space - mailbox - security buzzer Recommendations? Suggestions? -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From bill at celestial.com Sun Mar 2 17:30:18 2003 From: bill at celestial.com (Bill Campbell) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:simple graphics In-Reply-To: ; from MichaelRunningWolf@att.net on Sun, Mar 02, 2003 at 01:07:47PM -0800 References: Message-ID: <20030302153017.A10272@barryg.mi.celestial.com> On Sun, Mar 02, 2003 at 01:07:47PM -0800, Michael R. Wolf wrote: > > >I'd like to create simple (rectangles and polygons with centered text) >graphics for some labels in my apartment -- some large, some small: > > - apartment door > - parking space > - mailbox > - security buzzer > >Recommendations? >Suggestions? gnuplot xfig 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/ ``A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.'' Robert Heinlein From MichaelRunningWolf at att.net Wed Mar 5 00:19:15 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Design Pattern study group Message-ID: I just found out about a group that's studying "Design Patterns: Elements of Reusable Object-Oriented Style", by Gamma, Helm, Johnson, Vlissides ("The GoF" (Gang of Four)). The first meeting is Wednesday, March 5 (tomorrow) at 6:00 (dinner) or 6:30 (study). It's the second running of the study group and is being run by a member of the Seattle Java UG. The previous one was so popular that it outgrew his Greenwood house and forked an eastside group. I just spoke with the host -- he'd be really interested to hear the perspective of some Perl folks, and how the Patterns relate. I've done some Perl architecture using this book. It was the best architecture I've ever done. And I just spent some time reading the (building) architecture books that motivated this (software) architecture book. The parallels from our understanding of how to build buildigs has certainly informed the software industry in some subtle and intricate ways. Read more information (including driving directions) here: http://groups.yahoo.com/group/wingding/ and RSVP if you'd like to join in. -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From matw at eclipse-optics.com Wed Mar 5 10:17:49 2003 From: matw at eclipse-optics.com (Mathew D. Watson) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Where can I find win32-GUI documents? Message-ID: I've been trying to locate documentation on the win32-GUI package, but I haven't had any luck (active state, cpan, dada.perl.it). I'm probably missing something obvious. Can anyone point me in the right direction? Thanks in advance, --Mat Mathew D. Watson, Ph.D. Eclipse Optics Corporation 10439 NE 28th Pl. Bellevue, WA 98004 425 827 0427 phn, 801 751 2369 fax matw@eclipse-optics.com From Marc.M.Adkins at Doorways.org Wed Mar 5 11:19:00 2003 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Where can I find win32-GUI documents? In-Reply-To: Message-ID: > I've been trying to locate documentation on the win32-GUI package, but I > haven't had any luck (active state, cpan, dada.perl.it). http://dada.perl.it/gui_docs/gui.html, but it's kind of sparse. Seems like there was more, maybe it comes with the package, maybe I remember wrong. The CPAN module hasn't had action since 2001, the version on dada.perl.it has a date of February 2002. I used it back then and it worked OK. It never got out of beta though, so there's a lot of stuff that never quite got finished. At this time I'm recommending the wxPerl code, which works with wxWindows, a cross-platform GUI library. Both wxWindows and wxPerl are active at this time. The only downside is you must acquire or build wxWindows separately, it doesn't download with wxPerl. mma From MichaelRunningWolf at att.net Wed Mar 5 11:41:14 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:cpan.bat caches preventing WWW::Mechanize update Message-ID: WWW::Mechanize is out with version 0.37, but cpan.bat (ActiveState 5.8.0 build 804) seems to have cached the 0.36 version internally. The 0.36 version didn't install correctly due to a problem with the Clone module, but the 0.37 version should not require Clone. Is there a way to clean or update cpan.bat's internal cache of Metadata or source distributions so that it kick-starts a fresh install of the 0.37 verion of WWW::Mechanize, the one that doesn't need Clone? And is there a way to rid my cache of the half installed Clone? Thanks, Michael -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From spug at ifokr.org Wed Mar 5 17:33:56 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Filemaker Pro access from perl? Message-ID: <20030305233356.GV15218@ifokr.org> Has anyone here attempted to access a filemaker pro database from perl? There isn't a DBI module for it, but there seems to be an inkling that accessing it via ODBC might work. And no, don't tell me I should use MySQL or something, I'm just trying to help out a friend who has a client with poor software choices. -- Brian Hatch To love oneself is Systems and the beginning of a Security Engineer lifelong romance. http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030305/483ca289/attachment.bin From aaron at activox.com Wed Mar 5 18:31:58 2003 From: aaron at activox.com (Aaron Salo) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Filemaker Pro access from perl? In-Reply-To: <20030305233356.GV15218@ifokr.org> Message-ID: <3.0.5.32.20030305163158.00f8da50@mail.activox.com> At 03:33 PM 3/5/2003 -0800, Brian Hatch wrote: >Has anyone here attempted to access a filemaker pro database >from perl? There isn't a DBI module for it, but there seems >to be an inkling that accessing it via ODBC might work. yes, you can use DBD::ODBC to do it (I've done it but the connection was pre-existing so I can't offer any help as far as BTDT on setting up the connection). I presume your friend is using FMPro on a mac rather than win32 version. your friends mac box will need to have (forgive my obviousness for mentioning this) an ODBC driver manager and the ODBC drivers for FMPro. I've not tried this with OSX but this might be helpful to you, if you can get some mileage out of this I hope it helps. ftp://ftp.apple.com/developer/Development_Kits/MacODBC.sit.hqx MacODBC Summary: MacODBC is the standard way for developers to write MacOS-based applications that communicate to databases using the Open DataBase Connectivity (ODBC) standard. This folder contains the software development kit for MacODBC version 2.1.2 GM. Features: Cross-platform remote database access Wide range of third party drivers All major relational databases covered Many Mac OS databases also supported (Butler from Everyware Corp. , dTF from theta group and many more ) good luck ~!aaron From spug at ifokr.org Wed Mar 5 18:36:29 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Filemaker Pro access from perl? In-Reply-To: <3.0.5.32.20030305163158.00f8da50@mail.activox.com> References: <20030305233356.GV15218@ifokr.org> <3.0.5.32.20030305163158.00f8da50@mail.activox.com> Message-ID: <20030306003629.GC15218@ifokr.org> > yes, you can use DBD::ODBC to do it (I've done it but the connection was > pre-existing so I can't offer any help as far as BTDT on setting up the > connection). > > I presume your friend is using FMPro on a mac rather than win32 version. I have no idea currently. May well be on a PC. The client is probably an OSX machine. > your friends mac box will need to have (forgive my obviousness for > mentioning this) an ODBC driver manager and the ODBC drivers for FMPro. No, that's not obvious. I'm totally comfortable in my Linux and networked world, but ODBC is one of those scary foreign words that means "doesn't work like a Unix-head would expect or want." > I've not tried this with OSX but this might be helpful to you, if you can > get some mileage out of this I hope it helps. Thanks for the note. Apparently FMPro can also have web access using standard GET syntax, so I'll check both out and see what I can get working faster. -- Brian Hatch "No one listens to Systems and poor Zathras." Security Engineer http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030305/031cfe82/attachment.bin From jay at scherrer.com Wed Mar 5 22:50:49 2003 From: jay at scherrer.com (Jay Scherrer) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Where can I find win32-GUI documents? In-Reply-To: References: Message-ID: <200303052050.49316.jay@scherrer.com> Are you asking about GUI's in general? Active state ships with Perl::Tk by default. But there are several others [Qt, Gtk+,Tk]. If your on a windows or linux box enter: widget To test for the Tk install. Jay On Wednesday 05 March 2003 09:19 am, Marc M. Adkins wrote: > > I've been trying to locate documentation on the win32-GUI package, but I > > haven't had any luck (active state, cpan, dada.perl.it). > > http://dada.perl.it/gui_docs/gui.html, but it's kind of sparse. Seems like > there was more, maybe it comes with the package, maybe I remember wrong. > > The CPAN module hasn't had action since 2001, the version on dada.perl.it > has a date of February 2002. I used it back then and it worked OK. It > never got out of beta though, so there's a lot of stuff that never quite > got finished. > > At this time I'm recommending the wxPerl code, which works with wxWindows, > a cross-platform GUI library. Both wxWindows and wxPerl are active at this > time. The only downside is you must acquire or build wxWindows separately, > it doesn't download with wxPerl. > > mma > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org From boyes at eskimo.com Thu Mar 6 01:35:21 2003 From: boyes at eskimo.com (Paul J. Boyes) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Text::CSV_XS and DBD::CSV References: <200303060500.h2650YN03226@mail.pm.org> Message-ID: <000d01c2e3b2$f2d7fbc0$0201a8c0@fatlilly> From tim at consultix-inc.com Thu Mar 6 14:36:00 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Tim's perl.com Interview released Message-ID: <20030306123600.A27219@timji.consultix-inc.com> SPUGsters, I was interviewed by the people at perl.com recently, and I've made the interview available on my web site. Click on "perl.com interview" in the left-frame under the heading PUBLICATIONS to check it out. By the way, there is some overlap with my earlier Perl Foundation interview, but there's also a lot of new stuff that you might find interesting. Here's an excerpt from the introduction: perl.com interviewed Dr. Tim Maher, CEO of Consultix, about his background in Perl, how he came to start SPUG, one of the first, biggest, and best Perl User's Groups, and what his 2002 White Camel Award means to him personally. In this wide ranging and humorous interview, Tim tells us about his early use of UNIX and its utilities in the 70s, why he initially resisted switching to Perl, why we don't currently program in AWK++, what line from a Woody Allen play best describes how he felt about creating SPUG, how his early torment by Catholic nuns has benefitted The Perl Foundation, and how and why we should all support and contribute to Perlity, a term he coins to describe the Perl Community (with a savings of two syllables). -Tim *------------------------------------------------------------* | Tim Maher, CONSULTIX (206) 781-UNIX (866) DOC-PERL | | CEO, JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | UPCOMING CLASSES: Perl Programming, 3/24-26, Tukwila WA | *------------------------------------------------------------* From jmates at sial.org Thu Mar 6 15:16:51 2003 From: jmates at sial.org (Jeremy Mates) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:DOS textfiles and perl on unix Message-ID: <20030306211651.GC365@darkness.sial.org> DOS textfiles cause problems for unix, which tries to invoke /usr/bin/perl^M and subsequently fails with a helpful message. ln -s /usr/bin/perl `echo -e "/usr/bin/perl\r"` Actually lets the script run, in my limited testing with perl 5.8 on Mac OS X. Another option would be to create a perl^M that issues a warning. #!/bin/sh echo "error: $1 uses DOS linebreaks" >&2 exit 1 From spug at ifokr.org Thu Mar 6 16:40:45 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:DOS textfiles and perl on unix In-Reply-To: <20030306211651.GC365@darkness.sial.org> References: <20030306211651.GC365@darkness.sial.org> Message-ID: <20030306224045.GT15218@ifokr.org> > DOS textfiles cause problems for unix, which tries to invoke > /usr/bin/perl^M and subsequently fails with a helpful message. > > ln -s /usr/bin/perl `echo -e "/usr/bin/perl\r"` > > Actually lets the script run, in my limited testing with perl > 5.8 on Mac OS X. Another option would be to create a perl^M > that issues a warning. > > #!/bin/sh > echo "error: $1 uses DOS linebreaks" >&2 > exit 1 You could also save the file without any DOS \r's at the end of the line. If you're FTPing, make sure you use ASCII mode. If you use SFTP (ftp-like over SSH) then there is no such beast, however you can fix it once it's uploaded: $ cd /path/to/my/perl/script $ perl -pei.bak "s#\r#\n#g" my_perl_script then my_perl_script won't have those annoying \r's and will run just fine. I had to create a cron job that did this in a CGI directory for a client that constantly uploaded them from a DOS machine. Rather than hacking around to let a broken program work, fix the program. -- Brian Hatch "It will be fun. Assuming you are not Systems and vaporised, dissected, or otherwise Security Engineer killed in an assortment of supremely http://www.ifokr.org/bri/ horrible and painful ways. *Exciting*, isn't it?" Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030306/4768340c/attachment.bin From tim at consultix-inc.com Thu Mar 6 22:41:43 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:Bellevue Perl/postgresSQL/Linux job In-Reply-To: References: Message-ID: <20030306204143.A29553@timji.consultix-inc.com> > Smooth Corporation is an online retailer of home improvement goods and > services, especially in the flooring industry. Our flagship domain, > iFLOOR.com has become the most successful site in the floorcovering > industry. We write our own software to power all of our sites which include > Cornerhardware.com, DIYflooring.com, Carpet.com, EarthwiseFloors.com, and > FloorCOW.com, among others. > > We are currently looking for an individual to help us grow our software > features. We need someone who is skilled with Perl and postgreSQL on Linux. > Our immediate need is to build reports for our management team and for our > customers that capture the valuable information in our weblogs and in our > database. Our longer term need is to add features and capabilities to our > software modules. We would like to find someone with a background or > experience in statistics, accounting, and/or financial reporting, but we > will talk to any and all accomplished Perl programmers. > > Smooth Corporation is located in Bellevue. Job is permanent, W2. > Telecommuting is not possible. Email Rick Altenhoffen at > rick@smoothcorp.com if interested. From marc.gibian at acm.org Thu Mar 6 23:00:54 2003 From: marc.gibian at acm.org (Marc S. Gibian) Date: Mon Aug 2 21:36:52 2004 Subject: SPUG:DOS textfiles and perl on unix In-Reply-To: <20030306224045.GT15218@ifokr.org> Message-ID: <003801c2e466$885abbc0$0200a8c0@marc39ph9qz5mg> The apparently is a bug in sysread & syswrite that causes net::ftp to fail to properly convert end-of-line when moving files between Windows and non-Windows platforms. I've been trying to figure out why that has not been working and today someone submitted it as a bug against Perl. There is a workaround, changing the relevant line in net::ftp from sysread to read and syswrite to write. Hope this helps others, Marc -----Original Message----- From: spug-list-admin@mail.pm.org [mailto:spug-list-admin@mail.pm.org] On Behalf Of Brian Hatch Sent: Thursday, March 06, 2003 2:41 PM To: Jeremy Mates; spug-list@pm.org Subject: Re: SPUG:DOS textfiles and perl on unix > DOS textfiles cause problems for unix, which tries to invoke > /usr/bin/perl^M and subsequently fails with a helpful message. > > ln -s /usr/bin/perl `echo -e "/usr/bin/perl\r"` > > Actually lets the script run, in my limited testing with perl > 5.8 on Mac OS X. Another option would be to create a perl^M > that issues a warning. > > #!/bin/sh > echo "error: $1 uses DOS linebreaks" >&2 > exit 1 You could also save the file without any DOS \r's at the end of the line. If you're FTPing, make sure you use ASCII mode. If you use SFTP (ftp-like over SSH) then there is no such beast, however you can fix it once it's uploaded: $ cd /path/to/my/perl/script $ perl -pei.bak "s#\r#\n#g" my_perl_script then my_perl_script won't have those annoying \r's and will run just fine. I had to create a cron job that did this in a CGI directory for a client that constantly uploaded them from a DOS machine. Rather than hacking around to let a broken program work, fix the program. -- Brian Hatch "It will be fun. Assuming you are not Systems and vaporised, dissected, or otherwise Security Engineer killed in an assortment of supremely http://www.ifokr.org/bri/ horrible and painful ways. *Exciting*, isn't it?" Every message PGP signed From MichaelRunningWolf at att.net Fri Mar 7 01:28:20 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Term::ReadKey on Windows 2000 Message-ID: Has anyone gotten Term::ReadKey to install on a windows box? I've seen reference to a TermReadKey.ppd and ReadKey.dll, but I havn't found how to make them work. Have you? Does anyone know why such an important module (to cpan.bat, at least) doesn't install easily on Windows machines? Thanks, Michael Wolf P.S. These Unix-centric and compiler-dependent Perl modules are starting to really affect my productivity (i.e. tick me off and prevent my progress) on a Windows machine. I'll post more about this later. In general, however, is there anyone out there who's as happy with Perl on Windows as they are with Perl on Unix? (BTW - This is *not* the same question as "are you as happy with Windows as you are with Unix"). -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From matw at eclipse-optics.com Fri Mar 7 09:26:40 2003 From: matw at eclipse-optics.com (Mathew D. Watson) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Where can I find win32-GUI documents? In-Reply-To: <200303052050.49316.jay@scherrer.com> Message-ID: I am looking for a Win pearl gui, and all I was aware of is the win32 one. My needs are modest, so any of the others you mention will probably do fine. Wow! "widget" from the command prompt worked. =8^) I'll check out Qt and Gtk as well. I've seen them in the Linux world, but I'm surprised that they run in the Win world. That's great if they do. Thanks for lending a hand everyone. --Mat > -----Original Message----- > From: spug-list-admin@mail.pm.org [mailto:spug-list-admin@mail.pm.org]On > Behalf Of Jay Scherrer > Sent: Wednesday, March 05, 2003 8:51 PM > To: Marc.M.Adkins@Doorways.org; spug > Subject: Re: SPUG:Where can I find win32-GUI documents? > > > Are you asking about GUI's in general? > Active state ships with Perl::Tk by default. But there are several others > [Qt, Gtk+,Tk]. > If your on a windows or linux box enter: widget > To test for the Tk install. > Jay > > On Wednesday 05 March 2003 09:19 am, Marc M. Adkins wrote: > > > I've been trying to locate documentation on the win32-GUI > package, but I > > > haven't had any luck (active state, cpan, dada.perl.it). > > > > http://dada.perl.it/gui_docs/gui.html, but it's kind of sparse. > Seems like > > there was more, maybe it comes with the package, maybe I remember wrong. > > > > The CPAN module hasn't had action since 2001, the version on > dada.perl.it > > has a date of February 2002. I used it back then and it worked OK. It > > never got out of beta though, so there's a lot of stuff that never quite > > got finished. > > > > At this time I'm recommending the wxPerl code, which works with > wxWindows, > > a cross-platform GUI library. Both wxWindows and wxPerl are > active at this > > time. The only downside is you must acquire or build wxWindows > separately, > > it doesn't download with wxPerl. > > > > mma > > > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list@mail.pm.org > > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > > WEB PAGE: www.seattleperl.org > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > > From spug at ifokr.org Fri Mar 7 09:48:35 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:OSX and mod_perl? Message-ID: <20030307154835.GX15218@ifokr.org> Does OSX's version of Apache have mod_perl available? Does it work? Is there an OSX version of MySQL, or is fink the only option for that, assuming the guy doesn't have a compiler? Looking for "Yes, I've actually tried it" responses if possible. (Still helping that distant friend....) -- Brian Hatch No Microsoft programs Systems and were used in the Security Engineer creation or distribution http://www.ifokr.org/bri/ of this message. Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030307/d17d9a72/attachment.bin From jmates at sial.org Fri Mar 7 11:39:46 2003 From: jmates at sial.org (Jeremy Mates) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Re: OSX and mod_perl? In-Reply-To: <20030307154835.GX15218@ifokr.org> References: <20030307154835.GX15218@ifokr.org> Message-ID: <20030307173946.GJ365@darkness.sial.org> * Brian Hatch > Does OSX's version of Apache have mod_perl available? Does it work? > Is there an OSX version of MySQL, or is fink the only option for that, > assuming the guy doesn't have a compiler? mod_perl is available as a DSO on Mac OS X, though would need to be enabled in the httpd.conf file. Apple added MySQL to the system by default in the Jaguar (10.2) release. An alternative to fink is the NetBSD pksrc, which could be used to compile tarballs elsewhere then shipped to the system in question: http://www.netbsd.org/Documentation/software/packages.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030307/aebfbd67/attachment.bin From oubiwann at myrealbox.com Fri Mar 7 13:55:15 2003 From: oubiwann at myrealbox.com (Duncan McGreggor) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:OSX and mod_perl? References: <20030307154835.GX15218@ifokr.org> Message-ID: <3E68F923.8080603@myrealbox.com> Yes, I built it as a DSO on my powerbook "dev box" ;-) The author of Bricolage (David Wheeler) uses Macs extensively, and goes through a fairly thorough how-to on all things required to run Bricolage (one of which is mod_perl) on Mac OS X. Here's the link: http://david.wheeler.net/osx.html Brian Hatch wrote: >Does OSX's version of Apache have mod_perl available? >Does it work? Is there an OSX version of MySQL, or is >fink the only option for that, assuming the guy doesn't >have a compiler? > >Looking for "Yes, I've actually tried it" responses if >possible. > >(Still helping that distant friend....) > >-- >Brian Hatch No Microsoft programs > Systems and were used in the > Security Engineer creation or distribution >http://www.ifokr.org/bri/ of this message. > >Every message PGP signed > > From daryn at marinated.org Fri Mar 7 14:15:09 2003 From: daryn at marinated.org (Daryn Nakhuda) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:OSX and mod_perl? References: <20030307154835.GX15218@ifokr.org> <3E68F923.8080603@myrealbox.com> Message-ID: <005901c2e4e6$40e0a3b0$6501a8c0@platypus> There's an OSX version of MySQL. Look on (big surprise here) mysql.com I'm happily running mysql 4.0.11 max on my powerbook. ----- Original Message ----- From: "Duncan McGreggor" To: "Brian Hatch" Cc: "spug" Sent: Friday, March 07, 2003 11:55 AM Subject: Re: SPUG:OSX and mod_perl? > Yes, > > I built it as a DSO on my powerbook "dev box" ;-) > > The author of Bricolage (David Wheeler) uses Macs extensively, and goes > through a fairly thorough how-to on all things required to run Bricolage > (one of which is mod_perl) on Mac OS X. Here's the link: > > http://david.wheeler.net/osx.html > > Brian Hatch wrote: > > >Does OSX's version of Apache have mod_perl available? > >Does it work? Is there an OSX version of MySQL, or is > >fink the only option for that, assuming the guy doesn't > >have a compiler? > > > >Looking for "Yes, I've actually tried it" responses if > >possible. > > > >(Still helping that distant friend....) > > > >-- > >Brian Hatch No Microsoft programs > > Systems and were used in the > > Security Engineer creation or distribution > >http://www.ifokr.org/bri/ of this message. > > > >Every message PGP signed > > > > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > > From djames at serv.net Fri Mar 7 17:27:01 2003 From: djames at serv.net (Daniel James) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:OSX and mod_perl? In-Reply-To: <005901c2e4e6$40e0a3b0$6501a8c0@platypus>; from Daryn Nakhuda on Fri, Mar 07, 2003 at 12:15:09PM -0800 References: <20030307154835.GX15218@ifokr.org> <3E68F923.8080603@myrealbox.com> <005901c2e4e6$40e0a3b0$6501a8c0@platypus> Message-ID: <20030307152701.A86487@itchy.serv.net> On Fri, Mar 07, 2003 at 12:15:09PM -0800, Daryn Nakhuda wrote: > I'm happily running mysql 4.0.11 max on my powerbook. Enough people! -- I've already been eyeing the 12" powerbook as I've always been a Mac Advocate (and recently forced into a PC world), plus my Dell is simply too big to use on an airplane (it's barely usable even in first class). All this talk of running mysql, perl and apache on your powerbooks is gonna push me over the edge and force me to spend all that money! Anyone care to take up a collection for the (my) cause??? ;-) From joneil at cobaltgroup.com Fri Mar 7 17:41:29 2003 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:OSX and mod_perl? Message-ID: > All this talk of running mysql, perl and apache on your powerbooks is > gonna push me over the edge and force me to spend all that money! I have PostgreSQL, JBoss, and Tomcat, Apache and Perl all running nicely on my Vaio. It's itty bitty, and it rocks. -Jerome -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/spug-list/attachments/20030307/234805ec/attachment.htm From aaron at activox.com Fri Mar 7 18:23:25 2003 From: aaron at activox.com (Aaron Salo) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:OSX and mod_perl? In-Reply-To: Message-ID: <3.0.5.32.20030307162325.010cede8@mail.activox.com> Ditto on the Vaio. My four year old PCG-505F (P233 MMX with 96mb ram) runs WAMP and perl flawlessly on W2K, great dev machine and super portable. You can pick one up on ebay in the $300 range. ~!a At 03:41 PM 3/7/2003 -0800, O'neil, Jerome wrote: >>>> > All this talk of running mysql, perl and apache on your powerbooks is > gonna push me over the edge and force me to spend all that money! I have PostgreSQL, JBoss, and Tomcat, Apache and Perl all running nicely on my Vaio. It's itty bitty, and it rocks. -Jerome <<<< From davidinnes at chicagoscience.com Fri Mar 7 20:48:04 2003 From: davidinnes at chicagoscience.com (David Innes (CSG)) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Term::ReadKey on Windows 2000 In-Reply-To: Message-ID: <01bb01c2e51d$274bda50$0300000a@delta> For my part I've heard that Perl runs on Unix but I've never gotten it to work. So I don't use Unix. I agree 100% that Unix-centric and compiler-dependent Perl modules are generally a crock (as would be Win, Mac, or PDP-11-centric modules unless they were clearly labeled as incomplete, inadequate, or otherwise portability-impared. Anyway it seems silly to ignore 300,000,000 or so Windows client boxes.) Given all that I've always used the ActiveState distribution and for the most part grab modules from their modified (and incomplete) repository. This has its own set of annoyances but (since I'm going to work and not to church) they've got class enough not to claim unbelievers are going to Hell for not using Windows. But I digress... Years ago I deployed a WinNT/W2K script that used ReadKey and that part worked fine. (On the other hand to get the script to work I had to write my own miserable hack of the sleep function because no one, in their infinite wisdom, feels the need to write a portable version. But again I digress.) Anyway, TermReadKey.ppd is ActiveState's distribution hints file for the Term::ReadKey module. ReadKey.dll is part of that distribution. Here's what else gets installed, and in what folders. H:\Perl\site\lib\auto\Term\ReadKey\ReadKey.bs H:\Perl\site\lib\auto\Term\ReadKey\ReadKey.dll H:\Perl\site\lib\auto\Term\ReadKey\ReadKey.exp H:\Perl\site\lib\auto\Term\ReadKey\ReadKey.lib H:\Perl\site\lib\Term\ReadKey.pm H:\Perl\site\lib\auto\Term\ReadKey\autosplit.ix As a mere Perl programmer and not a "real" programmer I have no idea how to compile the thing from scratch. (Note: I'm only rarely sorry I'm "only" a Perl programmer. Speaking of which, did you see Jon Udell's column on that very thing in InfoWorld? http://www.infoworld.com/article/03/02/06/06stratdev_1.html) -- David Innes -----Original Message----- From: spug-list-admin@mail.pm.org [mailto:spug-list-admin@mail.pm.org] On Behalf Of Michael R. Wolf Sent: Thursday, March 06, 2003 11:28 PM To: spug-list@pm.org Subject: SPUG:Term::ReadKey on Windows 2000 Has anyone gotten Term::ReadKey to install on a windows box? I've seen reference to a TermReadKey.ppd and ReadKey.dll, but I havn't found how to make them work. Have you? Does anyone know why such an important module (to cpan.bat, at least) doesn't install easily on Windows machines? Thanks, Michael Wolf P.S. These Unix-centric and compiler-dependent Perl modules are starting to really affect my productivity (i.e. tick me off and prevent my progress) on a Windows machine. I'll post more about this later. In general, however, is there anyone out there who's as happy with Perl on Windows as they are with Perl on Unix? (BTW - This is *not* the same question as "are you as happy with Windows as you are with Unix"). -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, U-District, Seattle WA WEB PAGE: www.seattleperl.org From thane at fastmail.fm Sun Mar 9 16:28:17 2003 From: thane at fastmail.fm (Thane Williams) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question Message-ID: <20030309222817.D4CC14D257@server2.fastmail.fm> Ok, maybe someone can point out the obvious to me here. Here's my code: #!/usr/bin/perl my %record; $record{Wilma}{age} = 32; $record{Fred}{age} = 38; $record{Wilma}{sex} = "female"; $record{Fred}{sex} = "male"; foreach my $key (keys %record) { my $age = $record{$key}{age}; my $sex = $record{$key}{sex}; foreach ("age", "sex") { print "$_ for $key is ${$_}\n"; } } The foreach loop prints this: age for Fred is sex for Fred is age for Wilma is sex for Wilma is If $_ equals "age", I'd expect ${$_} to equal $age.. which it apparently doesn't. (I get the same results even if I put "my $age = 50;"). I tried this test code: #!/usr/bin/perl $name = "Fred"; $age = "55"; $sex = "male"; foreach ("age", "sex") { print "$_ for $name is ${$_}\n"; } And it works! What's the difference? Thanks in advance.. From damian at conway.org Sun Mar 9 16:52:56 2003 From: damian at conway.org (Damian Conway) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question In-Reply-To: <20030309222817.D4CC14D257@server2.fastmail.fm> References: <20030309222817.D4CC14D257@server2.fastmail.fm> Message-ID: <3E6BC5C8.3020507@conway.org> Thane Williams wrote: > Ok, maybe someone can point out the obvious to me here. Here's my code: > > #!/usr/bin/perl > my %record > $record{Wilma}{age} = 32; > $record{Fred}{age} = 38; > $record{Wilma}{sex} = "female"; > $record{Fred}{sex} = "male"; > > foreach my $key (keys %record) { > my $age = $record{$key}{age}; > my $sex = $record{$key}{sex}; Lexical scalars used. > > foreach ("age", "sex") { > print "$_ for $key is ${$_}\n"; > } > } > > The foreach loop prints this: > age for Fred is > sex for Fred is > age for Wilma is > sex for Wilma is > > If $_ equals "age", I'd expect ${$_} to equal $age.. which it apparently > doesn't. (I get the same results even if I put "my $age = 50;"). > > I tried this test code: > > #!/usr/bin/perl > $name = "Fred"; > $age = "55"; > $sex = "male"; Package scalars used. > foreach ("age", "sex") { > print "$_ for $name is ${$_}\n"; > } > And it works! What's the difference? ${$_} is ${"name"} or ${"age"}. These are symbolic dereferences. Symbolic dereferences always end up at a package variable, never a lexical. HTH, Damian From umar at drizzle.com Sun Mar 9 17:04:10 2003 From: umar at drizzle.com (Umar Cheema) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question In-Reply-To: <3E6BC5C8.3020507@conway.org> Message-ID: If you remove the "my" from the $age and $sex assignments, it works: foreach my $key (keys %record) { $age = $record{$key}{age}; $sex = $record{$key}{sex}; foreach ("age", "sex") { print "$_ for $key is ${$_}\n"; } } I'd be curious to know why this works? On Mon, 10 Mar 2003, Damian Conway wrote: > Thane Williams wrote: > > > Ok, maybe someone can point out the obvious to me here. Here's my code: > > > > #!/usr/bin/perl > > my %record > > $record{Wilma}{age} = 32; > > $record{Fred}{age} = 38; > > $record{Wilma}{sex} = "female"; > > $record{Fred}{sex} = "male"; > > > > foreach my $key (keys %record) { > > my $age = $record{$key}{age}; > > my $sex = $record{$key}{sex}; > > Lexical scalars used. > > > > > foreach ("age", "sex") { > > print "$_ for $key is ${$_}\n"; > > } > > } > > > > The foreach loop prints this: > > age for Fred is > > sex for Fred is > > age for Wilma is > > sex for Wilma is > > > > If $_ equals "age", I'd expect ${$_} to equal $age.. which it apparently > > doesn't. (I get the same results even if I put "my $age = 50;"). > > > > I tried this test code: > > > > #!/usr/bin/perl > > $name = "Fred"; > > $age = "55"; > > $sex = "male"; > > Package scalars used. > > > foreach ("age", "sex") { > > print "$_ for $name is ${$_}\n"; > > } > > And it works! What's the difference? > > ${$_} is ${"name"} or ${"age"}. > These are symbolic dereferences. > Symbolic dereferences always end up at a package variable, never a lexical. > > HTH, > > Damian > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > From richard at richard-anderson.org Sun Mar 9 17:14:22 2003 From: richard at richard-anderson.org (Richard Anderson) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question References: <20030309222817.D4CC14D257@server2.fastmail.fm> Message-ID: <3e6bcaceb879f3.61592237@zipcon.com> Hi Thane. You quandary is another example of why almost every Perl program should start with: #! /usr/bin/perl -w use strict; Adding this to your program and running makes it abort with the message: Can't use string ("age") as a SCALAR ref while "strict refs" in use when Perl executes the line: print "$_ for $key is ${$_}\n"; You are attempting to treat $age as a scalar reference when it is just a scalar, not a reference. The following code works: #! /usr/local/bin/perl -w use strict; my %record; $record{Wilma}{age} = 32; $record{Fred}{age} = 38; $record{Wilma}{sex} = "female"; $record{Fred}{sex} = "male"; foreach my $key (keys %record) { my $age = $record{$key}{age}; my $sex = $record{$key}{sex}; print "age for $key is $age\n"; print "sex for $key is $sex\n"; } -- Richard Anderson richard@richard-anderson.org www.richard-anderson.org > Ok, maybe someone can point out the obvious to me here. Here's my code: > > #!/usr/bin/perl > my %record; > $record{Wilma}{age} = 32; > $record{Fred}{age} = 38; > $record{Wilma}{sex} = "female"; > $record{Fred}{sex} = "male"; > > foreach my $key (keys %record) { > my $age = $record{$key}{age}; > my $sex = $record{$key}{sex}; > > foreach ("age", "sex") { > print "$_ for $key is ${$_}\n"; > } > } > > The foreach loop prints this: > age for Fred is > sex for Fred is > age for Wilma is > sex for Wilma is > > If $_ equals "age", I'd expect ${$_} to equal $age.. which it apparently > doesn't. (I get the same results even if I put "my $age = 50;"). > > I tried this test code: > > #!/usr/bin/perl > $name = "Fred"; > $age = "55"; > $sex = "male"; > foreach ("age", "sex") { > print "$_ for $name is ${$_}\n"; > } > And it works! What's the difference? > Thanks in advance.. > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > > From thane at fastmail.fm Sun Mar 9 18:54:08 2003 From: thane at fastmail.fm (Thane Williams) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question In-Reply-To: <3E6BC5C8.3020507@conway.org> References: <20030309222817.D4CC14D257@server2.fastmail.fm> <3E6BC5C8.3020507@conway.org> Message-ID: <20030310005408.A18294F264@server2.fastmail.fm> Thanks for the answers. On Mon, 10 Mar 2003 09:52:56 +1100, "Damian Conway" said: > Thane Williams wrote: > > > Ok, maybe someone can point out the obvious to me here. Here's my code: > > > > #!/usr/bin/perl > > my %record > > $record{Wilma}{age} = 32; > > $record{Fred}{age} = 38; > > $record{Wilma}{sex} = "female"; > > $record{Fred}{sex} = "male"; > > > > foreach my $key (keys %record) { > > my $age = $record{$key}{age}; > > my $sex = $record{$key}{sex}; > > Lexical scalars used. > > > > > foreach ("age", "sex") { > > print "$_ for $key is ${$_}\n"; > > } > > } > > > > The foreach loop prints this: > > age for Fred is > > sex for Fred is > > age for Wilma is > > sex for Wilma is > > > > If $_ equals "age", I'd expect ${$_} to equal $age.. which it apparently > > doesn't. (I get the same results even if I put "my $age = 50;"). > > > > I tried this test code: > > > > #!/usr/bin/perl > > $name = "Fred"; > > $age = "55"; > > $sex = "male"; > > Package scalars used. > > > foreach ("age", "sex") { > > print "$_ for $name is ${$_}\n"; > > } > > And it works! What's the difference? > > ${$_} is ${"name"} or ${"age"}. > These are symbolic dereferences. > Symbolic dereferences always end up at a package variable, never a > lexical. > > HTH, > > Damian > > From cansubaykan at hotmail.com Sun Mar 9 20:17:01 2003 From: cansubaykan at hotmail.com (John Subaykan) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question Message-ID: >If you remove the "my" from the $age and $sex assignments, it works: >... >I'd be curious to know why this works? Because it is the 'my' that makes it a lexical variable (accessible from only within the block). Without the 'my', it is a package variable (accessible by name from within the package, or fully qualified name like $Package::variable) _________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 From adamm at wazamatta.com Sun Mar 9 16:38:03 2003 From: adamm at wazamatta.com (Adam Monsen) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Reference question In-Reply-To: <20030309222817.D4CC14D257@server2.fastmail.fm> References: <20030309222817.D4CC14D257@server2.fastmail.fm> Message-ID: <3E6BC24B.60706@wazamatta.com> Thane Williams wrote: > Ok, maybe someone can point out the obvious to me here. Here's my code: [...] What everyone else said was right (package vs. lexical and always use strict). I'd also suggest /not/ hardcoding "age" and "sex" in your inner loop. Also, if you initialize the whole hash at once, write it out so your data structure is very clear. #!/usr/bin/perl -w use strict; my %records = ( Wilma => { age => 32, sex => "female" }, Fred => { age => 38, sex => "male" }, ); foreach my $name (keys %records) { my $person = $records{$name}; foreach my $trait (keys %$person) { print "$trait for $name is $person->{$trait}\n"; } } -- Was I helpful? Let others know: http://svcs.affero.net/rm.php?r=meonkeys&p=Default From m3047 at inwa.net Mon Mar 10 00:51:34 2003 From: m3047 at inwa.net (Fred Morris) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:SqlHtmlRpt redux (nested/sequential queries) Message-ID: Hello all, Well nobody in Seattle was particularly interested in it the first time, but I just finished a major (and yet backwards-compatible) enhancement to SqlHtmlRpt. This is a gizmo I wrote to use with my Calendar and Contacts app, and found useful enough that I appropriated it for other purposes.. for which it performed admirably. But then I got wind of our own SPUG Town Crier's grand scheme of listing any number of things maybe only vaguely related to Perl (I'm not saying I really understand what his ultimate goal is, but this is what I make of it), and I thought hey, the Calendar thingie would do really nice for this. As I was working on a SPUG "face", I wanted "just a little bit more": * I wanted to have more than one query on the same template. * I wanted to have the ability to execute a query for each row returned in some other query. So, that's what I spent the weekend working on. The app in total isn't "free beer" software, but I have been handing out SqlHtmlRpt to people who ask nicely and who come to the table with some virtue; I'm hoping eventually I'll get some useful quantity of feedback and who knows, maybe somebody will offer to package it for CPAN (or FreePAN)... because I know I'll never get around to it on my own... I have better things to do, like writing software, trying to earn a living, tilting at windmills like "Pacific Northwest IT"... The "SPUG Face" is a link off of here: http://216.173.211.39/calendar/pnwit/index.html Definitely needs more substance. Somebody give the box a DNS entry, will ya? -- Fred Morris m3047@inwa.net From MichaelRunningWolf at att.net Mon Mar 10 22:51:49 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Apocalypse 6 is Out Message-ID: http://www.perl.com/pub/a/2003/03/07/apocalypse6.html -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From MichaelRunningWolf at att.net Mon Mar 10 23:02:14 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Apocalypse 6 is Out In-Reply-To: References: Message-ID: "Michael R. Wolf" writes: > http://www.perl.com/pub/a/2003/03/07/apocalypse6.html Oops, forgot to mention, this one's about subroutines. Grab a very comfy chair -- the printer-friendly version is 87 pages long! Anyone venture a guess what Damian's up to right now???? Can you say closure? -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From brianwisti at yahoo.com Tue Mar 11 01:41:47 2003 From: brianwisti at yahoo.com (Brian Wisti) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Apocalypse 6 is Out In-Reply-To: Message-ID: <20030311074147.44751.qmail@web13903.mail.yahoo.com> I'm only about a third of the way through it, so I'll have to pick it up again in the morning. Gotta admit, though, this Apocalypse has me excited about Perl in a way that I haven't been for at least a year :-) -Brian W http://coolnamehere.com/ --- "Michael R. Wolf" wrote: > "Michael R. Wolf" > writes: > > > > http://www.perl.com/pub/a/2003/03/07/apocalypse6.html > > Oops, forgot to mention, this one's about > subroutines. > > Grab a very comfy chair -- the printer-friendly > version is 87 pages > long! > > > > Anyone venture a guess what Damian's up to right > now???? > > Can you say closure? > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRunningWolf@att.net > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: > http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From tim at consultix-inc.com Tue Mar 11 19:28:56 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:March Meeting: "Green Lightning Talks" Message-ID: <20030311172856.A3275@timji.consultix-inc.com> SPUGsters, I'd like to encourage all of you to consider speaking for 5 minutes or more on some Perlish topic you'd like to share with the group next week. Please contact me if you'd like to get on the agenda. ======================================================= | Tim Maher, Ph.D. tim@timmaher.org | | JAWCAR ("Just Another White-Camel Award Recipient") | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ======================================================= March 2003 Seattle Perl Users Group Meeting ----------------------------------------------------- Theme: "Green Lightning Festival" Speakers: Various SPUGsters Time: Wednesday, March 18, 2003 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/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This month, we'll feature several short talks by SPUG members, ranging in duration from 5 to 20 minutes. This is a good way to get started in sharing your knowledge with other SPUGSsters, and we still have open slots for additional speakers, so send email if you want to participate. Why Green Lighting? SPUG was born on St. Patrick's day, 1998, so please help us celebrate SPUG's 5th Birthday by wearing GREEN at this month's meeting! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "Modules from the Spring Collection" by Tim Maher, Consultix Tim will give a demo of his new module, Shell::POSIX::Select (see http://teachmeperl.com/Select.html), and give short talks on other Perly things, some excerpted from past and future conference presentations. _________________________________________________________________ "Use vs. Require" by Jay Scherrer, Practical Tax Jay's been writing a Perl program to implement the 1040 tax return, which you can read about at his web site. Along the way, he's learned that it's better to use "require" when "use" is not required, and he'll be sharing his knowledge of that subject in this short talk. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Pre- and Post- Meeting Activities --------------------------------- The pre-meeting dinner will be at 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 RSVP to the list by 2pm on the meeting day with your expected arrival time (5:30-5:45pm is recommended). TO BE FAIR, from now on only those who comply with the RSVP policy (and are therefore counted in the seating reservation) will be allowed to sit at the speaker's table. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== From andrew at sweger.net Wed Mar 12 12:54:06 2003 From: andrew at sweger.net (Andrew Sweger) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 Message-ID: I'll be at Cedars on Tuesday at 5:30. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From david.reite at infospace.com Wed Mar 12 17:02:08 2003 From: david.reite at infospace.com (David Reite) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 Message-ID: A pre-meet sounds good to me. I'm a SPUG newbie (Hmm, is there a term for that?) You can blame Tim for me showing up. :) - Dave From tim at consultix-inc.com Wed Mar 12 21:34:59 2003 From: tim at consultix-inc.com (SPUG-list-owner) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 In-Reply-To: References: Message-ID: <20030312193459.A8273@timji.consultix-inc.com> On Wed, Mar 12, 2003 at 03:02:08PM -0800, David Reite wrote: > A pre-meet sounds good to me. > > I'm a SPUG newbie (Hmm, is there a term for that?) You can blame Tim for me showing up. :) > > - Dave What he means is he took my class, and that inspired him to delve deeper in the SPUGly activities of Seattle. Hmmm ... what term for SPUG newbies? SPUGling? SPUGette? SPUGito? This could take some thought . . . By the way, we've not got 5 speakers lined up for the meeting next week (Tuesday, not Wednesday! D'oh!), and room for more still. Let me know if any more of you want to join in. See you there! -Tim *------------------------------------------------------------* | Tim Maher, CONSULTIX (206) 781-UNIX (866) DOC-PERL | | CEO, JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | UPCOMING CLASSES: Perl Programming, 3/24-26, Tukwila WA | *------------------------------------------------------------* From kahn at cpan.org Wed Mar 12 21:56:50 2003 From: kahn at cpan.org (Jeremy Kahn) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 In-Reply-To: <20030312193459.A8273@timji.consultix-inc.com> Message-ID: On Wed, 12 Mar 2003, SPUG-list-owner wrote: > Hmmm ... what term for SPUG newbies? > > SPUGling? SPUGette? SPUGito? I think you're a Spuggle until you're a wizard. > By the way, we've not got 5 speakers lined up for the meeting next week > (Tuesday, not Wednesday! D'oh!), and room for more still. Let me know > if any more of you want to join in. I wish I could. I'll be out of town. Hope to see you all in the next go-round. --jeremy, who still sometimes feels like a spuggle From jay at scherrer.com Thu Mar 13 11:05:42 2003 From: jay at scherrer.com (Jay Scherrer) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 In-Reply-To: References: Message-ID: <200303130905.43667.jay@scherrer.com> I'll Cedar SPUG ! Jay From wildwood_players at yahoo.com Thu Mar 13 13:01:42 2003 From: wildwood_players at yahoo.com (Richard Wood) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric Message-ID: <20030313190142.91872.qmail@web11503.mail.yahoo.com> I have the need/desire to auto-increment a three character scalar that may contain: all numerics, all alphas, or mixed alpha-numeric. auto-increment works fine for all alpha and all numeric and in some cases with a mix of alpha-numerics but not when a numeric precedes an alpha. In those cases I get two types of results. (e.g. '1AA' becomes 2, 'A1A' becomes 1, then 2). Anyone have a simple solution to this? I will continue to look around and try things but I thought I would ask the community before any more time slipped away. Here is my test program and results: #!/usr/bin/perl -w @strings = qw(AAA AA8 A8A A98 118 18A 1A8 8AA); foreach $str (@strings) { for ($i=0;$i<3;$i++) { print "$str\t"; $str++; } print "\n"; } __END__ AAA AAB AAC AA8 AA9 AB0 A8A 1 2 A98 A99 B00 118 119 120 18A 19 20 1A8 2 3 8AA 9 10 Regards, Rich Wood ===== Richard O. Wood Wildwood IT Consultants, Inc. wildwood_players@yahoo.com 425.281.1914 mobile 206.544.9885 desk __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From wildwood_players at yahoo.com Thu Mar 13 13:28:08 2003 From: wildwood_players at yahoo.com (Richard Wood) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric In-Reply-To: <20030313190142.91872.qmail@web11503.mail.yahoo.com> Message-ID: <20030313192808.96981.qmail@web11503.mail.yahoo.com> Here is what I am using in the meantime while waiting for an elegant solution. #!/usr/bin/perl -w @strings = qw(AAA AZ8 A8A A98 118 18A 1A8 8AA); foreach $str (@strings) { for ($i=0;$i<3;$i++) { print "$str\t"; myinc(); } print "\n"; } sub myinc { if ($str =~ /\d{3}|[A-Z]{3}|[A-Z]{1}\d{2}|[A-Z]{2}\d{1}/) { $str++; } else { $str =~ /(.)(.)(.)/; $a = $1; $b = $2; $c = $3; $c++; if (($c ne '10') && ($c ne 'AA')) { $str = "$a$b$c"; } else { $c =~ s/.(.)/$1/; $b++; if (($b ne '10') && ($b ne 'AA')) { $str = "$a$b$c"; } else { $b =~ s/.(.)/$1/; $a++; $str = "$a$b$c"; } } } } Rich Wood --- Richard Wood wrote: > I have the need/desire to auto-increment a three > character scalar that may contain: all numerics, all > alphas, or mixed alpha-numeric. > > auto-increment works fine for all alpha and all > numeric and in some cases with a mix of > alpha-numerics > but not when a numeric precedes an alpha. In those > cases I get two types of results. (e.g. '1AA' > becomes > 2, 'A1A' becomes 1, then 2). > > Anyone have a simple solution to this? I will > continue to look around and try things but I thought > I > would ask the community before any more time slipped > away. > > Here is my test program and results: > > #!/usr/bin/perl -w > @strings = qw(AAA AA8 A8A A98 118 18A 1A8 8AA); > foreach $str (@strings) { > for ($i=0;$i<3;$i++) { > print "$str\t"; > $str++; > } > print "\n"; > } > __END__ > AAA AAB AAC > AA8 AA9 AB0 > A8A 1 2 > A98 A99 B00 > 118 119 120 > 18A 19 20 > 1A8 2 3 > 8AA 9 10 > > Regards, > > Rich Wood > > ===== > Richard O. Wood > Wildwood IT Consultants, Inc. > wildwood_players@yahoo.com > 425.281.1914 mobile > 206.544.9885 desk > > __________________________________________________ > Do you Yahoo!? > Yahoo! Web Hosting - establish your business online > http://webhosting.yahoo.com > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: > http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > ===== Richard O. Wood Wildwood IT Consultants, Inc. wildwood_players@yahoo.com 425.281.1914 mobile 206.544.9885 desk __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From cwilkes-spug at ladro.com Thu Mar 13 14:04:50 2003 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric In-Reply-To: <20030313192808.96981.qmail@web11503.mail.yahoo.com> References: <20030313190142.91872.qmail@web11503.mail.yahoo.com> <20030313192808.96981.qmail@web11503.mail.yahoo.com> Message-ID: <20030313200450.GE30181@www.ladro.com> On Thu, Mar 13, 2003 at 11:28:08AM -0800, Richard Wood wrote: > Here is what I am using in the meantime while waiting > for an elegant solution. You might have to keep on waiting after this post ;) What I've done is created a new package variable called FunkyNumber that does your adding up in base 36 (base 10 + 26 letters). I've overloaded the ++ so that you can add to it. Substraction is just adding an overloader. Run it and you'll see a case like this: 2ZY 2ZZ 300 301 which I think is what you want. I've probably made some grievous perl error in my code, I've been known to do that. Chris #!/usr/bin/perl package FunkyNumber; use strict; use overload '+' => \&myadd, '++' => \&myadd, '""' => \&myprint; sub new { my ($proto, $class, $val, $self); $proto = shift; $class = ref($proto) || $proto; $val = shift || "AAA"; $self = {}; $self->{val} = $val; bless ( $self, $class); return $self; } sub myadd { my $self = shift; my ($carry, @stack, $pos); @stack = reverse split //, $self->{val}; while (1) { $stack[$pos]++; # check to see if we've gone from z -> aa or 9 -> 10 last unless (length($stack[$pos]) == 2); my $change = substr($stack[$pos], 0, 1); if (substr($stack[$pos], 0, 1) eq "A") { $stack[$pos] = 0; } else { $stack[$pos] = 'A'; } $pos++; last if ($pos > $#stack); } $self->{val} = join "", reverse @stack; } sub myprint { my $self = shift; return $self->{val}; } package main; use strict; my @strings = qw(AAA AA8 A8A A98 118 18A 2ZY 8AA A1Z); foreach my $str (@strings) { my $s = FunkyNumber->new($str); foreach (0..3) { print "$s\t"; $s++; } print "\n"; } From david.dyck at fluke.com Thu Mar 13 14:37:35 2003 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric In-Reply-To: <20030313200450.GE30181@www.ladro.com> References: <20030313190142.91872.qmail@web11503.mail.yahoo.com> <20030313192808.96981.qmail@web11503.mail.yahoo.com> <20030313200450.GE30181@www.ladro.com> Message-ID: On Thu, 13 Mar 2003 at 12:04 -0800, Chris Wilkes wrote: > What I've done is created a new package variable called FunkyNumber that > does your adding up in base 36 (base 10 + 26 letters). The magic string increment is case sensitive, so you may need to deal with lower case letters also. > Run it and you'll see a case like this: > 2ZY 2ZZ 300 301 > which I think is what you want. Or is 3AA desired from the increment of the ZZ AAA AAB AAC AA8 AA9 AB0 A8A A8B A8C A98 A99 B00 118 119 120 18A 18B 18C 1A8 1A9 1B0 8AA 8AB 8AC A9Y A9Z B0A 1Z8 1Z9 2A0 2ZY 2ZZ 3AA #!/usr/bin/perl -w @strings = qw(AAA AA8 A8A A98 118 18A 1A8 8AA A9Y 1Z8 2ZY); foreach $str (@strings) { for ($i=0;$i<3;$i++) { print "$str\t"; my $carry =1; my $right = ''; while ($carry) { if ($str =~ /^(.*?)([a-zA-Z]*[0-9]*)\z/) { my $match = $2; ++$match; if ($carry = (length($match) > length($2))) { $right = substr($match,1).$right; $str = $1; } else { $str = "$1$match"; } } else { ++$str; } } $str .= $right; } print "\n"; } __END__ ++ "++" behaves as the other operators above, except that if it is a string matching the format "/^[a-zA-Z]*[0-9]*\z/" the string increment described in perlop is used. from perlop If, however, the variable has been used in only string contexts since it was set, and has a value that is not the empty string and matches the pattern "/^[a-zA-Z]*[0-9]*\z/", the increment is done as a string, preserving each character within its range, with carry: print ++($foo = '99'); # prints '100' print ++($foo = 'a0'); # prints 'a1' print ++($foo = 'Az'); # prints 'Ba' print ++($foo = 'zz'); # prints 'aaa' From wildwood_players at yahoo.com Thu Mar 13 16:48:11 2003 From: wildwood_players at yahoo.com (Richard Wood) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric In-Reply-To: <20030313192808.96981.qmail@web11503.mail.yahoo.com> Message-ID: <20030313224811.32333.qmail@web11501.mail.yahoo.com> Thanks for the ideas, glad to see I wasn't missing something obvious. Rich Wood --- Richard Wood wrote: > Here is what I am using in the meantime while > waiting > for an elegant solution. > > #!/usr/bin/perl -w > @strings = qw(AAA AZ8 A8A A98 118 18A 1A8 8AA); > foreach $str (@strings) { > for ($i=0;$i<3;$i++) { > print "$str\t"; > myinc(); > } > print "\n"; > } > sub myinc { > if ($str =~ > /\d{3}|[A-Z]{3}|[A-Z]{1}\d{2}|[A-Z]{2}\d{1}/) { > $str++; > } > else { > $str =~ /(.)(.)(.)/; > $a = $1; > $b = $2; > $c = $3; > $c++; > if (($c ne '10') && ($c ne 'AA')) { > $str = "$a$b$c"; > } > else { > $c =~ s/.(.)/$1/; > $b++; > if (($b ne '10') && ($b ne 'AA')) { > $str = "$a$b$c"; > } > else { > $b =~ s/.(.)/$1/; > $a++; > $str = "$a$b$c"; > } > } > } > } > > Rich Wood > > --- Richard Wood wrote: > > I have the need/desire to auto-increment a three > > character scalar that may contain: all numerics, > all > > alphas, or mixed alpha-numeric. > > > > auto-increment works fine for all alpha and all > > numeric and in some cases with a mix of > > alpha-numerics > > but not when a numeric precedes an alpha. In > those > > cases I get two types of results. (e.g. '1AA' > > becomes > > 2, 'A1A' becomes 1, then 2). > > > > Anyone have a simple solution to this? I will > > continue to look around and try things but I > thought > > I > > would ask the community before any more time > slipped > > away. > > > > Here is my test program and results: > > > > #!/usr/bin/perl -w > > @strings = qw(AAA AA8 A8A A98 118 18A 1A8 8AA); > > foreach $str (@strings) { > > for ($i=0;$i<3;$i++) { > > print "$str\t"; > > $str++; > > } > > print "\n"; > > } > > __END__ > > AAA AAB AAC > > AA8 AA9 AB0 > > A8A 1 2 > > A98 A99 B00 > > 118 119 120 > > 18A 19 20 > > 1A8 2 3 > > 8AA 9 10 > > > > Regards, > > > > Rich Wood > > > > ===== > > Richard O. Wood > > Wildwood IT Consultants, Inc. > > wildwood_players@yahoo.com > > 425.281.1914 mobile > > 206.544.9885 desk > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Web Hosting - establish your business > online > > http://webhosting.yahoo.com > > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list@mail.pm.org > > ACCOUNT CONFIG: > > http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > > WEB PAGE: www.seattleperl.org > > > > > ===== > Richard O. Wood > Wildwood IT Consultants, Inc. > wildwood_players@yahoo.com > 425.281.1914 mobile > 206.544.9885 desk > > __________________________________________________ > Do you Yahoo!? > Yahoo! Web Hosting - establish your business online > http://webhosting.yahoo.com > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: > http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > ===== Richard O. Wood Wildwood IT Consultants, Inc. wildwood_players@yahoo.com 425.281.1914 mobile 206.544.9885 desk __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From dleonard at dleonard.net Thu Mar 13 19:21:04 2003 From: dleonard at dleonard.net (dleonard@dleonard.net) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric In-Reply-To: <20030313224811.32333.qmail@web11501.mail.yahoo.com> Message-ID: Felt like writing a bit of perl since I don't do much of that anymore... sub mixed_inc { my $in = shift; my @int = reverse unpack "c" x 3, $in; $int[0]++; if ($int[0] > 90) { $int[0] = 48; $int[1]++; if ($int[1] > 90) { $int[1] = 48; $int[2]++; if ($int[2] > 90) { $int[2] = 48; $int[3] = defined $int[3] ? $int[3]++ : 49; $int[3] = ($int[3] > 57 && $int[3] < 65) ? 65 : $int[3]; } $int[2] = ($int[2] > 57 && $int[2] < 65) ? 65 : $int[2]; } $int[1] = ($int[1] > 57 && $int[1] < 65) ? 65 : $int[1]; } $int[0] = ($int[0] > 57 && $int[0] < 65) ? 65 : $int[0]; my $out = scalar @int; return pack "c$out", reverse @int; } #mixed_inc -- On Thu, 13 Mar 2003, Richard Wood wrote: > Thanks for the ideas, > > glad to see I wasn't missing something obvious. > > Rich Wood > > --- Richard Wood wrote: > > Here is what I am using in the meantime while > > waiting > > for an elegant solution. > > > > #!/usr/bin/perl -w > > @strings = qw(AAA AZ8 A8A A98 118 18A 1A8 8AA); > > foreach $str (@strings) { > > for ($i=0;$i<3;$i++) { > > print "$str\t"; > > myinc(); > > } > > print "\n"; > > } > > sub myinc { > > if ($str =~ > > /\d{3}|[A-Z]{3}|[A-Z]{1}\d{2}|[A-Z]{2}\d{1}/) { > > $str++; > > } > > else { > > $str =~ /(.)(.)(.)/; > > $a = $1; > > $b = $2; > > $c = $3; > > $c++; > > if (($c ne '10') && ($c ne 'AA')) { > > $str = "$a$b$c"; > > } > > else { > > $c =~ s/.(.)/$1/; > > $b++; > > if (($b ne '10') && ($b ne 'AA')) { > > $str = "$a$b$c"; > > } > > else { > > $b =~ s/.(.)/$1/; > > $a++; > > $str = "$a$b$c"; > > } > > } > > } > > } > > > > Rich Wood > > > > --- Richard Wood wrote: > > > I have the need/desire to auto-increment a three > > > character scalar that may contain: all numerics, > > all > > > alphas, or mixed alpha-numeric. > > > > > > auto-increment works fine for all alpha and all > > > numeric and in some cases with a mix of > > > alpha-numerics > > > but not when a numeric precedes an alpha. In > > those > > > cases I get two types of results. (e.g. '1AA' > > > becomes > > > 2, 'A1A' becomes 1, then 2). > > > > > > Anyone have a simple solution to this? I will > > > continue to look around and try things but I > > thought > > > I > > > would ask the community before any more time > > slipped > > > away. > > > > > > Here is my test program and results: > > > > > > #!/usr/bin/perl -w > > > @strings = qw(AAA AA8 A8A A98 118 18A 1A8 8AA); > > > foreach $str (@strings) { > > > for ($i=0;$i<3;$i++) { > > > print "$str\t"; > > > $str++; > > > } > > > print "\n"; > > > } > > > __END__ > > > AAA AAB AAC > > > AA8 AA9 AB0 > > > A8A 1 2 > > > A98 A99 B00 > > > 118 119 120 > > > 18A 19 20 > > > 1A8 2 3 > > > 8AA 9 10 > > > > > > Regards, > > > > > > Rich Wood > > > > > > ===== > > > Richard O. Wood > > > Wildwood IT Consultants, Inc. > > > wildwood_players@yahoo.com > > > 425.281.1914 mobile > > > 206.544.9885 desk > > > > > > __________________________________________________ > > > Do you Yahoo!? > > > Yahoo! Web Hosting - establish your business > > online > > > http://webhosting.yahoo.com > > > > > > _____________________________________________________________ > > > Seattle Perl Users Group Mailing List > > > POST TO: spug-list@mail.pm.org > > > ACCOUNT CONFIG: > > > http://mail.pm.org/mailman/listinfo/spug-list > > > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > > > WEB PAGE: www.seattleperl.org > > > > > > > > > ===== > > Richard O. Wood > > Wildwood IT Consultants, Inc. > > wildwood_players@yahoo.com > > 425.281.1914 mobile > > 206.544.9885 desk > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Web Hosting - establish your business online > > http://webhosting.yahoo.com > > > _____________________________________________________________ > > Seattle Perl Users Group Mailing List > > POST TO: spug-list@mail.pm.org > > ACCOUNT CONFIG: > > http://mail.pm.org/mailman/listinfo/spug-list > > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > > WEB PAGE: www.seattleperl.org > > > > > ===== > Richard O. Wood > Wildwood IT Consultants, Inc. > wildwood_players@yahoo.com > 425.281.1914 mobile > 206.544.9885 desk > > __________________________________________________ > Do you Yahoo!? > Yahoo! Web Hosting - establish your business online > http://webhosting.yahoo.com > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > From sthoenna at efn.org Fri Mar 14 01:21:03 2003 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG: auto-increment mixed alpha-numeric References: <20030313190142.91872.qmail@web11503.mail.yahoo.com> Message-ID: On Thu, 13 Mar 2003 11:01:42 -0800 (PST), wildwood_players@yahoo.com wrote: >auto-increment works fine for all alpha and all >numeric and in some cases with a mix of alpha-numerics >but not when a numeric precedes an alpha. In those >cases I get two types of results. (e.g. '1AA' becomes >2, 'A1A' becomes 1, then 2). perlop says: If, however, the variable has been used in only string contexts since it was set, and has a value that is not the empty string and matches the pattern C, the increment is done as a string, preserving each character within its range, with carry >Anyone have a simple solution to this? I will >continue to look around and try things but I thought I >would ask the community before any more time slipped >away. Perl's string-increment only fits a very narrow range of problems. If you need anything outside that range, you pretty much have to brew your own function. Here's one that allows any mix of alpha and numeric: sub string_inc { die "whoops! bad input: $_[0] " if $_[0] =~ tr/a-zA-Z0-9//c; my @in = split //, $_[0]; my $carry = 1; for (reverse @in) { ++$_; $carry = substr($_, 0, -1, ''); # remove all but last character last unless length($carry); } $_[0] = join '', $carry, @in; } This may or may not be what you want. It acts like perl's string increment (because it uses it) in ways that may not be applicable to your situation: 1) each position is either a digit or a number. 9 will increment to 0 with carry to the preceding character, z to a, and Z to A. 2) if fed a string consisting of only z, Z, and 9's, it inserts a new first character of a, A, or 1, depending on the type of the original first character. 3) Incrementing an empty string produces "1". From MichaelRunningWolf at att.net Sat Mar 15 01:24:15 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? Message-ID: Does anyone know the historical roots of "n" and "m" for "min" and "max" in the regex quantifiers? I can never get a mnemonic for which is which. (Of course, the min is to the left of the max.) Perhaps if I know it's roots, I'll remember. That is (n,m) = (0,7) in this snippet: if ($fruit =~ /b(an){0,7}a/) { print "You've got an modular banana\n"; } -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From shawnw at speakeasy.org Sat Mar 15 02:45:27 2003 From: shawnw at speakeasy.org (Shawn Wagner) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? In-Reply-To: ; from MichaelRunningWolf@att.net on Fri, Mar 14, 2003 at 11:24:15PM -0800 References: Message-ID: <20030315004527.H22850@speakeasy.org> On Fri, Mar 14, 2003 at 11:24:15PM -0800, Michael R. Wolf wrote: > > Does anyone know the historical roots of "n" and "m" for "min" and > "max" in the regex quantifiers? I can never get a mnemonic for which > is which. (Of course, the min is to the left of the max.) Perhaps if > I know it's roots, I'll remember. > My guesses. From creede at penguinsinthenight.com Sat Mar 15 09:24:34 2003 From: creede at penguinsinthenight.com (Creede Lambard) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? In-Reply-To: References: Message-ID: <1047741873.1270.1.camel@svetlana.penguinsinthenight.com> On Fri, 2003-03-14 at 23:24, Michael R. Wolf wrote: > Does anyone know the historical roots of "n" and "m" for "min" and > "max" in the regex quantifiers? I can never get a mnemonic for which > is which. (Of course, the min is to the left of the max.) Perhaps if > I know it's roots, I'll remember. > > That is (n,m) = (0,7) in this snippet: > > if ($fruit =~ /b(an){0,7}a/) { > print "You've got an modular banana\n"; > } Well, there is an "n" in "minimum" but not in "maximum." That's my guess. -- Creede Lambard -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/spug-list/attachments/20030315/053368a5/attachment.bin From tim at consultix-inc.com Sat Mar 15 12:25:11 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? In-Reply-To: <20030315004527.H22850@speakeasy.org>; from Shawn Wagner on Sat, Mar 15, 2003 at 12:45:27AM -0800 References: <20030315004527.H22850@speakeasy.org> Message-ID: <20030315102511.B8494@wally.consultix-inc.com> On Sat, Mar 15, 2003 at 12:45:27AM -0800, Shawn Wagner wrote: > On Fri, Mar 14, 2003 at 11:24:15PM -0800, Michael R. Wolf wrote: > > > > Does anyone know the historical roots of "n" and "m" for "min" and > > "max" in the regex quantifiers? I can never get a mnemonic for which > > is which. (Of course, the min is to the left of the max.) Perhaps if > > I know it's roots, I'll remember. > > > > My guesses. > > >From the ed manpage: > --- > \{n,m\} > \{n,\} > \{n\} You're looking at a Linux re-write of the ed manpage. In my 1982 Western Electric UNIX User's Manual, and all other Bell Labs documentation on the subject, it's shown as \{m,n\}. What's the difference? The erroneous rewrite, by ruining the alphabetical ordering, suggests mneomonics for the letters that don't apply (see my early message on the Fortran connection). > number. It makes sense to use it here. Then, 'at most m times'. Thus, think > most, think m. > > Or it could just be that m is right to the right of n on a qwerty > keyboard... > > -- > Shawn Wagner > shawnw@speakeasy.org > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com www.consultix-inc.com www.softwareprofessor.com | *==============================================================================* From tim at consultix-inc.com Sat Mar 15 12:25:11 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? In-Reply-To: <20030315004527.H22850@speakeasy.org>; from Shawn Wagner on Sat, Mar 15, 2003 at 12:45:27AM -0800 References: <20030315004527.H22850@speakeasy.org> Message-ID: <20030315102511.B8494@wally.consultix-inc.com> On Sat, Mar 15, 2003 at 12:45:27AM -0800, Shawn Wagner wrote: > On Fri, Mar 14, 2003 at 11:24:15PM -0800, Michael R. Wolf wrote: > > > > Does anyone know the historical roots of "n" and "m" for "min" and > > "max" in the regex quantifiers? I can never get a mnemonic for which > > is which. (Of course, the min is to the left of the max.) Perhaps if > > I know it's roots, I'll remember. > > > > My guesses. > > >From the ed manpage: > --- > \{n,m\} > \{n,\} > \{n\} You're looking at a Linux re-write of the ed manpage. In my 1982 Western Electric UNIX User's Manual, and all other Bell Labs documentation on the subject, it's shown as \{m,n\}. What's the difference? The erroneous rewrite, by ruining the alphabetical ordering, suggests mneomonics for the letters that don't apply (see my early message on the Fortran connection). > number. It makes sense to use it here. Then, 'at most m times'. Thus, think > most, think m. > > Or it could just be that m is right to the right of n on a qwerty > keyboard... > > -- > Shawn Wagner > shawnw@speakeasy.org > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com www.consultix-inc.com www.softwareprofessor.com | *==============================================================================* From tim at consultix-inc.com Sat Mar 15 12:14:43 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? In-Reply-To: ; from Michael R. Wolf on Fri, Mar 14, 2003 at 11:24:15PM -0800 References: Message-ID: <20030315101443.A8494@wally.consultix-inc.com> On Fri, Mar 14, 2003 at 11:24:15PM -0800, Michael R. Wolf wrote: > > Does anyone know the historical roots of "n" and "m" for "min" and > "max" in the regex quantifiers? I can never get a mnemonic for which > is which. (Of course, the min is to the left of the max.) Perhaps if > I know it's roots, I'll remember. That comes from the good-old ed editor, which provided the same metacharacters. M comes first, and then n. I believe they were chosen for Fortranish reasons; i, j, and k were always the the first three (automatically understood as) integer variables one would use in a program, so to mark these placeholders as integers but special in some way, i.e., not the conventional loop indices i,j, or k, Brian Kernighan started with m. M conveniently stands for minimum too, and N is just the next sequential letter (no mnemonic). Go figure . . . > That is (n,m) = (0,7) in this snippet: > > if ($fruit =~ /b(an){0,7}a/) { > print "You've got an modular banana\n"; > } > > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRunningWolf@att.net > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com www.consultix-inc.com www.softwareprofessor.com | *==============================================================================* From tim at consultix-inc.com Sat Mar 15 14:41:05 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:s Message-ID: <20030315124105.A12144@wally.consultix-inc.com> Sat Mar 15 12:41:04 PST 2003 From MichaelRunningWolf at att.net Sat Mar 15 22:05:17 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:m,n -- why? In-Reply-To: <20030315102511.B8494@wally.consultix-inc.com> References: <20030315004527.H22850@speakeasy.org> <20030315102511.B8494@wally.consultix-inc.com> Message-ID: Tim Maher writes: > On Sat, Mar 15, 2003 at 12:45:27AM -0800, Shawn Wagner wrote: > > On Fri, Mar 14, 2003 at 11:24:15PM -0800, Michael R. Wolf wrote: > > > > > > Does anyone know the historical roots of "n" and "m" for "min" and > > > "max" in the regex quantifiers? I can never get a mnemonic for which > > > is which. (Of course, the min is to the left of the max.) Perhaps if > > > I know it's roots, I'll remember. > > > > > > > My guesses. > > > > >From the ed manpage: > > --- > > \{n,m\} > > \{n,\} > > \{n\} > > You're looking at a Linux re-write of the ed manpage. In my 1982 > Western Electric UNIX User's Manual, and all other Bell Labs > documentation on the subject, it's shown as \{m,n\}. What's > the difference? The erroneous rewrite, by ruining the alphabetical > ordering, suggests mneomonics for the letters that don't apply (see > my early message on the Fortran connection). Cut from Apocolypse 5: {n,m} # assert repeat count {$n,$m} <$n,$m> # indirect repeat counts Perhaps I opened my eyes for the first time last night. I had always thought I j The 1st edition of the camel uses {n,m} {n,} {n} The 3rd edition of the camel uses {MIN,MAX} {MIN,} {COUNT} I thought I'd always seen {m,n}, but perhaps that's not true. I guess I saw what I wanted to see, not what was really there. Maybe they can me with a mnemonic for spelling mnemonic. Oops, that won't work... :-) -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From MichaelRunningWolf at att.net Sun Mar 16 20:08:26 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:March Meeting: "Green Lightning Talks" In-Reply-To: <20030311172856.A3275@timji.consultix-inc.com> References: <20030311172856.A3275@timji.consultix-inc.com> Message-ID: Tim Maher writes: > March 2003 Seattle Perl Users Group Meeting > ----------------------------------------------------- > > Theme: "Green Lightning Festival" > Speakers: Various SPUGsters > > Time: Wednesday, March 18, 2003 7-9pm That 'ole copy/paste got you in trouble again.... Is it Wednesday or the 18th? I'll put my money on Tuesday, March 18th!!! -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From MichaelRunningWolf at att.net Sun Mar 16 20:10:21 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 In-Reply-To: References: Message-ID: Jeremy Kahn writes: > On Wed, 12 Mar 2003, SPUG-list-owner wrote: > > Hmmm ... what term for SPUG newbies? > > > > SPUGling? SPUGette? SPUGito? > > I think you're a Spuggle until you're a wizard. > > > By the way, we've not got 5 speakers lined up for the meeting next week > > (Tuesday, not Wednesday! D'oh!), and room for more still. Let me know > > if any more of you want to join in. > > I wish I could. I'll be out of town. Hope to see you all in the next > go-round. > > --jeremy, who still sometimes feels like a spuggle Just what does a spugle feel like? -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From pdarley at kinesis-cem.com Mon Mar 17 09:13:19 2003 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:RSVP pre-meet @ Cedars 3/18 In-Reply-To: Message-ID: Man, don't go around feelin' the spuggles! Could get you in a lot of trouble.. > Just what does a spugle feel like? From tim at consultix-inc.com Mon Mar 17 13:01:37 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:March meeting: "Green Lightning Talks" Message-ID: <20030317110137.A7621@timji.consultix-inc.com> SPUGsters, Happy SPUG-Patrick's Day! Today is the 5th birthday of SPUG, which just keeps on chugging (that green beer) along. We've got 6 speakers so far, and still room for more! I'd like to encourage all of you to consider speaking for 5 minutes or more on some Perlish topic you'd like to share with the group next week. Please contact me if you'd like to get on the agenda. If you want to join other SPUGsters for dinner, please RSVP to the list by 2pm Tuesday, 3/18. Don't forget to wear something green! ======================================================= | Tim Maher, Ph.D. tim@timmaher.org | | JAWCAR ("Just Another White-Camel Award Recipient") | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ======================================================= March 2003 Seattle Perl Users Group Meeting ----------------------------------------------------- Theme: "Green Lightning Festival" Speakers: Various SPUGsters Time: Tuesday, March 18, 2003 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/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This month, we'll feature several short talks by SPUG members, ranging in duration from 5 to 20 minutes. This is a good way to get started in sharing your knowledge with other SPUGSsters, and we still have open slots for additional speakers, so send email if you want to participate. Why Green Lighting? SPUG was born on St. Patrick's day, 1998, so please help us celebrate SPUG's 5th Birthday by wearing GREEN at this month's meeting! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "Modules from the Spring Collection" Tim Maher Consultix Tim will give a demo of his new module, Shell::POSIX::Select (see http://teachmeperl.com/Select.html), and give short talks on other Perly things, some excerpted from past and future conference presentations. _________________________________________________________________ "Use vs. Require" Jay Scherrer Practical Tax Jay's been writing a Perl program to implement the 1040 tax return, which you can read about at his web site. Along the way, he's learned that it's better to use "require" when "use" is not required, and he'll be sharing his knowledge of that subject in this short talk. _________________________________________________________________ "Fred's Calendar Thingy" Fred Morris Scary Devil Monastery Sounds obscene, I know, but Fred Morris wants to talk about his thingy! For the past year, he's been working on a multi-user calendar thingy with mod_perl/MySQL. Fred is going to wander around the UI while simultaneously discussing what motivated him in the first place, why he chose the particular tools and architecture he did, lessons learned and refactoring to be done, as well as the publicly accessible SPUG calendar page and the template-driven report generator which drives it. He will also briefly discuss "robot motels". Check out the cool SPUG Calendar page being served-up by Fred's thingy! _________________________________________________________________ 'RE-decl: A Regular Expression Decipherer" Michael Wolf REdeparse is a tool that explains a Perl regular expression, much like the cdecl tool does for C and C++ declarations. Like the Rosetta Stone, it provides multiple views of an expression in two languages -- Perl and English. _________________________________________________________________ "Sweet & SAWA, a lite introduction" Andrew B. Sweger Addnorya Technology Consulting SAWA (Simple API for Web Applications) facilitates a philosophical notion that web application logic should be mutually exclusive from how that data is formatted for public consumption. In other words, the coder worries about the code, and the designer worries about how the output will be transformed. SAWA::Lite is intended to be a light-weight stepping-stone towards the much more powerful (and learning-curve intensive) SAWA suite. However, SAWA::Lite could possibly do all that you need depending on your application needs. More information on SAWA and SAWA::Lite can be found at the project web site, http://sawa.sf.net/lite/ _________________________________________________________________ "Improving Periodic Webscraping" Jeremy Mates University of Washington Jeremy will share his thoughts on a queuing system to improve the process of webscraping. The goal is to separate the downloading and parsing stages to better adapt to changing content (that can break the parser) and simplify the scripts involved. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Pre- and Post- Meeting Activities --------------------------------- The pre-meeting dinner will be at 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 RSVP to the list by 2pm on the meeting day with your expected arrival time (5:30-5:45pm is recommended). TO BE FAIR, from now on only those who comply with the RSVP policy (and are therefore counted in the seating reservation) will be allowed to sit at the speaker's table. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== From asa.martin at attws.com Mon Mar 17 13:11:12 2003 From: asa.martin at attws.com (Martin, Asa) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Broken Pipe Message-ID: <21CD1BA84ECB2848AB8EDC0AE21CC727010B9EBC@WA-MSG07-BTH.wireless.attws.com> This is sort of a unix question and sort of a perl question, but does anybody know how to get rid of the annoying Broken Pipe message that occurs when I run a system command from within my script and then interrupt the system call in the middle. I'm doing a traceroute and I want to interrupt the trace if it returns "* * *", but when I do that it returns "Broken Pipe". Code snippet: open( TRACE, "$TRACE $ip 2>/dev/null |" ) or return; while () { s/\s+//; if (/^\d+\s+(.*)\s+\((\d+\.\d+\.\d+\.\d+)\)\s+/) { my $name = $1; my $ip = $2; if ( $name eq $ip ) { push @route, $name; } else { push @route, "$name-$ip"; } } if (/\*\s+\*\s+/) { push @route, "*-*-*-*-*"; last; } } close(TRACE); Anyone have any ideas why Broken Pipe occurs and how to get rid of it? I'm running this on a Solaris machine (2.5.1 OS - please don't ask why). I think it is a OS issue because if I run it on an HP-UX 11.00 machine (again, I won't answer why) there are no Broken Pipe statements. Ideas? Asa From cwilkes-spug at ladro.com Mon Mar 17 13:28:20 2003 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Mon Aug 2 21:36:53 2004 Subject: SPUG:Broken Pipe In-Reply-To: <21CD1BA84ECB2848AB8EDC0AE21CC727010B9EBC@WA-MSG07-BTH.wireless.attws.com> References: <21CD1BA84ECB2848AB8EDC0AE21CC727010B9EBC@WA-MSG07-BTH.wireless.attws.com> Message-ID: <20030317192820.GG26935@www.ladro.com> On Mon, Mar 17, 2003 at 11:11:12AM -0800, Martin, Asa wrote: > This is sort of a unix question and sort of a perl question, but does > anybody know how to get rid of the annoying Broken Pipe message that > occurs when I run a system command from within my script and then > interrupt the system call in the middle. I'm doing a traceroute and I > want to interrupt the trace if it returns "* * *", but when I do that > it returns "Broken Pipe". Take a look at these perldocs perldoc -q signal perldoc perlipc In a nutshell: you trap various $SIG{level}'s and then do something with them. There's also a Net::Traceroute module out there. Haven't used it though. Chris From spug at ifokr.org Mon Mar 17 13:30:43 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Broken Pipe In-Reply-To: <21CD1BA84ECB2848AB8EDC0AE21CC727010B9EBC@WA-MSG07-BTH.wireless.attws.com> References: <21CD1BA84ECB2848AB8EDC0AE21CC727010B9EBC@WA-MSG07-BTH.wireless.attws.com> Message-ID: <20030317193043.GN24936@ifokr.org> > This is sort of a unix question and sort of a perl > question, but does anybody know how to get rid of the > annoying Broken Pipe message that occurs when I run a > system command from within my script and then interrupt > the system call in the middle. I'm doing a traceroute and > I want to interrupt the trace if it returns "* * *", but > when I do that it returns "Broken Pipe". I don't get any errors running your script on linux or on solaris. However you could probably put something like the following before your code snippet: $SIG{PIPE} = "IGNORE"; That tells the script to ignore SIGPIPEs. > Anyone have any ideas why Broken Pipe occurs and how to get rid of it? Well, if you've run a program from inside your script, it is using a pipe s.t. your script can get the output from it. When you kill that program, the SIGPIPE is sent to let your program know that the pipe died. -- Brian Hatch "Anything I can do to help?" Systems and "Hmm. Short of dying, no, Security Engineer can't think of a thing." http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030317/e5a0a26c/attachment.bin From ced at carios2.ca.boeing.com Mon Mar 17 16:42:13 2003 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Broken Pipe Message-ID: <200303172242.OAA00831@carios2.ca.boeing.com> > This is sort of a unix question and sort of a perl question, but does anybody know how to get rid of the annoying Broken Pipe message that occurs when I run a system command from within my script and then interrupt the system call in the middle. I'm doing a traceroute and I want to interrupt the trace if it returns "* * *", but when I do that it returns "Broken Pipe". > > Code snippet: > open( TRACE, "$TRACE $ip 2>/dev/null |" ) or return; > while () { > s/\s+//; > if (/^\d+\s+(.*)\s+\((\d+\.\d+\.\d+\.\d+)\)\s+/) { > my $name = $1; > my $ip = $2; > if ( $name eq $ip ) { > push @route, $name; > } else { > push @route, "$name-$ip"; > } > } > if (/\*\s+\*\s+/) { > push @route, "*-*-*-*-*"; > last; > } > } > close(TRACE); > > Anyone have any ideas why Broken Pipe occurs and how to get rid of it? I'm running this on a Solaris machine (2.5.1 OS - please don't ask why). I think it is a OS issue because if I run it on an HP-UX 11.00 machine (again, I won't answer why) there are no Broken Pipe statements. Not sure why .. but one end of the pipe is probably complaining because the pipe gets closed prematurely, i.e, there's still data to be read trickling down the pipe but the pipe's already been closed. Maybe the geriatric OS version is part of the problem... The close(TRACE) should drain any data that's left before the pipe is closed. You might try checking the error just to understand more thoroughly what's happening. Here's a snippet adaption from the 'close' docs (also take a look at perlipc): close OUTPUT # wait for traceroute to finish or warn $! ? "Error closing pipe: $!" : "Exit status $? from traceroute ; You could probably localize sigpipe to stop the noise (if everything else's working and this is just a fly buzzing around the head of your perfectly working program ). { local $SIG{PIPE} = 'IGNORE'; ... } HTH, -- Charles DeRykus From m3047 at inwa.net Mon Mar 17 23:05:43 2003 From: m3047 at inwa.net (Fred Morris) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:March meeting: "Green Lightning Talks" Message-ID: 5:30 -ish, The Cedars >Don't forget to wear something green! I thought briefly about green face paint.. let's not and say we did. -- Fred Morris m3047@inwa.net From tim at consultix-inc.com Wed Mar 19 18:14:15 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Discount for OSCON Message-ID: <20030319161415.B16996@timji.consultix-inc.com> SPUGsters, Here's the latest newsletter from the O'Reilly User Group program. As one of their registered user groups, SPUG is eligible for discounts, including 20% off the EarlyBird registration for the OSCON (Portland) conference. Scan forward for DSUG (twice) to find that spot in the message. P.S. Thanks to all who participated in the "Open Mic" SPUG meeting last night (for reasons obvious to those in attendance, I'm not calling it a Lightning Talk session anymore!). My apologies to Dora for running late; we'll keep tighter controls on our schedule from now on. ======================================================= | Tim Maher, Ph.D. tim@timmaher.org | | JAWCAR ("Just Another White-Camel Award Recipient") | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ======================================================= O'Reilly User Group Program Newsletter March 18, 2003 Please share this information with your members... Highlights This Week: ---------------------------------------------------------------- Book News ---------------------------------------------------------------- -Java Extreme Programming Cookbook -Learning Red Hat Linux, 3rd Edition -Web, Graphics & Perl/Tk: Best of the Perl Journal -Switching to the Mac: The Missing Manual ---------------------------------------------------------------- Upcoming Events ---------------------------------------------------------------- -Derrick Story ("iPhoto:The Missing Manual" and "Digital Photo Pocket Guide") will present to the North Coast Mac Users Group at O'Reilly, Sebastopol, CA--March 22 -Jesse Liberty ("Programming ASP.NET") at the Web Services Edge 2003 East Conference, Boston, MA--March 20 -Software Legends Night at Softpro Books, Burlington, MA--March 26 -Colin Moock ("ActionScript for Flash MX") at Flash Forward 2003, San Francisco, CA--March 26 ---------------------------------------------------------------- Conference ---------------------------------------------------------------- -Registration is open for the 2003 O'Reilly Open Source Convention -Mac OS X Innovators Contest Winning Entry to be Announced at the O'Reilly Emerging Technology Conference -New--Put Up A O'Reilly Open Source Convention Banner, Get A Free Book --------------------------------------------------------------- Safari ---------------------------------------------------------------- -First "Go On Safari" Winner--Michael J. Ross, San Diego Oracle Users Group ---------------------------------------------------------------- News ---------------------------------------------------------------- -The Next Revolution: Smart Mobs -What does Linux have to do with Dickens? -Interview with Rael Dornfest -Official O'Reilly Gear at ThinkGeek -Hackers Meet Soldiers -Egoboo: The Cute Way to Dungeon Role Play -The XML.com Interview: Eric Meyer -Making Java Objects Comparable -Detecting Duplicate Code with PMD's CPD -Configuration Handlers in .NET -Build Hyperlinks into Your Client App with the Windows Forms LinkLabel Control -Hands on X11 -Apple Releases Java 1.4.1 for Mac OS X ================================================ Book News ================================================ Review books are available--email me for a copy. ***Please include the book order number on your requests. Let me know if you need your books by a certain date. Allow at least four weeks for shipping. Send or email me copies of your newsletters and book reviews. Don't forget, your members get 20% off any O'Reilly book they purchase directly from O'Reilly. Just use code DSUG when ordering. http://www.oreilly.com/ ***Group purchases with better discounts are available*** Please let me know if you are interested. Press releases are available on our press page: http://press.oreilly.com/ ***Java Extreme Programming Cookbook Order Number: 3870 Extreme Programming does not mean programming naked while rollerblading down the side of the Grand Canyon. It does mean a new approach to software development that is both radical and common sense. Brimming over with 100 recipes for getting down to business and actually doing XP, "Java Extreme Programming Cookbook" succinctly documents the most important features of popular open source tools for XP in Java, and then digs right in, providing recipes for implementing the tools in real-world environments. http://www.oreilly.com/catalog/jextprockbk/ Chapter 4, "JUnit," is available online: http://www.oreilly.com/catalog/jextprockbk/chapter/index.html ***Learning Red Hat Linux, 3rd Edition Order Number: 4699 "Learning Red Hat Linux, 3rd Edition" guides you through the process of installing and running Red Hat Linux on your PC. Written in a friendly, easy-to-understand style, this book contains all you need to get started, including the complete Red Hat 8.0 distribution on CD. With new tutorials covering OpenOffice Tools and the desktop, this book is excellent for first-time Linux users who want to install the operating system on a new PC or convert an existing system to Linux. http://www.oreilly.com/catalog/redhat3/ Chapter 10, "Connecting to the Internet," is available online: http://www.oreilly.com/catalog/redhat3/ ***Web, Graphics & Perl/Tk: Best of the Perl Journal Order Number: 3110 "Web, Graphics & Perl/Tk: Best of the Perl Journal" includes the very best (and still relevant) articles published in "The Perl Journal" over its five years of publication. Written by 23 of the most prominent and prolific members of the closely knit Perl community, including Lincoln Stein, Mark-Jason Dominus, Alligator Descartes, and Dan Brian, the 40 articles included in this volume are simply some of the finest Perl articles ever written on the subjects of graphics, the Web, and Perl/Tk. http://www.oreilly.com/catalog/tpj2/ Chapter 4, "Cookies," is available online: http://www.oreilly.com/catalog/tpj2/chapter/index.html ***Switching to the Mac: The Missing Manual Order Number: 4524 If you've made the switch to Mac, or you're ready to, this book will show you how to: move files, address books, and email collections from a PC to the Mac; find familiar controls in the new system; set up a network to share files with PCs and Macs; and adapt old printers, scanners, and other peripherals. If you've discovered that just buying a new Mac isn't all there is to it, this guide by celebrated author and columnist David Pogue will have you converting from Windows to Mac quickly and easily. http://www.oreilly.com/catalog/switchmacmm/ =============================================== Upcoming Events =============================================== ***Derrick Story ("iPhoto:The Missing Manual" and "Digital Photo Pocket Guide") will present to the North Coast Mac Users Group at O'Reilly, Sebastopol, CA--March 22 Join Derrick Story as he shows you how to take advantage of the powerful, yet easy to use, features in the latest version of the iLife application suite. Create "Ken Burns like" QuickTime movies, add music from your iTunes library, and publish it all to a CD, DVD, or the Web. Plus, you'll receive a special "behind the scenes" tour of the O'Reilly Campus here in Sebastopol. Derrick will be available to answer questions and sign books. The O'Reilly bookstore is open for this event. O'Reilly Saturday, March 22, 2003 11am--1pm 1005 Gravenstein Highway North Sebastopol, CA Directions: http://www.oreilly.com/oreilly/seb_directions.html For more information on NCMUG go to: http://www.ncmug.org/ ***Jesse Liberty ("Programming ASP.NET") at the Web Services Edge 2003 East Conference, Boston, MA--March 20 Author Jesse Liberty ("Programming C#," "Learning C#," "Learning Visual Basic .NET," and "Programming ASP.NET") is the keynote speaker at Web Services Edge 2003 East Conference. Web Services Edge 2003 East Conference & Expo March 18-20, 2003 Hynes Convention Center Boston, MA http://www.sys-con.com/webservicesedge2003east/index.cfm ***Software Legends Night at Softpro, Burlington, MA--March 26 Spend an evening filled with tips, tricks, best practices, and fun with author Chris Sells ("Mastering Visual Studio .NET"). Softpro Books Wednesday, March 26, 2003 6:30 to 8:00 pm 112 Mall Road Burlington, MA 01803-5300 http://www.softpro.com/events.html ***Colin Moock ("ActionScript for Flash MX") at Flash Forward 2003, San Francisco, CA--March 26 Author Colin Moock leads an ActionScript Workshop and a session on "Multiuser Flash with Unity 2." Flash Forward 2003 March 26- 29, 2003 Herbst Theatre San Francisco, CA http://www.flashforward2003.com/ For more events, please see: http://events.oreilly.com/ ================================================ Conference News ================================================ ***Registration is open for the 2003 O'Reilly Open Source Convention--Portland, OR Programmers, developers, strategists, technical staff, and other open source votaries from around the world congregate for five days of tutorials, conference sessions, and networking of the flesh-and-blood variety. Recognizing that open source tools have moved squarely into the mainstream, this year's convention focuses on "embracing and extending proprietary software." Early Bird Discount-- User Group members who register before May 23, 2003, get a double discount. Use code DSUG when you register, and you'll get 20% off the "Early Bird" price. To register, go to: http://conferences.oreillynet.com/cs/os2003/create/ord_os03 O'Reilly Open Source Convention Portland Marriott Downtown, Portland, OR July 7-11, 2003 http://conferences.oreilly.com/oscon/ ***Mac OS X Innovators Contest Winning Entry to be Announced at the O'Reilly Emerging Technology Conference Have you created a Mac OS X application, plug-in, or some other type of innovative software that you believe is top in its class? Then enter it in the Mac OS X Innovators contest. First prize is an ADC Premier membership (includes WWDC pass, hardware credits, and tons of other benefits) plus a full pass to the O'Reilly Mac OS X Conference plus a one year subscription to the premium online book service, Safari--these awards total nearly $5,000 for the first place winner. Deadline for entries is March 28. Find out how to enter here: http://www.macdevcenter.com/mac/developer/ For more info on the O'Reilly Emerging Technology Conference: http://conferences.oreilly.com/etcon/ User Group members get 20% off the conference pricing. Use the code DSUG. To register, go to: http://conferences.oreillynet.com/pub/w/22/register.html ***New--Put Up an O'Reilly Open Source Convention Banner, Get A Free Book Ready for the next conference banner promotion? Here it is: We are looking for user groups to display our conference banners on their web sites. If you send me the link to your user group site with our O'Reilly Open Source Convention banner, I will send you the O'Reilly book of your choice. OSCON Conference Banners: http://ug.oreilly.com/banners/oscon2003/ ================================================ Safari News ================================================ ***"Go On Safari" Tip of the Week Winner--Michael J. Ross, San Diego Oracle Users Group "One advantage that Safari has over newsgroups is the higher quality of source code. Developers can better rely upon sample code from technical books tested by professional reviewers and countless readers, and supplemented with more extensive explanations and errata--as opposed to code culled from thrice-borrowed scripts, and usually presented with insufficient context." Your group can also participate in this introductory program just for user group members. To "Go on Safari," any of your members who sign up for our Safari 14-day free trial send comments on their experiences, or tips and tricks for how they used Safari (it only needs to be 2 sentences long, but it may be longer) to safari_talk@oreilly.com. Every week someone will be chosen from the tips or comments submitted to receive fun stuff from O'Reilly (T-shirts, book bags, or other surprises). If a member of your user group is selected, your group receives free gifts, too. Whatever the individual member receives, your UG will get one, too, to give away at your next meeting, or use however you see fit. Recipients--and their comments--will be announced in the User Group Newsletter. **Please use this special UG URL to sign up for the 14-day trial** http://www.oreilly.com/safari/ug For more information on Safari: http://safari.oreilly.com/ ================================================ News From O'Reilly & Beyond ================================================ --------------------- General News --------------------- ***The Next Revolution: Smart Mobs What do you get when you mix together millions of cell phones and P2P-enabled computers with wireless Internet floating in the air and users reviewing products, sellers, and each other? Smart mobs. That's what Howard Rheingold, a keynoter at O'Reilly's upcoming Emerging Technology Conference, calls these folks. Read what he has to say about this third computing revolution. http://www.openp2p.com/pub/a/p2p/2003/03/13/howard.html For more info on the O'Reilly Emerging Technology Conference: http://conferences.oreilly.com/etcon/ ***What does Linux have to do with Dickens? Tim O'Reilly's weblog from Sunday, March 16, 2003. http://www.oreillynet.com/pub/wlg/2911 ***Interview with Rael Dornfest Listen to Minnesota Public Radio's "Future Tense" interview with Rael Dornfest and learn about some of Google's lesser-known search techniques. Just click on the link beside "Google Hacks." Rael is a coauthor of O'Reilly's recently released "Google Hacks." http://news.mpr.org/programs/futuretense/ Google Hacks Order Number: 4478 http://www.oreilly.com/catalog/googlehks/ ***Official O'Reilly Gear at ThinkGeek For years, our customers have asked us to make and sell various items with our animals on them. We are pleased and proud to present our first collection of official OReilly animal swag. For a limited time only, order any O'Reilly t-shirt, babydoll tee, or child's t-shirt/creeper, and get a free O'Reilly 2003 Calendar. For every shirt you buy, ThinkGeek will give you a free calendar. www.thinkgeek.com/oreilly. --------------------- Open Source --------------------- ***Hackers Meet Soldiers OpenBSD has a well-deserved reputation for fanatical security. Why is the U.S. military funding it? What do you get out of it? Cameron Laird and George Peter Staplin investigate. http://www.onlamp.com/pub/a/bsd/2003/03/13/darpabsd.html ***Egoboo: The Cute Way to Dungeon Role Play Dungeon crawls are as popular among the computer RPG crowd as first person shooters are among the action crowd. In the open source world, Egoboo is perhaps the cutest and most accessible RPG. Howard Wen examines the project, its history, and its future. http://linux.oreillynet.com/pub/a/linux/2003/03/13/egoboo.html --------------------- XML --------------------- ***The XML.com Interview: Eric Meyer Russell Dyer talks to Eric Meyer, invited expert to the W3C's CSS Working Group, and author of "Cascading Style Sheets: The Definitive Guide." http://www.xml.com/pub/a/2003/03/12/meyer.html Cascading Style Sheets: The Definitive Guide Order Number: 6226 http://www.oreilly.com/catalog/css/ --------------------- Java --------------------- ***Making Java Objects Comparable Sometimes how objects relate to each other is as important as the existence of the objects. There's no single way to compare them--a person might be sorted by age, name, or position in a queue. In this article, Budi Kurniawan demonstrates how to make your objects comparable and sortable with java.util.Comparator and java.lang.Comparable. http://www.onjava.com/pub/a/onjava/2003/03/12/java_comp.html ***Detecting Duplicate Code with PMD's CPD Code reuse has been a grail for years. Why, then, is there still so much copying and pasting going on? Tom Copeland introduces CPD, the Copy/Paste Detector, which can identify large swaths of duplicate Java code. http://www.onjava.com/pub/a/onjava/2003/03/12/pmd_cpd.html --------------------- .NET --------------------- ***Configuration Handlers in .NET In the shiny new world of .NET-based applications with xcopy deployment and smart clients, we can no longer use the registry to hold application configuration information. Instead, we're supposed to use XML-based configuration files accessed via the CLR's pluggable configuration framework. In this article by Ben Lowery, he explains how this all works. http://www.ondotnet.com/pub/a/dotnet/2003/01/01/configsections.html ***Build Hyperlinks into Your Client App with the Windows Forms LinkLabel Control Writing for MSDN, Dan Hurwitz discusses the flexibility of the LinkLabel control in the .NET Framework, its properties, built-in behaviors, and their use in VB.NET and C#. http://msdn.microsoft.com/msdnmag/issues/03/02/LinkLabel/default.aspx Dan is a coauthor of "Programming ASP.NET." Order Number: 1711 http://www.oreilly.com/catalog/progaspdotnet/index.html --------------------- Mac --------------------- ***Hands on X11 The imprementation of X11 for Mac OS X includes a window server, libraries, and basic utilities such as xterm. In this article, Dan Benjamin shows you how to install and use the latest beta offered by Apple. http://www.macdevcenter.com/pub/a/mac/2003/03/14/install_x11.html ***Apple Releases Java 1.4.1 for Mac OS X Apple takes Java to the next level with the latest release of the Java 2 Platform, Standard Edition, version 1.4.1 for Mac OS X. It includes 60 percent more features than 1.3.1. Daniel Steinberg brings you up to speed. http://www.macdevcenter.com/pub/a/mac/2003/03/10/osx_java.html Until next time-- Marsee ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Marsee Henon O'Reilly & Associates 1005 Gravenstein Highway North Sebastopol, CA 95472 707-827-7103 800-998-9938 Fax 707-829-0104 marsee@oreilly.com http://ug.oreilly.com/ http://www.oreilly.com/ http://conferences.oreilly.com/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ----- End forwarded message ----- -- -Tim *------------------------------------------------------------* | Tim Maher, CONSULTIX (206) 781-UNIX (866) DOC-PERL | | CEO, JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | UPCOMING CLASSES: Perl Programming, 3/24-26, Tukwila WA | *------------------------------------------------------------* From pdarley at kinesis-cem.com Thu Mar 20 10:22:35 2003 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Appropriateness of MD5 Message-ID: Friends, I have a system that produces reports on large sets of data every night. Each report is made up of columns of data, the contents of which can change at times. I want to create a list of all the individual records that make up each column, use them to create a string that would uniquely describe the contents of the report, then create an MD5 digest of it which would be checked against subsequent digests to see if the contents of the report had changed and it needed to be re-run. My question is this: Is the MD5 digest going to be sensitive enough to detect the changes? The 'key' of the report will likely be ~1000-2000 characters before digesting, and I'm a bit woried that a 128 bit digest won't be unique enough to indicate a change to the 'key'. Any suggestions appreciated. :) Thanks, Peter Darley From Daniel.Pommert at VerizonWireless.com Thu Mar 20 10:43:05 2003 From: Daniel.Pommert at VerizonWireless.com (Pommert, Daniel) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Appropriateness of MD5 Message-ID: <9B30436F511ED5118EDF0002A55C3180057905FC@cairvexmb03.uswin.ad.vzwcorp.com> I have found MD5 to be extremely sensitive to any change: content, order, length or padding. Although it is true that you have long keys, you simply want to ensure that nothing has changed. MD5 is very hard to spoof. 128 bits gives you about 10**40 unique codes. The odds of two reports having exactly the same digest are astronomically slim. -- Daniel Pommert P.S. My first Perl job was doing MD5 digests of releases to verify the correctness of those releases. -----Original Message----- From: Peter Darley [mailto:pdarley@kinesis-cem.com] Sent: Thursday, March 20, 2003 8:23 AM To: SPUG Subject: SPUG:Appropriateness of MD5 Friends, I have a system that produces reports on large sets of data every night. Each report is made up of columns of data, the contents of which can change at times. I want to create a list of all the individual records that make up each column, use them to create a string that would uniquely describe the contents of the report, then create an MD5 digest of it which would be checked against subsequent digests to see if the contents of the report had changed and it needed to be re-run. My question is this: Is the MD5 digest going to be sensitive enough to detect the changes? The 'key' of the report will likely be ~1000-2000 characters before digesting, and I'm a bit woried that a 128 bit digest won't be unique enough to indicate a change to the 'key'. Any suggestions appreciated. :) Thanks, Peter Darley _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, U-District, Seattle WA WEB PAGE: www.seattleperl.org From jmates at sial.org Thu Mar 20 10:52:57 2003 From: jmates at sial.org (Jeremy Mates) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: References: Message-ID: <20030320165257.GL68306@darkness.sial.org> * Peter Darley > My question is this: Is the MD5 digest going to be sensitive enough to > detect the changes? The 'key' of the report will likely be ~1000-2000 > characters before digesting, and I'm a bit woried that a 128 bit digest > won't be unique enough to indicate a change to the 'key'. Both "a" and 20 gigabytes of data reduce to the same length MD5 digest; a single character changed in either string will produce a different checksum. The length of the document determines how long the checksum takes to generate on the system in question. Problems with MD5 can crop up when checksums are being generated for millions of entries, which increases the odds that two different strings share the same checksum. This problem can be reduced by using a digest algorithm that uses more bits; CPAN has several modules under the Digest area that offer lower chances of collisions at higher CPU costs. That being said, MD5 is likely to have a large enough bitspace for your needs. From spug at ifokr.org Thu Mar 20 12:01:14 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: <20030320165257.GL68306@darkness.sial.org> References: <20030320165257.GL68306@darkness.sial.org> Message-ID: <20030320180114.GI15283@ifokr.org> > Problems with MD5 can crop up when checksums are being generated for > millions of entries, which increases the odds that two different strings > share the same checksum. This problem can be reduced by using a digest > algorithm that uses more bits; CPAN has several modules under the Digest > area that offer lower chances of collisions at higher CPU costs. > > That being said, MD5 is likely to have a large enough bitspace for > your needs. Since you're not actively trying to make two different texts generate the same MD5 hash, you're asking "what are the chances I'll have two end up with the same hash" which is the birtday paradox. A good estimate says "if you have X possible things, then if you randomly pick 1.2 * sqrt(X) things, there's a 50/50 chance that two will be the same". That's probably pretty applicable to this situation. So, what would that number be? 1.2 * sqrt(2^128) == 1.2 * 2^64 == 22136092888451461939 So, if you happen to have 22136092888451461939 records that you're checking out, it's even money that you will have one collision. This assumes that MD5 generates it's output 'evenly' (each hash value is equally likely) which was one of the goals when it was created. I now return you to your normally scheduled stick riddle. -- Brian Hatch Hang up and drive. Systems and Security Engineer http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030320/fe82f9ce/attachment.bin From ingy at ttul.org Thu Mar 20 22:32:13 2003 From: ingy at ttul.org (Brian Ingerson) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: <20030320180114.GI15283@ifokr.org>; from spug@ifokr.org on Thu, Mar 20, 2003 at 10:01:14AM -0800 References: <20030320165257.GL68306@darkness.sial.org> <20030320180114.GI15283@ifokr.org> Message-ID: <20030320203213.A26055@ttul.org> On 20/03/03 10:01 -0800, Brian Hatch wrote: > > > > Problems with MD5 can crop up when checksums are being generated for > > millions of entries, which increases the odds that two different strings > > share the same checksum. This problem can be reduced by using a digest > > algorithm that uses more bits; CPAN has several modules under the Digest > > area that offer lower chances of collisions at higher CPU costs. > > > > That being said, MD5 is likely to have a large enough bitspace for > > your needs. > > Since you're not actively trying to make two different texts generate > the same MD5 hash, you're asking "what are the chances I'll have > two end up with the same hash" which is the birtday paradox. > > A good estimate says "if you have X possible things, then if you > randomly pick 1.2 * sqrt(X) things, there's a 50/50 chance that > two will be the same". That's probably pretty applicable to this > situation. > > So, what would that number be? > > 1.2 * sqrt(2^128) == 1.2 * 2^64 == 22136092888451461939 > > So, if you happen to have 22136092888451461939 records that you're > checking out, it's even money that you will have one collision. Those odds are good enough for me. BUt I've always wondered if anybody has ever found two strings (let alone two text strings) (let alone two meaningful text strings) that digested to the same MD5 value. What we do if we did find a match. I think I'd just patch the MD5 library to look for the special case ;) Cheers, Brian > > This assumes that MD5 generates it's output 'evenly' (each hash value > is equally likely) which was one of the goals when it was created. > > > I now return you to your normally scheduled stick riddle. > > > > > -- > Brian Hatch Hang up and drive. > Systems and > Security Engineer > http://www.ifokr.org/bri/ > > Every message PGP signed From spug at ifokr.org Thu Mar 20 22:37:00 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: <20030320203213.A26055@ttul.org> References: <20030320165257.GL68306@darkness.sial.org> <20030320180114.GI15283@ifokr.org> <20030320203213.A26055@ttul.org> Message-ID: <20030321043700.GD15283@ifokr.org> > Those odds are good enough for me. > > BUt I've always wondered if anybody has ever found two strings (let > alone two text strings) (let alone two meaningful text strings) that > digested to the same MD5 value. What we do if we did find a match. > > I think I'd just patch the MD5 library to look for the special case ;) You could always perform an MD5 hash *and* some other hash too (preferably something very very quick) because there's an absolutely infitessimal chance that two strings will have the same hash for two separate hash algorithms. So small as to be the same possibility of breaking a stick at exactly the halfway point. That small a possibility. I mean we're talking *SMALL*[1]. [1] Ironic use of caps there, eh? -- Brian Hatch Why are a 'wise man' Systems and and a 'wise guy' Security Engineer opposites? http://www.ifokr.org/bri/ Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030320/53619a20/attachment.bin From jmates at sial.org Thu Mar 20 23:02:48 2003 From: jmates at sial.org (Jeremy Mates) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: <20030321043700.GD15283@ifokr.org> References: <20030320165257.GL68306@darkness.sial.org> <20030320180114.GI15283@ifokr.org> <20030320203213.A26055@ttul.org> <20030321043700.GD15283@ifokr.org> Message-ID: <20030321050248.GE24950@darkness.sial.org> On the other side of the coin, shorter (easier to store and type) hashes have much greater odds of collisions. The following eight character hashes (reductions on the MD5 data) are used by applications like OpenSSL. OpenSSL can look up certificates from a directory of certificate files named by the short hash; however, the number of certificates is typically low, and certificates can also be stored together in another file so again the odds of collisions are low. perl -MDigest::MD5 -nl \ -e '$h = sprintf "%08x", unpack "N", Digest::MD5::md5($_);' \ -e 'print "$s{$h} $_ $h" if exists $s{$h}; $s{$h} = $_' /usr/share/dict/words My words file has 234937 lines, and reports the following duplicates: backvelder draftily dcb75a20 burlily hobbly 32e38c3a footlock monosporous 68c7041c Harrovian skag 68db67e7 Palaeothentidae trabacolo 8a52b103 preceptorially untaughtness 2a759a38 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030320/09b39bb3/attachment.bin From david.dyck at fluke.com Thu Mar 20 23:23:10 2003 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: <20030321050248.GE24950@darkness.sial.org> References: <20030320165257.GL68306@darkness.sial.org> <20030320180114.GI15283@ifokr.org> <20030320203213.A26055@ttul.org> <20030321043700.GD15283@ifokr.org> <20030321050248.GE24950@darkness.sial.org> Message-ID: On Thu, 20 Mar 2003 at 21:02 -0800, Jeremy Mates wrote: > perl -MDigest::MD5 -nl \ > -e '$h = sprintf "%08x", unpack "N", Digest::MD5::md5($_);' \ > -e 'print "$s{$h} $_ $h" if exists $s{$h}; $s{$h} = $_' /usr/share/dict/words > > My words file has 234937 lines, and reports the following duplicates: > > backvelder draftily dcb75a20 > burlily hobbly 32e38c3a > footlock monosporous 68c7041c > Harrovian skag 68db67e7 > Palaeothentidae trabacolo 8a52b103 > preceptorially untaughtness 2a759a38 but you are only looking at the first 4 bytes of the 16 byte sum change sprintf "%08x", unpack "N", to unpack "H*", and you'll get no duplicates perl -MDigest::MD5 -nl -e '$h = unpack "H*", Digest::MD5::md5($_);' -e 'print "$h $_" ' words | sort 2a759a38153db6bb9246c4e93f2ced65 preceptorially 2a759a38905794ea80656c41b64d7977 untaughtness 32e38c3a36344b13aa24a054c2815783 hobbly 32e38c3a510460fdc436e2afc364b6e9 burlily 68c7041c485a9cdea92d3a400ef8b32d monosporous 68c7041c4c7e90a98b2af43c0f9f20c7 footlock 68db67e78ff999044702487ce55e4322 Harrovian 68db67e790b6edb560bdee7ea6770a85 skag 8a52b103fa1ee0f20937425c6d7aaadb trabacolo 8a52b103fb136b3801414fd241a59826 Palaeothentidae dcb75a206bebc34159d9ca7d473e484a backvelder dcb75a20a7a9ff1d5843b166528117e3 draftily From james at banshee.com Thu Mar 20 23:45:59 2003 From: james at banshee.com (James Moore) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: Message-ID: <006201c2ef6d$26eb6530$797ba8c0@gealach> I remember reading an article fairly recently comparing the chances of Earth being hit by a large asteroid to the chances of finding MD5 collisions. After an exhaustive search (ok, ten seconds on google) I was unable to find it, but I believe I was convinced that worrying about MD5 collisions wasn't useful. - James From jmates at sial.org Fri Mar 21 00:34:08 2003 From: jmates at sial.org (Jeremy Mates) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Appropriateness of MD5 In-Reply-To: References: <20030320165257.GL68306@darkness.sial.org> <20030320180114.GI15283@ifokr.org> <20030320203213.A26055@ttul.org> <20030321043700.GD15283@ifokr.org> <20030321050248.GE24950@darkness.sial.org> Message-ID: <20030321063408.GA25801@darkness.sial.org> * David Dyck > but you are only looking at the first 4 bytes of the 16 byte sum > > change > sprintf "%08x", unpack "N", > to > unpack "H*", > and you'll get no duplicates True, but that just emulates the regular md5_hex output, which has nothing to do with the eight character "openssl x509 -noout -hash" style short hashes the script should be generating. From JayeLill at earthlink.net Fri Mar 21 13:04:17 2003 From: JayeLill at earthlink.net (Jaye Lill) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Are you interested in speaking to groups? promoting SPUG? Message-ID: <002401c2efdc$ac9b55e0$93aef5d1@Jaye2003> Are there any SPUGers interested in speaking on the favorite passion of your choice (share your knowledge and expertise; let folks know what Perl can do; promote SPUG to the wide world)? If so, then please check out this forum: Speaker's Bureau of WA holds its Get Acquainted Brunch (Free - Soup provided, bring sandwich fixings) 10:00-12:00, March 29th. Forwards OK. This is for people of passion who would like to share their expertise with a wider audience. (Civic minded folks, freelancers, small business owners, people who want to share thei skills and grow their networks.) REGISTER, MAP http://www.evite.com/pages/invite/viewInvite.jsp?inviteId=SWUXSYRYCRVKCD MRNZDE&li=iq MORE INFO ON SPEAKERS BUREAU http://www.onewolf.cc/careerdev/NurtureContacts/Network/c-SpeakYourMind1 .htm CAREER COACHING FOLLOW ON If you want to attend the Career Coaching Seminar by Leslie Collins afterwards, then see this invite from Seattle WriterGrrls. (Leslie is excellent!) Open to all! http://www.evite.com/pages/invite/viewInvite.jsp?event=GGKFEDSFWHYWRDONU IXT&unknownUser=true $10 donation if you can; If your pockets are empty bring yourself and a smile :} Jaye www.onewolf.cc/careerdev Jaye@outsourcedsystems.com Encouragement - Pass it on. From thane at fastmail.fm Fri Mar 21 16:26:27 2003 From: thane at fastmail.fm (Thane Williams) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question Message-ID: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> I've often found myself wishing there were an option to split a string while retaining the characters you split with. For example: $string = "a,b,c,d,e,f,"; @array = split /,/, $string; print "@array\n"; Would print a, b, c, d, e, f, instead of a b c d e f Has anyone else wished this? Does anyone have any suggestions? I'd find this particularly useful when I'm dividing up big files based on complicated strings, and I want to preserve those strings in the chunks. From spug at ifokr.org Fri Mar 21 16:35:49 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> Message-ID: <20030321223549.GB15283@ifokr.org> > I've often found myself wishing there were an option to split a string > while retaining the characters you split with. For example: > > $string = "a,b,c,d,e,f,"; > @array = split /,/, $string; > print "@array\n"; > > Would print > a, b, c, d, e, f, > instead of > a b c d e f > > Has anyone else wished this? Nope. > Does anyone have any suggestions? I'd find > this particularly useful when I'm dividing up big files based on > complicated strings, and I want to preserve those strings in the chunks. Join them back together when you need the delimiters back: $string = "a,b,c,d,e,f,"; @array = split /,/, $string; print join(", ", @array), "\n"; Note that it doesn't capture your last ',' though, because perl drops any trailing empty elements when using split. -- Brian Hatch They assigned blank. Systems and So I read about blank. Security Engineer So now my mind is filled http://www.ifokr.org/bri/ with blank. --bree Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030321/37318c74/attachment.bin From Daniel.Pommert at VerizonWireless.com Fri Mar 21 16:36:20 2003 From: Daniel.Pommert at VerizonWireless.com (Pommert, Daniel) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question Message-ID: <9B30436F511ED5118EDF0002A55C318005790604@cairvexmb03.uswin.ad.vzwcorp.com> You need to provide the third parameter to split and it needs to either be a very large number or a negative number. Otherwise, as per the documentation, split will intentionally strip off the trailing empty fields. So, you example should read: $string = "a,b,c,d,e,f,"; @array = split /,/, $string, -1; print "@array\n"; -- Daniel Pommert -----Original Message----- From: Thane Williams [mailto:thane@fastmail.fm] Sent: Friday, March 21, 2003 2:26 PM To: spug-list@pm.org Subject: SPUG:Split question I've often found myself wishing there were an option to split a string while retaining the characters you split with. For example: $string = "a,b,c,d,e,f,"; @array = split /,/, $string; print "@array\n"; Would print a, b, c, d, e, f, instead of a b c d e f Has anyone else wished this? Does anyone have any suggestions? I'd find this particularly useful when I'm dividing up big files based on complicated strings, and I want to preserve those strings in the chunks. _____________________________________________________________ Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list MEETINGS: 3rd Tuesdays, U-District, Seattle WA WEB PAGE: www.seattleperl.org From jimfl at tensegrity.net Fri Mar 21 16:38:53 2003 From: jimfl at tensegrity.net (Jim Flanagan) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> Message-ID: On Fri, 21 Mar 2003, Thane Williams wrote: > I've often found myself wishing there were an option to split a string > while retaining the characters you split with. For example: > > $string = "a,b,c,d,e,f,"; > @array = split /,/, $string; > print "@array\n"; > > Would print > a, b, c, d, e, f, > instead of > a b c d e f @array = $string =~ /([^,],)/g; Should get you what you want (in this particular case). -- ::jimfl http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t From mathin at mathin.com Fri Mar 21 16:37:41 2003 From: mathin at mathin.com (Dan Ebert) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> Message-ID: <1048286260.19990.0.camel@algernon.lan.enic.cc> You could do: $string = "a,b,c,d,e,f,"; @array = split /,/, $string; print join(',', @array), "\n"; -- Dan Ebert ------------------------------------------------------------- Frisbeetarianism (n.), The belief that, when you die, your soul goes up on the roof and gets stuck there. On Fri, 2003-03-21 at 14:26, Thane Williams wrote: > I've often found myself wishing there were an option to split a string > while retaining the characters you split with. For example: > > $string = "a,b,c,d,e,f,"; > @array = split /,/, $string; > print "@array\n"; > > Would print > a, b, c, d, e, f, > instead of > a b c d e f > > Has anyone else wished this? Does anyone have any suggestions? I'd find > this particularly useful when I'm dividing up big files based on > complicated strings, and I want to preserve those strings in the chunks. > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org From jmates at sial.org Fri Mar 21 16:42:54 2003 From: jmates at sial.org (Jeremy Mates) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Split question In-Reply-To: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> Message-ID: <20030321224254.GA94593@darkness.sial.org> * Thane Williams > $string = "a,b,c,d,e,f,"; > @array = split /,/, $string; @array = split /(,)/, $string; From thane at fastmail.fm Fri Mar 21 16:55:04 2003 From: thane at fastmail.fm (Thane Williams) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <20030321224511.GE3552@eli.net> References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> <20030321224511.GE3552@eli.net> Message-ID: <20030321225504.1BBFE649F@smtp.us2.messagingengine.com> Thanks to everyone who suggested encasing the match in parentheses, this is the solution I was looking for. To everyone who is baffled why I wouldn't just join it back together: I'm splitting on known patterns with unknown contents, and I want to preserve the contents. From jimfl at tensegrity.net Fri Mar 21 16:55:06 2003 From: jimfl at tensegrity.net (Jim Flanagan) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Re: Split question In-Reply-To: <20030321224254.GA94593@darkness.sial.org> Message-ID: On Fri, 21 Mar 2003, Jeremy Mates wrote: > * Thane Williams > > $string = "a,b,c,d,e,f,"; > > @array = split /,/, $string; > > @array = split /(,)/, $string; That would capture the commas, but as separate elements in the list. -- ::jimfl http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t From jimfl at tensegrity.net Fri Mar 21 16:57:26 2003 From: jimfl at tensegrity.net (Jim Flanagan) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: Message-ID: On Fri, 21 Mar 2003, Jim Flanagan wrote: > @array = $string =~ /([^,],)/g; > > Should get you what you want (in this particular case). I omitted a crucial element: It should be @array = $string =~ /([^,]+,)/g; (In case you have "abc,123,def,"); -- ::jimfl http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t From brian at coolnamehere.com Fri Mar 21 18:00:34 2003 From: brian at coolnamehere.com (Brian Wisti) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: Message-ID: <4E300DE0-5BF9-11D7-912D-000502C99ADB@coolnamehere.com> In the spirit of TMTOWTDI: my @list = map { "$__," } split /,/ "a,b,c,d,e,f"; print @list, "\n"; :-) -Brian W On Friday, March 21, 2003, at 02:57 PM, Jim Flanagan wrote: > On Fri, 21 Mar 2003, Jim Flanagan wrote: > >> @array = $string =~ /([^,],)/g; >> >> Should get you what you want (in this particular case). > > I omitted a crucial element: It should be > > @array = $string =~ /([^,]+,)/g; > > (In case you have "abc,123,def,"); > > -- > ::jimfl > > http://jimfl.tensegrity.net > mailto:jimfl%40t%65ns%65gr%69ty.n%65t > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > > > > Brian Wisti (brian@coolnamehere.com) - http://coolnamehere.com/ From brian at coolnamehere.com Fri Mar 21 18:11:54 2003 From: brian at coolnamehere.com (Brian Wisti) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <4E300DE0-5BF9-11D7-912D-000502C99ADB@coolnamehere.com> Message-ID: In the spirit of TAAMWTDIR[1]: my @list = map { "$__," } split /,/, "a,b,c,d,e,f"; print @list, "\n"; [1]: There Aren't As Many Ways To Do It Right -Brian W On Friday, March 21, 2003, at 04:00 PM, Brian Wisti wrote: > In the spirit of TMTOWTDI: > > my @list = map { "$__," } split /,/ "a,b,c,d,e,f"; > print @list, "\n"; > > > :-) > > -Brian W > > On Friday, March 21, 2003, at 02:57 PM, Jim Flanagan wrote: > >> On Fri, 21 Mar 2003, Jim Flanagan wrote: >> >>> @array = $string =~ /([^,],)/g; >>> >>> Should get you what you want (in this particular case). >> >> I omitted a crucial element: It should be >> >> @array = $string =~ /([^,]+,)/g; >> >> (In case you have "abc,123,def,"); >> >> -- >> ::jimfl >> >> http://jimfl.tensegrity.net >> mailto:jimfl%40t%65ns%65gr%69ty.n%65t >> >> _____________________________________________________________ >> Seattle Perl Users Group Mailing List >> POST TO: spug-list@mail.pm.org >> ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list >> MEETINGS: 3rd Tuesdays, U-District, Seattle WA >> WEB PAGE: www.seattleperl.org >> >> >> >> > Brian Wisti (brian@coolnamehere.com) > - http://coolnamehere.com/ > > _____________________________________________________________ > Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org > ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays, U-District, Seattle WA > WEB PAGE: www.seattleperl.org > > > From brian at coolnamehere.com Fri Mar 21 18:59:47 2003 From: brian at coolnamehere.com (Brian Wisti) Date: Mon Aug 2 21:36:54 2004 Subject: Fwd: SPUG:Split question Message-ID: <93DD139A-5C01-11D7-912D-000502C99ADB@coolnamehere.com> In the spirit of TASMWTSSTU[1]: my @list = map { "$_," } split /,/, "a,b,c,d,e,f,"; [1]: There Are So Many Ways To Screw Simple Things Up Begin forwarded message: > From: Joshua Keroes > Date: Fri Mar 21, 2003 4:58:46 PM US/Pacific > To: Brian Wisti > Subject: Re: SPUG:Split question > > Think you meant $_, not $__. > > Happy weekend, > J > > On (Fri, Mar 21 16:11), Brian Wisti wrote: >> In the spirit of TAAMWTDIR[1]: >> >> my @list = map { "$__," } split /,/, "a,b,c,d,e,f"; >> print @list, "\n"; >> >> >> [1]: There Aren't As Many Ways To Do It Right >> >> -Brian W >> >> On Friday, March 21, 2003, at 04:00 PM, Brian Wisti wrote: >> >>> In the spirit of TMTOWTDI: >>> >>> my @list = map { "$__," } split /,/ "a,b,c,d,e,f"; >>> print @list, "\n"; >>> >>> >>> :-) >>> >>> -Brian W >>> >>> On Friday, March 21, 2003, at 02:57 PM, Jim Flanagan wrote: >>> >>>> On Fri, 21 Mar 2003, Jim Flanagan wrote: >>>> >>>>> @array = $string =~ /([^,],)/g; >>>>> >>>>> Should get you what you want (in this particular case). >>>> >>>> I omitted a crucial element: It should be >>>> >>>> @array = $string =~ /([^,]+,)/g; >>>> >>>> (In case you have "abc,123,def,"); >>>> >>>> -- >>>> ::jimfl >>>> >>>> http://jimfl.tensegrity.net >>>> mailto:jimfl%40t%65ns%65gr%69ty.n%65t >>>> >>>> _____________________________________________________________ >>>> Seattle Perl Users Group Mailing List >>>> POST TO: spug-list@mail.pm.org >>>> ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list >>>> MEETINGS: 3rd Tuesdays, U-District, Seattle WA >>>> WEB PAGE: www.seattleperl.org >>>> >>>> >>>> >>>> >>> Brian Wisti (brian@coolnamehere.com) >>> - http://coolnamehere.com/ >>> >>> _____________________________________________________________ >>> Seattle Perl Users Group Mailing List POST TO: spug-list@mail.pm.org >>> ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list >>> MEETINGS: 3rd Tuesdays, U-District, Seattle WA >>> WEB PAGE: www.seattleperl.org >>> >>> >>> >> >> _____________________________________________________________ >> Seattle Perl Users Group Mailing List >> POST TO: spug-list@mail.pm.org >> ACCOUNT CONFIG: http://mail.pm.org/mailman/listinfo/spug-list >> MEETINGS: 3rd Tuesdays, U-District, Seattle WA >> WEB PAGE: www.seattleperl.org >> > > From MichaelRunningWolf at att.net Fri Mar 21 23:07:26 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <9B30436F511ED5118EDF0002A55C318005790604@cairvexmb03.uswin.ad.vzwcorp.com> References: <9B30436F511ED5118EDF0002A55C318005790604@cairvexmb03.uswin.ad.vzwcorp.com> Message-ID: "Pommert, Daniel" writes: > You need to provide the third parameter to split and it needs to > either be a very large number or a negative number. Otherwise, as > per the documentation, split will intentionally strip off the > trailing empty fields. This bit me years ago before I recognized the importance of that one sentence. When I teach it now, I tell folks to *always* put a -1 as the 3rd parameter if they're splitting *data* because trailing delimiters are delimiting a null field. This is different from splitting *text*, in which trailing delimeters are supurflous, and should be disposed of. # root:q.mJzTnu8icF.:0:10:superuser:/:/bin/csh # xxx::100:100:mb_daemon:/usr/make-believe/daemon: my $line = qx(head /etc/passwd); my ($id, @other_fields, $shell) = split /,/, $line, -1; Some accounts contain a null 7th field. Without the 3rd argument, $shell will always contain the last *filled* argument, not the *7th* field. Said differently, @other_fields will at most 5 fields, but occasionally less. -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From MichaelRunningWolf at att.net Fri Mar 21 23:35:57 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:array arg to push Message-ID: Has anyone used an expression as the first argument to push? I know that there's something special about the prototype of the builtins so that they can take an array as the first argument without expanding it, but had hoped that I could have an expression as the first argument. This doesn't work. Ideas? my ($min, $max) = (1, 10); foreach ($min..$max) { push(($_%2 ? @odd : @even), $_); } print "even: @even\n"; print "odd: @odd\n"; -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From MichaelRunningWolf at att.net Fri Mar 21 23:42:06 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: <20030321225504.1BBFE649F@smtp.us2.messagingengine.com> References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> <20030321224511.GE3552@eli.net> <20030321225504.1BBFE649F@smtp.us2.messagingengine.com> Message-ID: "Thane Williams" writes: > Thanks to everyone who suggested encasing the match in parentheses, this > is the solution I was looking for. > > To everyone who is baffled why I wouldn't just join it back together: > I'm splitting on known patterns with unknown contents, and I want to > preserve the contents. Like this, I presume. What does your field processing loop look like? I've taken a stab at a slice that grabs, then modifies, them to be qouted. while ($line = ) { chomp $line; @fields = split /([ ,:])/, $line, -1; foreach my $field(@fields[grep {$_%2 == 0} 0..$#fields]) { $field = qq("$field"); } print join("|", @fields), "\n"; } __DATA__ comma,separated,line colon:separated:line space separated line Output: "comma"|,|"separated"|,|"line" "colon"|:|"separated"|:|"line" "space"| |"separated"| |"line" -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From damian at conway.org Fri Mar 21 23:54:22 2003 From: damian at conway.org (Damian Conway) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:array arg to push In-Reply-To: References: Message-ID: <3E7BFA8E.7040906@conway.org> Michael R. Wolf wrote: > Has anyone used an expression as the first argument to push? I know > that there's something special about the prototype of the builtins so > that they can take an array as the first argument without expanding > it, but had hoped that I could have an expression as the first > argument. The \@ prototype of C requires that the corresponding argument literally begin with a @. > This doesn't work. Ideas? > > my ($min, $max) = (1, 10); > foreach ($min..$max) { > push(($_%2 ? @odd : @even), $_); push @{ $_%2 ? \@odd : \@even}, $_; Damian From david.dyck at fluke.com Sat Mar 22 10:21:31 2003 From: david.dyck at fluke.com (David Dyck) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: References: <9B30436F511ED5118EDF0002A55C318005790604@cairvexmb03.uswin.ad.vzwcorp.com> Message-ID: On Fri, 21 Mar 2003 at 21:07 -0800, Michael R. Wolf # root:q.mJzTnu8icF.:0:10:superuser:/:/bin/csh > # xxx::100:100:mb_daemon:/usr/make-believe/daemon: > my $line = qx(head /etc/passwd); > my ($id, @other_fields, $shell) = split /,/, $line, -1; > > Some accounts contain a null 7th field. Without the 3rd argument, > $shell will always contain the last *filled* argument, not the *7th* > field. Said differently, @other_fields will at most 5 fields, but > occasionally less. I don't think that your variable @other_fields is leaving the variable $shell to collect the last paramter. If I understand it, the @other_fields soak up the rest of the arguments and $shell will always be undef, right? $ perl -le '@x=qw(a b c d e); ($a,@m,$e) = @x; print "a=<$a>, m=<@m>, e=<$e>"' a=, m=, e=<> I skimmed through the documentation where I read this, but the only thing close in perlsub in the discussion of prototypes. Any unbackslashed "@" or "%" eats all remaining arguments, and forces list context. perlsub does say The "my" is simply a modifier on something you might assign to. So when you do assign to variables in its argument list, "my" doesn't change whether those variables are viewed as a scalar or an array. After more searching in perldata on assigning to a list I see the explanation The final element of a list assignment may be an array or a hash: ($a, $b, @rest) = split; my($a, $b, %rest) = @_; You can actually put an array or hash anywhere in the list, but the first one in the list will soak up all the values, and anything after it will become undefined. This may be useful in a my() or local(). From MichaelRunningWolf at att.net Sat Mar 22 16:18:28 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: References: <9B30436F511ED5118EDF0002A55C318005790604@cairvexmb03.uswin.ad.vzwcorp.com> Message-ID: "Michael R. Wolf" writes: [...] > # root:q.mJzTnu8icF.:0:10:superuser:/:/bin/csh > # xxx::100:100:mb_daemon:/usr/make-believe/daemon: > my $line = qx(head /etc/passwd); > my ($id, @other_fields, $shell) = split /,/, $line, -1; ^ Should be a colon, not a comma ---------------/ Thanks, David for noticing. And also, as David pointed out, the array is greedy. I knew that, but hadn't paid attention as I sketched an illustration. It was my attempt to document the field mnemonically. Perhaps this is a better illustration: (undef, undef, undef, undef, undef, undef, $shell) = split /,/, $line, -1; With a 3rd argument of -1, $shell will get an empty string because the split will always return a 7 element list. Without the 3rd argument, the split will ignore trailing delimiters, thereby returning a list of different length on different lines. In that case, $shell gets undef, and you get (you are using -w, aren't you) errors later in your code regarding an undef value. Said differently, supplying the 3rd argument makes split behave more consistently with the data, for this kind of data. Thanks again for picking up the nits. Michael -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From MichaelRunningWolf at att.net Sat Mar 22 16:21:19 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> <20030321224511.GE3552@eli.net> <20030321225504.1BBFE649F@smtp.us2.messagingengine.com> Message-ID: Better illustration of trailing empty fields..... while ($line = ) { chomp $line; @fields = split /([ ,:])/, $line, -1; foreach my $field(@fields[grep {$_%2 == 0} 0..$#fields]) { $field = qq("$field"); } print join("|", @fields), "\n"; } __DATA__ comma,separated,line comma,separated,line,,empty,fields,,,, colon:separated:line space separated line Output: "comma"|,|"separated"|,|"line" "comma"|,|"separated"|,|"line"|,|""|,|"empty"|,|"fields"|,|""|,|""|,|""|,|"" "colon"|:|"separated"|:|"line" "space"| |"separated"| |"line" -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From spug at ifokr.org Sat Mar 22 18:01:48 2003 From: spug at ifokr.org (Brian Hatch) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: References: <9B30436F511ED5118EDF0002A55C318005790604@cairvexmb03.uswin.ad.vzwcorp.com> Message-ID: <20030323000148.GS15283@ifokr.org> > (undef, undef, undef, undef, undef, undef, $shell) = > split /,/, $line, -1; or better ($shell) = (split /:/ $line, -1)[6]; or for other examples: ($shell,$username,$gid) = (split /:/ $line, -1)[6,0,2]; Array slices are cool. -- Brian Hatch A picture is worth Systems and a thousand words, Security Engineer but it uses up a http://www.ifokr.org/bri/ lot more disk space. Every message PGP signed -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.pm.org/pipermail/spug-list/attachments/20030322/4cad7f49/attachment.bin From sthoenna at efn.org Fri Mar 21 17:40:31 2003 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> Message-ID: On Fri, 21 Mar 2003 14:26:27 -0800, thane@fastmail.fm wrote: >$string = "a,b,c,d,e,f,"; >@array = split /,/, $string; >print "@array\n"; > >Would print >a, b, c, d, e, f, >instead of >a b c d e f What a fasinating variety of ways that people have understood your question! Here's my entry, answering the question as I read it: @array = split /(?<=,)/, $string; If your actual regex isn't subject to lookbehind, you need to use a list context pattern match instead (untested): @array = $string =~ /\G(.*?,|.*)/g It may be tricky making sure you get it to work as you want with e.g. multiple delimiters in a row or both delimiter at the end and not. From MichaelRunningWolf at att.net Sun Mar 23 13:31:18 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Split question In-Reply-To: References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> <20030321224511.GE3552@eli.net> <20030321225504.1BBFE649F@smtp.us2.messagingengine.com> Message-ID: "Michael R. Wolf" writes: > Better illustration of trailing empty fields..... But also illustrating a bug... IMO, a delimiter should not be allowed the freedom to match the entire character class for each field. It should be allowed the freedom on the first field, but thereafter, it should honor its first choice. while ($line = ) { chomp $line; @fields = split /([ ,:])/, $line, -1; foreach my $field(@fields[grep {$_%2 == 0} 0..$#fields]) { $field = qq("$field"); } print join("|", @fields), "\n"; } __DATA__ comma,separated,line comma,separated,line,,empty,fields,,,, colon:separated:line colon:separated:line:But, as promised, with a bug space separated line Output: "comma"|,|"separated"|,|"line" "comma"|,|"separated"|,|"line"|,|""|,|"empty"|,|"fields"|,|""|,|""|,|""|,|"" "colon"|:|"separated"|:|"line" "colon"|:|"separated"|:|"line"|:|"But"|,|""| |"as"| |"promised"|,|""| |"with"| |"a"| |"bug" "space"| |"separated"| |"line" ================================================================ Here's my solution. It assumes that each line can choose its own delimiter, which is enforced for all subsequent fields. It would be fairly easy to modify to have the first delimiter of the first line to choose the delimiter for the remainder of the file. while ($line = ) { chomp $line; # was --- @fields = split /([ ,:])/, $line, -1; my @delim_pref_order = (":", ",", " "); foreach my $delim (@delim_pref_order) { @fields = split /($delim)/, $line, -1; last if @fields > 2; # The multi-field case. } @fields = ($line) unless @fields; # The 1 field case. foreach my $field(@fields[grep {$_%2 == 0} 0..$#fields]) { $field = qq("$field"); } print join("|", @fields), "\n"; } __DATA__ comma,separated,line comma,separated,line,,empty,fields,,,, colon:separated:line colon:separated:line:But, as promised, with a bug space separated line solitary-field Output: "comma"|,|"separated"|,|"line" "comma"|,|"separated"|,|"line"|,|""|,|"empty"|,|"fields"|,|""|,|""|,|""|,|"" "colon"|:|"separated"|:|"line" "colon"|:|"separated"|:|"line"|:|"But, as promised, with a bug" "space"| |"separated"| |"line" "solitary-field" And Yitzchak, I agree, it's interesting how many ways this went. I, too, thought of the look-ahead, look-behind "root of this equation" upon first read of the problem, but pursued the thread as it was further refined. -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From aaron at activox.com Mon Mar 24 09:06:38 2003 From: aaron at activox.com (Aaron Salo) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Mail::SpamAssassin In-Reply-To: References: <20030321222627.0C40D51A6C@smtp.us2.messagingengine.com> <20030321224511.GE3552@eli.net> <20030321225504.1BBFE649F@smtp.us2.messagingengine.com> Message-ID: <3.0.5.32.20030324070638.0110ad50@mail.activox.com> After finally punting on the hassle of constantly updating "roll your own" procmail recipes to kill spam, I've been trying out several alternatives. FWIW I am very happy with Mail::SpamAssassin. I have it piping flagged spam into a spambox rather than /dev/null so I can review what it kicks out. So far, using the default configuration and scoring settings, since Sunday morning: Of more than 100 catches, every catch was spam. Of the dozen or so messages it allowed through, not a single one was spam. 100% accuracy so far. Very impressive. Good documentation and very flexible config if you want to tamper under the hood. Clever heurestics check. Builds with a daemon (both perl and c) if you prefer to let it hum all the time rather than pipe each message to it. Does RBL checking, has ability to auto-report to Razor, many other features. If you are getting tired of maintaining your list of homemade procmail recipes, it's worth a try. ~!aaron From pdarley at kinesis-cem.com Mon Mar 24 10:46:39 2003 From: pdarley at kinesis-cem.com (Peter Darley) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Appropriateness of MD5 Message-ID: Friends, Thanks for everyone's advice on this. It looks like the MD5 checksum is prety darn unique, so I'll use it. Thanks, Peter Darley From JMyhre at ctiseattle.com Mon Mar 24 12:10:53 2003 From: JMyhre at ctiseattle.com (Myhre, Julie) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Perllocal.mod Message-ID: Hello, This is a re-post as I was not yet a member when I first sent this out.... As a recently hired sysadmin, I have been newly dumped into the perl world, and one of my developer coworkers noticed perllocal.pod sitting in /. The little I know about this file is that it should live in $INSTALLARCHLIB (which evidently wasn't defined at compile time) and that it is meant simply to log the modules installed with MakeMaker. I've also read some people's opinions of perllocal.mod - it isn't useful, doesn't track actual updates.... But: is it necessary? Can I delete it or should I just move it to a better place (and define the env. variable $INSTALLARCHLIB)? Thanks for any info you can give on this naïve question! Julie Myhre This e-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. From MichaelRunningWolf at att.net Wed Mar 26 13:36:45 2003 From: MichaelRunningWolf at att.net (Michael R. Wolf) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:the microship/flotilla project is ready for team members In-Reply-To: References: Message-ID: About 5 weeks ago, I wrote... "Michael R. Wolf" writes: > For those who missed my "town crier" announcement at the SPUG meeting > last night, Steve Roberts has gotten re-energized about the microship > project. Folks that heard him speak at the December meeting will > remember that he was basically "dead in the water", except he wasn't > yet in the water. [...] > Steve plans to have a kick-off gala in a few weeks where you can visit > his land-based laboratory, meet the team, enjoy some curry and cold > beer, and talk about the summer launch of the water-based laboratory > -- the microship flotilla. > > I chopped about 95% out of this URL to get the following outline. > Many of the tasks are still at such a high level that there is not yet > a bullet item for them. Dig around see what may interst you. Pass > the list on. Grab a friend. Join the fun. > > http://www.microship.com/flotilla/microship-todo.html The list has been defined/refined. The volunteer kick-off meeting/party/gala is scheduled. I'm going. Please contact me if you'd like to join me. Michael Wolf -- Michael R. Wolf All mammals learn by playing! MichaelRunningWolf@att.net From m3047 at inwa.net Wed Mar 26 13:47:08 2003 From: m3047 at inwa.net (Fred Morris) Date: Mon Aug 2 21:36:54 2004 Subject: Anybody going to maintain the calendar on the SWAN? Re: SPUG:the Message-ID: "Michael R. Wolf" writes: >About 5 weeks ago, I wrote... > >"Michael R. Wolf" writes: > >> For those who missed my "town crier" announcement at the SPUG meeting >> last night, Steve Roberts has gotten re-energized about the microship >> project. >>[...] >The list has been defined/refined. The volunteer kick-off >meeting/party/gala is scheduled. > >I'm going. Please contact me if you'd like to join me. Not trying to bust your chops, but I don't see anything about this on the PNW IT group on the SWAN. I wrote the software, but I'm not going to maintain the events list indefinitely: use it or lose it! -- Fred Morris m3047@inwa.net From tim at consultix-inc.com Thu Mar 27 18:06:41 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:54 2004 Subject: SPUG:Perl/SQL job Message-ID: <20030327160641.A23807@timji.consultix-inc.com> hello - I am looking for a perl&mysql guru and thought SPUG would be the perfect place to advertise for the position - here are the details : =================================== Company name: Case's Ladder, Inc. Location: United States, WA, Mount Vernon Travel: 0-25% Terms of employment: Salaried employee Hours: Full time Onsite: yes Description: We are seeking energetic, success oriented applicants to help maintain, enhance, and create programs to operate Case's Ladder, an online gaming service provider. We are a profitable company that has been in business for over seven years, and are owned by eUniverse, a NASDAQ traded profitable Internet entertainment company. Required skills: Strong background in Perl, mod_perl, MySQL and PHP. Good understanding of CVS or other version control software. Ability to interact with other staff members, clients, and customers is also required. Desired skills: Experience with high volume dynamically generated web sites, including LVS, mod_backhand, proxies, and PHP accelerators. URL for more information: http://www.igl.net/moreinfo/jobs.html Contact information: E-mail a cover letter, resume, code samples/URLs of your work to jobs@igl.net ============================= thank you in advance for any help you can provide in filling this position - Jonathon.Scott From tim at consultix-inc.com Mon Mar 31 12:33:28 2003 From: tim at consultix-inc.com (Tim Maher) Date: Mon Aug 2 21:36:55 2004 Subject: SPUG:April 8th Array(bio) Meeting Message-ID: <20030331103328.A5623@timji.consultix-inc.com> SPUGsters, I've been asked by the announcer to post this announcement to the SPUG list, on the assumption that some of our members might be interested. I'll do it this time, but given my impression that it's only a handful of SPUGsters who are truly interested, those folks should arrange to get this information directly from the source in the future. ======================================================= | Tim Maher, Ph.D. tim@timmaher.org | | JAWCAR ("Just Another White-Camel Award Recipient") | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ======================================================= Dear Colleagues, Please join me for the fourth meeting of array(bio), biology and computing special interest group at 6:00PM on April 8th at the Lake Washington Rowing Club (see attachment for directions). The Rowing Club is made available to us thanks to the generous sponsorship of LRIG-NW ( www.lrig.org ). Our April 8th meeting will focus on: Genomics and the FDA Microarrays offer researchers tremendous opportunities to truly understand underlying biological causes of disease. As microarrays become more routinely used in drug and diagnostic discovery, the FDA recognizes that they must adapt their current regulatory processes to incorporate these new technologies. array(bio) is delighted to welcome Dr. Gerald van Belle from the University of Washington and Dr. Lue Ping Zhao from Enodar Biologic. Our presenters will tackle the question, "How does the FDA plan to adapt its present regulatory practices and guidelines to these new technologies?" For additional background information about the FDA and microarrays, please see the attached article titled "Medical applications of microarray technologies: a regulatory science perspective" There is no charge for the meeting. Please feel free to forward this message to anyone you feel would have an interest in this subject. If you would like to attend the meeting, please RSVP to me so we can plan accordingly. For more information about array(bio) go to www.arraybio.org . Thank you in advance, Eric Olson VizX Labs, LLC 206-336-5607 eric@vizxlabs.com About array(bio) With the ground breaking work of leaders such as the UW, Fred Hutchinson Cancer Research Center, the Institute for Systems Biology and Rosetta (Merck), Washington State is well positioned to be at the center of the emerging field of bioinformation. The objective of array(bio) is to connect leaders in biology, software and business to help fuel communication and foster entrepreneurship. Participating Organizations: Affymetrix Amgen Cellular Therapeutics Inc. Davis Wright Tremaine Enodar Biologic IBM National Oceanic and Atmospheric Administration Seattle Biomedical Research Institute State of Washington Virginia Mason Research Washington Mutual Venture Capital VizXLabs Yoh Company Our Newest Sponsors! Leary Franke and Droppert ( http://www.lfdlaw.com ) Accelrys ( www.accelrys.com ) Echospace ( www.echospace.com ) Our Sponsors: IBM ( www.ibm.com ) VizXLabs ( www.vizxlabs.com ) Yoh Company ( www.yoh.com ) WBBA ( www.wabio.org ) WSA ( www.wsa.org ) InfoResource.ORG ( www.inforesource.org ) LRIG ( www.lrig.org ) ----- End forwarded message ----- -- -Tim *------------------------------------------------------------* | Tim Maher, CONSULTIX (206) 781-UNIX (866) DOC-PERL | | CEO, JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com | *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-* | UPCOMING CLASSES: Perl Programming, 3/26-28, Tukwila WA | *------------------------------------------------------------*