From akcrum at hotmail.com Sun Mar 4 13:21:42 2001 From: akcrum at hotmail.com (Andrew Crum) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: detect process memory use - Win32 platform Message-ID: I need to be able to periodically have my perl logic detect how much memory it (the process) is currently using on a Win32 platform. Anyone have a suggestion? -Andrew _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sun Mar 4 16:00:38 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: IGNORE THIS MESSAGE- testing Message-ID: <20010304140038.A21948@timji.consultix.wa.com> Just a test to see if we're truly completely back to normal now, as I expect is the case. If so, all thanks go to Wayne Walker, the SPUG majordomo administrator! Hail Wayne! Those of you who've been clamoring to get off the list, or unsubscribe to the main list and subscribe instead to the weekly digest, should be able to do so now in the usual way. -Tim ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Tue Mar 6 18:14:51 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: March 8 Extreme Programming Meeting: Unit-Testing Techniques Message-ID: I am giving a talk on Thursday at the Extreme Programming Group about unit-testing techniques. The talk will have some Java content so be warned. However, it still seems relevant here for the following reasons: 1. Perl has a unit-testing module (Test::Unit). The unit-testing techniques that I will discuss (such as Mock Objects) are just as applicable to Perl unit-testing as unit-testing in other languages. 2. There will be free pizza -- that great unifier of all programming language practitioners. 3. Perhaps this can inspire someone to write a better unit-testing framework for Perl. Here is the announcement: EXTREME PROGRAMMING MEETING TOPIC "Some Unit-Testing Techniques" by Asim Jalis We will tackle the following problem which comes up frequently in unit-testing: How do you test objects that talk to things outside the program, or have external state. Examples: sockets, database code, EJBs. (It is undesirable to unit-test database code by hitting a live database, or to unit-test socket code by sending out messages over a live wire.) The main idea is to use mock objects which have the same method signatures as the underlying objects, but which intercept the messages before they go to the database or to the socket, and then serve them up for unit-testing. This solves the problem but requires writing lots of mindless stub code for the mock objects. So to solve this second problem I will demo a tool I have developed which can generate these mock objects automatically using reflection (in Java) and make unit-testing with mock objects painless. More generally this tool demonstrates how to use Java's reflection to autogenerate code. Bring your questions and insights into how to improve these ideas. DATE AND SCHEDULE Thursday, March 8, 2001 (second Thursday of the month). 6.30 pm - 7.00 pm : Pizza + Networking. 7.00 pm - 9.00 pm : Presentations and Q&A. LOCATION Suite 100, Lante's Main Conference Room 3180 139th Avenue SE Bellevue, WA 98005 425.564.8800 (main desk) DIRECTIONS I have refactored the directions into two parts. First, how to get to 139th Ave SE (which depends on which interstate you use) and then how to get to 3180 which should be same for all cases: STEP 1: How to get to 139th Ave SE From I-405 South (going towards I-90) from Bellevue, Redmond. * Take exit 10 for Coal Creek Parkway and turn LEFT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE. From I-405 North (going towards I-90) from Renton. * Take exit 10 for Coal Creek Parkway and turn RIGHT at the light as you get off the ramp onto Coal Creek Parkway. * Turn LEFT at Factoria Blvd (128th Av SE). * You will cross I-90 by going under it. * Turn RIGHT onto Eastgate Way SE, immediately after crossing I-90. * Take a LEFT at the light onto 139th Ave SE From I-90 West (going towards I-405) from Bellevue, Issaquah, Redmond. * Take the 161st Ave SE/156th Ave SE/150th Ave SE exit (exit 11). * Keep LEFT at the fork in the ramp. * Keep RIGHT at the fork in the ramp. * Turn LEFT onto SE Eastgate Way. * Turn RIGHT onto 139th Ave SE. From I-90 East (going towards I-405) from Seattle, Mercer Island. * Take the Richards Road exit (exit 10). * Take a LEFT at the light off the exit ramp onto Richards Rd. * You will drive under I-90 crossing it. * Take the first RIGHT onto SE Eastgate Way. * Take a LEFT at the light onto 139th Ave SE STEP 2: How to find 3180 on 139th Ave SE * Drive past the turn for SE 32nd St. * 3180 will be the first building on your RIGHT. * You will notice a parking entrance into the building on your RIGHT. * Drive into it and then drive up the parking garage to the top (the 4th floor) which has uncovered parking. * Park anywhere (parking is free). * The building entrance should be straight ahead and there will be signs pointing to the XP meeting. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Thu Mar 8 14:28:04 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: Re: Perl Compiler. In-Reply-To: <002d01c0a390$92979680$61affea9@ccokos>; from jcokos@iwebsys.com on Fri, Mar 02, 2001 at 07:18:07PM -0800 References: <002d01c0a390$92979680$61affea9@ccokos> Message-ID: <20010308122804.A25654@ero.com> On Fri, Mar 02, 2001 at 07:18:07PM -0800, John Cokos wrote: > Has anyone messed around with the compiler yet? I started once, then decided that C was easier; you can embed a perl interpreter into your C code with relatively little pain. No CPAN, though. dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From akcrum at hotmail.com Thu Mar 8 16:57:09 2001 From: akcrum at hotmail.com (Andrew Crum) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: Re: Perl Compiler. Message-ID: I use IndigoStar's Perl2exe product to compile perl on Win32, Linux and Solaris. I install needed CPAN modules directly into the perl2exe tree as well as use $PERL5LIB to point the way to my modules. Questions? >From: Dean Hudson >To: John Cokos >CC: spug-list@pm.org >Subject: SPUG: Re: Perl Compiler. >Date: Thu, 8 Mar 2001 12:28:04 -0800 > >On Fri, Mar 02, 2001 at 07:18:07PM -0800, John Cokos wrote: > > Has anyone messed around with the compiler yet? > >I started once, then decided that C was easier; you can embed a perl >interpreter into your C code with relatively little pain. No CPAN, >though. > >dean. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Thu Mar 8 17:29:28 2001 From: jcokos at iwebsys.com (John Cokos, CEO, iWeb, Inc.) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: Re: Re: Perl Compiler. References: Message-ID: <018401c0a827$b314a740$0500a8c0@iwebx1> The last time I tried that program, it wouldn't support any external .pm files (either those from CPAN or those that I'd written) at all. Only the stuff that he shipped with it. I gave up on it: without DBI or DBD, it's useless. Can I assume that it's changed since then? John ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== ----- Original Message ----- From: "Andrew Crum" To: Sent: Thursday, March 08, 2001 2:57 PM Subject: SPUG: Re: Perl Compiler. > I use IndigoStar's Perl2exe product to compile perl on Win32, Linux and > Solaris. I install needed CPAN modules directly into the perl2exe tree as > well as use $PERL5LIB to point the way to my modules. Questions? > > > >From: Dean Hudson > >To: John Cokos > >CC: spug-list@pm.org > >Subject: SPUG: Re: Perl Compiler. > >Date: Thu, 8 Mar 2001 12:28:04 -0800 > > > >On Fri, Mar 02, 2001 at 07:18:07PM -0800, John Cokos wrote: > > > Has anyone messed around with the compiler yet? > > > >I started once, then decided that C was easier; you can embed a perl > >interpreter into your C code with relatively little pain. No CPAN, > >though. > > > >dean. > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From akcrum at hotmail.com Thu Mar 8 18:10:34 2001 From: akcrum at hotmail.com (Andrew Crum) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: Re: Re: Perl Compiler. Message-ID: Yes. (fyi - details communicated offline). >From: "John Cokos, CEO, iWeb, Inc." >To: "Andrew Crum" , >Subject: SPUG: Re: Re: Perl Compiler. >Date: Thu, 8 Mar 2001 15:29:28 -0800 > >The last time I tried that program, it wouldn't support >any external .pm files (either those from CPAN or those >that I'd written) at all. Only the stuff that he shipped >with it. I gave up on it: without DBI or DBD, it's useless. > >Can I assume that it's changed since then? > >John > >======================================== > John Cokos, President / CEO: iWeb Inc. > http://www.iwebsys.com > jcokos@ccs.net >======================================== >----- Original Message ----- >From: "Andrew Crum" >To: >Sent: Thursday, March 08, 2001 2:57 PM >Subject: SPUG: Re: Perl Compiler. > > > > I use IndigoStar's Perl2exe product to compile perl on Win32, Linux and > > Solaris. I install needed CPAN modules directly into the perl2exe tree >as > > well as use $PERL5LIB to point the way to my modules. Questions? > > > > > > >From: Dean Hudson > > >To: John Cokos > > >CC: spug-list@pm.org > > >Subject: SPUG: Re: Perl Compiler. > > >Date: Thu, 8 Mar 2001 12:28:04 -0800 > > > > > >On Fri, Mar 02, 2001 at 07:18:07PM -0800, John Cokos wrote: > > > > Has anyone messed around with the compiler yet? > > > > > >I started once, then decided that C was easier; you can embed a perl > > >interpreter into your C code with relatively little pain. No CPAN, > > >though. > > > > > >dean. > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your >Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, >spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: >http://www.halcyon.com/spug/ > > > > > > > > > > _________________________________________________________________ > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your >Email-address > > For daily traffic, use spug-list for LIST ; for weekly, >spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: >http://www.halcyon.com/spug/ > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From creede at rrauto.com Thu Mar 8 18:27:05 2001 From: creede at rrauto.com (Creede Lambard) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: Re: Perl Compiler. References: <018401c0a827$b314a740$0500a8c0@iwebx1> Message-ID: <009501c0a82f$ab2b3a00$1f4181ce@rrauto.com> Lately I've been using ActiveState's perlapp, which ships with the Perl Development Kit (PDK) 2.0 for you-should-pardon-the-expression Win32. It's not actually a compiler, but for Win32 it does a similar function in that it packages up your Perl app in an executable so you can deliver it to others without them having to install Perl on their machine. Why anyone would NOT want to install Perl on their machine is beyond me, but I've heard there are people who don't even have a computer, much less Perl, so I just sort of shrug my shoulders and assume it takes all kinds. An-nee-way . . . perlapp works quite well but has three minor drawbacks I've encountered so far: 1. It requires Windows NT to create apps (but once they're created they should run on any flavor of Win32). Presumably 2000 will work as well. Some will argue that the fact that it requires any form of Windows is a major drawback, but hey. 2. It costs $120, but for that you also get some other neat stuff like a visual debugger, a COM object that exposes a Perl interpreter (so you can run Perl apps inside of VB/VC/Delphi/VBScript/anyothercontainerthatunderstandsCOMobjects), and extensions that will turn your Perl app into a Win32 service or an ActiveX DLL, if that happens to be your particular kinky inclination, not of course that there's anything wrong with that. (If you spend lots of time on Windows I actually think the $120 is quite a bargain, especially if your company will pay for it.) 3. Occasionally it's not exactly forthright about what needs to go into a standalone application. Consider this little script: #!/usr/bin/perl use LWP::UserAgent; $ua = new LWP::UserAgent; $ua->timeout(20); $rq = new HTTP::Request("GET","http://www.slashdot.org"); # So what if resistance is futile? $rc = $ua->request($rq); print "Slashdot is up!\n" if ($rc->code =~ /^2/); If you run this program at a command prompt you will (assuming Slashdot IS up) see the response, "Slashdot is up." However, if you create a perlapp from this program with the command perlapp -f -c script.pl and run it, you get this error or something like it: Can't locate URI/_foreign.pm in @INC (@INC contains: C:\TEMP\35300000\ .) at URI.pm line 54. Huh? Where'd URI/_foreign.pm come from? It turns out it's called by HTTP::Request, which is called by LWP::UserAgent. About an hour of digging and I finally got the program to run by adding in three modules by hand: perlapp -f -c -add=URI::_foreign;LWP::Protocol::http;URI::http script.pl Just dropping them into a use line in the script didn't work -- the "-add" line has to be there. I know this is slightly off the topic of compiling Perl but I thought I'd mention it since it serves a similar purpose and I can actually get it to work. Cheers, -- Creede Creede Lambard | Never rush a miracle man. Senior Developer | You get rotten miracles. Reynolds & Reynolds | creede@rrauto.com | - Miracle Max, | The Princess Bride - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From daryn at marinated.org Thu Mar 8 18:35:58 2001 From: daryn at marinated.org (Daryn Nakhuda) Date: Wed Aug 4 00:07:54 2004 Subject: SPUG: Re: Re: Perl Compiler. In-Reply-To: Message-ID: Hi, Please communicate the details online... I'm sure more of us than just John would like to know. -d On Thu, 8 Mar 2001, Andrew Crum wrote: > Yes. (fyi - details communicated offline). > > >From: "John Cokos, CEO, iWeb, Inc." > >To: "Andrew Crum" , > >Subject: SPUG: Re: Re: Perl Compiler. > >Date: Thu, 8 Mar 2001 15:29:28 -0800 > > > >The last time I tried that program, it wouldn't support > >any external .pm files (either those from CPAN or those > >that I'd written) at all. Only the stuff that he shipped > >with it. I gave up on it: without DBI or DBD, it's useless. > > > >Can I assume that it's changed since then? > > > >John > > > >======================================== > > John Cokos, President / CEO: iWeb Inc. > > http://www.iwebsys.com > > jcokos@ccs.net > >======================================== > >----- Original Message ----- > >From: "Andrew Crum" > >To: > >Sent: Thursday, March 08, 2001 2:57 PM > >Subject: SPUG: Re: Perl Compiler. > > > > > > > I use IndigoStar's Perl2exe product to compile perl on Win32, Linux and > > > Solaris. I install needed CPAN modules directly into the perl2exe tree > >as > > > well as use $PERL5LIB to point the way to my modules. Questions? > > > > > > > > > >From: Dean Hudson > > > >To: John Cokos > > > >CC: spug-list@pm.org > > > >Subject: SPUG: Re: Perl Compiler. > > > >Date: Thu, 8 Mar 2001 12:28:04 -0800 > > > > > > > >On Fri, Mar 02, 2001 at 07:18:07PM -0800, John Cokos wrote: > > > > > Has anyone messed around with the compiler yet? > > > > > > > >I started once, then decided that C was easier; you can embed a perl > > > >interpreter into your C code with relatively little pain. No CPAN, > > > >though. > > > > > > > >dean. > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > >- - > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your > >Email-address > > > > For daily traffic, use spug-list for LIST ; for weekly, > >spug-list-digest > > > > Seattle Perl Users Group (SPUG) Home Page: > >http://www.halcyon.com/spug/ > > > > > > > > > > > > > > _________________________________________________________________ > > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > >- > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your > >Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, > >spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: > >http://www.halcyon.com/spug/ > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From akcrum at hotmail.com Thu Mar 8 20:35:29 2001 From: akcrum at hotmail.com (Andrew Crum) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Re: Perl Compiler. Message-ID: Glad to. Didn't mean to hold out. I have had luck using Perl2exe (www.indigostar.com). Use it on a regular basis at work. Like perlapp, it's not really compiling perl, but does build a binary that both hides your source code and doesn't require a customer's machine to have perl resources. I use it to build binaries for Linux and Solaris. My colleagues use it for Win32 builds. It works for other flavors of UNIX as well. It's even supposed to be possible to use Perl2exe to build a UNIX binary on a Win32 platform, but I haven't done much with that. John Cokos had asked if it worked with DBI.pm, etc, and I can say it does indeed. I've installed many CPAN modules referenced by my code, including the modules he mentioned. One thing I had to discover was that, when preparing to install a new module that would then be used with Perl2exe, my $PATH had to be modified to point to Perl2exe's copy of bin/perl instead of locating the standard bin/perl. With that resolved, building a new executable worked smoothly: PATH=~perl2exe_top:~perl2exe_top/perl5/bin:${PATH} PERL5LIB= perl2exe -w You can download a trial version of Perl2exe but will get a nag message when running your executable until you pay for a registration code. - Andrew Crum >From: Daryn Nakhuda >To: Andrew Crum >CC: spug-list@pm.org >Subject: Re: SPUG: Re: Re: Perl Compiler. >Date: Thu, 8 Mar 2001 16:35:58 -0800 (PST) > > >Hi, Please communicate the details online... I'm sure more of us than just >John would like to know. > >-d > > >On Thu, 8 Mar 2001, Andrew Crum wrote: > > > Yes. (fyi - details communicated offline). > > > > >From: "John Cokos, CEO, iWeb, Inc." > > >To: "Andrew Crum" , > > >Subject: SPUG: Re: Re: Perl Compiler. > > >Date: Thu, 8 Mar 2001 15:29:28 -0800 > > > > > >The last time I tried that program, it wouldn't support > > >any external .pm files (either those from CPAN or those > > >that I'd written) at all. Only the stuff that he shipped > > >with it. I gave up on it: without DBI or DBD, it's useless. > > > > > >Can I assume that it's changed since then? > > > > > >John > > > > > >======================================== > > > John Cokos, President / CEO: iWeb Inc. > > > http://www.iwebsys.com > > > jcokos@ccs.net > > >======================================== > > >----- Original Message ----- > > >From: "Andrew Crum" > > >To: > > >Sent: Thursday, March 08, 2001 2:57 PM > > >Subject: SPUG: Re: Perl Compiler. > > > > > > > > > > I use IndigoStar's Perl2exe product to compile perl on Win32, Linux >and > > > > Solaris. I install needed CPAN modules directly into the perl2exe >tree > > >as > > > > well as use $PERL5LIB to point the way to my modules. Questions? > > > > > > > > > > > > >From: Dean Hudson > > > > >To: John Cokos > > > > >CC: spug-list@pm.org > > > > >Subject: SPUG: Re: Perl Compiler. > > > > >Date: Thu, 8 Mar 2001 12:28:04 -0800 > > > > > > > > > >On Fri, Mar 02, 2001 at 07:18:07PM -0800, John Cokos wrote: > > > > > > Has anyone messed around with the compiler yet? > > > > > > > > > >I started once, then decided that C was easier; you can embed a >perl > > > > >interpreter into your C code with relatively little pain. No CPAN, > > > > >though. > > > > > > > > > >dean. > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - > > >- - > > > > > POST TO: spug-list@pm.org PROBLEMS: >owner-spug-list@pm.org > > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST >EMAIL > > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your > > >Email-address > > > > > For daily traffic, use spug-list for LIST ; for weekly, > > >spug-list-digest > > > > > Seattle Perl Users Group (SPUG) Home Page: > > >http://www.halcyon.com/spug/ > > > > > > > > > > > > > > > > > > _________________________________________________________________ > > > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - > > >- > > > > POST TO: spug-list@pm.org PROBLEMS: >owner-spug-list@pm.org > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your > > >Email-address > > > > For daily traffic, use spug-list for LIST ; for weekly, > > >spug-list-digest > > > > Seattle Perl Users Group (SPUG) Home Page: > > >http://www.halcyon.com/spug/ > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your >Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, >spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: >http://www.halcyon.com/spug/ > > > > > > > > > > _________________________________________________________________ > > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >- > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your >Email-address > > For daily traffic, use spug-list for LIST ; for weekly, >spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: >http://www.halcyon.com/spug/ > > > > > >-- > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Fri Mar 9 10:57:42 2001 From: jcokos at iwebsys.com (John Cokos, CEO, iWeb, Inc.) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Re: Re: Perl Compiler. References: <018401c0a827$b314a740$0500a8c0@iwebx1> <009501c0a82f$ab2b3a00$1f4181ce@rrauto.com> Message-ID: <008201c0a8ba$22b7d3f0$0500a8c0@iwebx1> Our need for compiled code comes from our desire to accomplish 2 specific tasks, not to handle machines without perl: It's important to note that this is for CGI Programs (web apps) and that 99% of the intended audience are on a unix system. 1. Speed. I have a feeling that loading a pre-compiled shared object will be a hell of a lot faster than going through the normal load/compile/execute cycle. 2. Code Security. As a commercial CGI Shop, we're quite interested in making the code, and our programs somewhat safe. We estimate that there are at least as many unlicensed (stolen) copies of the program out there right now, and another 2 or 3 guys are in the process of reverse engineering the existing source to begin selling pirated copies on their own. There's no way to stop or control this in the perl world, UNLESS you can find a way to compile it down to machine code, and put some hooks in there to disable the program unless it's properly licensed. This isn't foolproof, but it should knock out most of the idiots. That's the rationale behind my needs for the compiler. I need to do some digging into the B:: stuff, I suppose. John ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== ----- Original Message ----- From: "Creede Lambard" To: Sent: Thursday, March 08, 2001 4:27 PM Subject: SPUG: Re: Perl Compiler. > Lately I've been using ActiveState's perlapp, which ships with the Perl > Development Kit (PDK) 2.0 for you-should-pardon-the-expression Win32. It's > not actually a compiler, but for Win32 it does a similar function in that it > packages up your Perl app in an executable so you can deliver it to others > without them having to install Perl on their machine. Why anyone would NOT > want to install Perl on their machine is beyond me, but I've heard there are > people who don't even have a computer, much less Perl, so I just sort of > shrug my shoulders and assume it takes all kinds. > > An-nee-way . . . > > perlapp works quite well but has three minor drawbacks I've encountered so > far: > > 1. It requires Windows NT to create apps (but once they're created they > should run on any flavor of Win32). Presumably 2000 will work as well. Some > will argue that the fact that it requires any form of Windows is a major > drawback, but hey. > > 2. It costs $120, but for that you also get some other neat stuff like a > visual debugger, a COM object that exposes a Perl interpreter (so you can > run Perl apps inside of > VB/VC/Delphi/VBScript/anyothercontainerthatunderstandsCOMobjects), and > extensions that will turn your Perl app into a Win32 service or an ActiveX > DLL, if that happens to be your particular kinky inclination, not of course > that there's anything wrong with that. (If you spend lots of time on Windows > I actually think the $120 is quite a bargain, especially if your company > will pay for it.) > > 3. Occasionally it's not exactly forthright about what needs to go into a > standalone application. Consider this little script: > > #!/usr/bin/perl > > use LWP::UserAgent; > $ua = new LWP::UserAgent; > $ua->timeout(20); > > $rq = new HTTP::Request("GET","http://www.slashdot.org"); # So what if > resistance is futile? > $rc = $ua->request($rq); > print "Slashdot is up!\n" if ($rc->code =~ /^2/); > > If you run this program at a command prompt you will (assuming Slashdot IS > up) see the response, "Slashdot is up." However, if you create a perlapp > from this program with the command > > perlapp -f -c script.pl > > and run it, you get this error or something like it: > > Can't locate URI/_foreign.pm in @INC (@INC contains: C:\TEMP\35300000\ > .) at URI.pm line 54. > > Huh? Where'd URI/_foreign.pm come from? It turns out it's called by > HTTP::Request, which is called by LWP::UserAgent. About an hour of digging > and I finally got the program to run by adding in three modules by hand: > > perlapp -f -c -add=URI::_foreign;LWP::Protocol::http;URI::http script.pl > > Just dropping them into a use line in the script didn't work -- the "-add" > line has to be there. > > I know this is slightly off the topic of compiling Perl but I thought I'd > mention it since it serves a similar purpose and I can actually get it to > work. > > Cheers, > -- Creede > > Creede Lambard | Never rush a miracle man. > Senior Developer | You get rotten miracles. > Reynolds & Reynolds | > creede@rrauto.com | - Miracle Max, > | The Princess Bride > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Fri Mar 9 18:53:06 2001 From: jcokos at iwebsys.com (John Cokos, CEO, iWeb, Inc.) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join Message-ID: <038101c0a8fc$893d8830$0500a8c0@iwebx1> I've been knocking my head agains the wall all day on this stupid little problem ... somebody please bail me out. Assume a string like this. my $results = "12345:15,32984732:25,733263:12,349874:5"; I want to place it into a hash, keyed by the first number, valued by the second one. That's not a problem. my %ids = (); %ids = map { split(/\:/) } split(/\,/,$results); Now, I need to add (or delete) some of these keys. delete $ids{12345}; $ids{5555} = 12; Again, no problem, that works. The pickle, is getting this updated hash back into the comma separated format that it started with. Totally lost here. This just flattens it. print join(",", %ids); This works, but it's hideous (gotta be a smoother way). I can see this being a pretty intense maneuver on a large set: my %set = (); my @array; foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } print join(",", @array); Note, that in real life, that string ($results, above) may have upwards of 100,000 comma separated values, so something efficient is pretty important. Appreciate your advice, everyone. John ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cmeyer at helvella.org Fri Mar 9 19:38:17 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <038101c0a8fc$893d8830$0500a8c0@iwebx1> References: <038101c0a8fc$893d8830$0500a8c0@iwebx1> Message-ID: <20010309173817.N22109@hobart.helvella.org> On Fri, Mar 09, 2001 at 04:53:06PM -0800, John Cokos, CEO, iWeb, Inc. wrote: > I've been knocking my head agains the wall all day > on this stupid little problem ... somebody please > bail me out. > > Assume a string like this. > my $results = "12345:15,32984732:25,733263:12,349874:5"; > > I want to place it into a hash, keyed by the first number, > valued by the second one. That's not a problem. > my %ids = (); > %ids = map { split(/\:/) } split(/\,/,$results); > > Now, I need to add (or delete) some of these keys. > delete $ids{12345}; > $ids{5555} = 12; > > Again, no problem, that works. > > The pickle, is getting this updated hash back into the comma > separated format that it started with. Totally lost here. > > This just flattens it. > print join(",", %ids); > > This works, but it's hideous (gotta be a smoother way). I can > see this being a pretty intense maneuver on a large set: > my %set = (); > my @array; > foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } > print join(",", @array); > How about: $r = join ',', map "$_:$ids{$_}", keys %ids; -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Alex.Leites at esca.com Fri Mar 9 19:20:30 2001 From: Alex.Leites at esca.com (Alex Leites) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: Message-ID: <005501c0a900$4c016d70$200516ac@esca.com> What's wrong with: join ',', map( "$_:$ids{$_}", keys %ids Do you care about the order? Alex -----Original Message----- From: John Cokos, CEO, iWeb, Inc. [mailto:jcokos@iwebsys.com] Sent: Friday, March 09, 2001 5:11 PM To: spug-list@pm.org Subject: SPUG: hashes, arrays, map, join I've been knocking my head agains the wall all day on this stupid little problem ... somebody please bail me out. Assume a string like this. my $results = "12345:15,32984732:25,733263:12,349874:5"; I want to place it into a hash, keyed by the first number, valued by the second one. That's not a problem. my %ids = (); %ids = map { split(/\:/) } split(/\,/,$results); Now, I need to add (or delete) some of these keys. delete $ids{12345}; $ids{5555} = 12; Again, no problem, that works. The pickle, is getting this updated hash back into the comma separated format that it started with. Totally lost here. This just flattens it. print join(",", %ids); This works, but it's hideous (gotta be a smoother way). I can see this being a pretty intense maneuver on a large set: my %set = (); my @array; foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } print join(",", @array); Note, that in real life, that string ($results, above) may have upwards of 100,000 comma separated values, so something efficient is pretty important. Appreciate your advice, everyone. John ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Alex.Leites at esca.com Fri Mar 9 19:21:53 2001 From: Alex.Leites at esca.com (Alex Leites) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join Message-ID: <005601c0a900$7d9eb0e0$200516ac@esca.com> Sorry, should have been: join ',', map "$_:$ids{$_}", keys %ids Alex -----Original Message----- From: Alex Leites [mailto:Alex.Leites@esca.com] Sent: Friday, March 09, 2001 5:21 PM To: John Cokos, CEO, iWeb, Inc.; spug-list@pm.org Subject: RE: SPUG: hashes, arrays, map, join What's wrong with: join ',', map( "$_:$ids{$_}", keys %ids Do you care about the order? Alex -----Original Message----- From: John Cokos, CEO, iWeb, Inc. [mailto:jcokos@iwebsys.com] Sent: Friday, March 09, 2001 5:11 PM To: spug-list@pm.org Subject: SPUG: hashes, arrays, map, join I've been knocking my head agains the wall all day on this stupid little problem ... somebody please bail me out. Assume a string like this. my $results = "12345:15,32984732:25,733263:12,349874:5"; I want to place it into a hash, keyed by the first number, valued by the second one. That's not a problem. my %ids = (); %ids = map { split(/\:/) } split(/\,/,$results); Now, I need to add (or delete) some of these keys. delete $ids{12345}; $ids{5555} = 12; Again, no problem, that works. The pickle, is getting this updated hash back into the comma separated format that it started with. Totally lost here. This just flattens it. print join(",", %ids); This works, but it's hideous (gotta be a smoother way). I can see this being a pretty intense maneuver on a large set: my %set = (); my @array; foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } print join(",", @array); Note, that in real life, that string ($results, above) may have upwards of 100,000 comma separated values, so something efficient is pretty important. Appreciate your advice, everyone. John ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dleonard at dleonard.net Fri Mar 9 12:24:15 2001 From: dleonard at dleonard.net (Douglas Leonard) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <038101c0a8fc$893d8830$0500a8c0@iwebx1> Message-ID: print join ",", map {"$_:$ids{$_}"} keys %ids; -- On Fri, 9 Mar 2001, John Cokos, CEO, iWeb, Inc. wrote: > I've been knocking my head agains the wall all day > on this stupid little problem ... somebody please > bail me out. > > Assume a string like this. > my $results = "12345:15,32984732:25,733263:12,349874:5"; > > I want to place it into a hash, keyed by the first number, > valued by the second one. That's not a problem. > my %ids = (); > %ids = map { split(/\:/) } split(/\,/,$results); > > Now, I need to add (or delete) some of these keys. > delete $ids{12345}; > $ids{5555} = 12; > > Again, no problem, that works. > > The pickle, is getting this updated hash back into the comma > separated format that it started with. Totally lost here. > > This just flattens it. > print join(",", %ids); > > This works, but it's hideous (gotta be a smoother way). I can > see this being a pretty intense maneuver on a large set: > my %set = (); > my @array; > foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } > print join(",", @array); > > > Note, that in real life, that string ($results, above) may have upwards > of 100,000 comma separated values, so something efficient is pretty > important. > > Appreciate your advice, everyone. > > John > > > ======================================== > John Cokos, President / CEO: iWeb Inc. > http://www.iwebsys.com > jcokos@ccs.net > ======================================== > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Alex.Leites at esca.com Fri Mar 9 19:31:24 2001 From: Alex.Leites at esca.com (Alex Leites) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: Message-ID: <005701c0a901$d1f37a30$200516ac@esca.com> One more thing: %ids = split /[,:]/, $results; is probably more efficient. Alex -----Original Message----- From: John Cokos, CEO, iWeb, Inc. [mailto:jcokos@iwebsys.com] Sent: Friday, March 09, 2001 5:11 PM To: spug-list@pm.org Subject: SPUG: hashes, arrays, map, join I've been knocking my head agains the wall all day on this stupid little problem ... somebody please bail me out. Assume a string like this. my $results = "12345:15,32984732:25,733263:12,349874:5"; I want to place it into a hash, keyed by the first number, valued by the second one. That's not a problem. my %ids = (); %ids = map { split(/\:/) } split(/\,/,$results); Now, I need to add (or delete) some of these keys. delete $ids{12345}; $ids{5555} = 12; Again, no problem, that works. The pickle, is getting this updated hash back into the comma separated format that it started with. Totally lost here. This just flattens it. print join(",", %ids); This works, but it's hideous (gotta be a smoother way). I can see this being a pretty intense maneuver on a large set: my %set = (); my @array; foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } print join(",", @array); Note, that in real life, that string ($results, above) may have upwards of 100,000 comma separated values, so something efficient is pretty important. Appreciate your advice, everyone. John ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Fri Mar 9 19:33:44 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <038101c0a8fc$893d8830$0500a8c0@iwebx1>; from jcokos@iwebsys.com on Fri, Mar 09, 2001 at 04:53:06PM -0800 References: <038101c0a8fc$893d8830$0500a8c0@iwebx1> Message-ID: <20010309173344.A10323@ero.com> Not sure of whether not it's the fastest way to go but: join (',', map {"$_:$ids{$_}"} keys %ids); should work. dean. On Fri, Mar 09, 2001 at 04:53:06PM -0800, John Cokos, CEO, iWeb, Inc. wrote: > I've been knocking my head agains the wall all day > on this stupid little problem ... somebody please > bail me out. > > Assume a string like this. > my $results = "12345:15,32984732:25,733263:12,349874:5"; > > I want to place it into a hash, keyed by the first number, > valued by the second one. That's not a problem. > my %ids = (); > %ids = map { split(/\:/) } split(/\,/,$results); > > Now, I need to add (or delete) some of these keys. > delete $ids{12345}; > $ids{5555} = 12; > > Again, no problem, that works. > > The pickle, is getting this updated hash back into the comma > separated format that it started with. Totally lost here. > > This just flattens it. > print join(",", %ids); > > This works, but it's hideous (gotta be a smoother way). I can > see this being a pretty intense maneuver on a large set: > my %set = (); > my @array; > foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } > print join(",", @array); > > > Note, that in real life, that string ($results, above) may have upwards > of 100,000 comma separated values, so something efficient is pretty > important. > > Appreciate your advice, everyone. > > John > > > ======================================== > John Cokos, President / CEO: iWeb Inc. > http://www.iwebsys.com > jcokos@ccs.net > ======================================== > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From andy at n2h2.com Fri Mar 9 19:38:19 2001 From: andy at n2h2.com (Andrew Sweger) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <005701c0a901$d1f37a30$200516ac@esca.com> Message-ID: %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; is more evil. :) On Mar 9, 2001 @ 5:31pm, Alex Leites wrote: > One more thing: > > %ids = split /[,:]/, $results; > > is probably more efficient. -- Andrew B. Sweger | N2H2, Incorporated Manager, ICE Development Dept | 900 Fourth Avenue, Suite 3400 Content Management Division | Seattle WA 98164-1059 v=206.336.2947 f=206.493.0906 | http://www.n2h2.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jimfl at colltech.com Fri Mar 9 20:40:19 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: Message-ID: on 3/9/01 5:38 PM, Andrew Sweger at andy@n2h2.com wrote: > %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; > > is more evil. :) Evil is a very important factor in program design at the tactical level. -- Jim Flanagan Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ced at carios2.ca.boeing.com Fri Mar 9 21:17:58 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join Message-ID: <200103100317.TAA08372@carios2.ca.boeing.com> > Not sure of whether not it's the fastest way to go but: > join (',', map {"$_:$ids{$_}"} keys %ids); > should work. Can't resist the pull of speed :) my $r = join "," => %ids; You can just use the hash in list context for re-assembly. This is faster than anything I've found yet. Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ced at carios2.ca.boeing.com Fri Mar 9 21:23:34 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join Message-ID: <200103100323.TAA08384@carios2.ca.boeing.com> > Can't resist the pull of speed :) > my $r = join "," => %ids; > You can just use the hash in list context for re-assembly. > This is faster than anything I've found yet. Wrong. I should re-read before posting.... Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Fri Mar 9 23:07:19 2001 From: jcokos at iwebsys.com (John Cokos) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join References: Message-ID: <008a01c0a91f$fcda0200$61affea9@ccokos> To summarize ..... It seems that these are the options presented by you all: Alternatives to the use of map in populating the has to start with: %ids = split /[,:]/, $results; %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; To recreate the hash afterwards: These appear the same, but just for grins, I'll try them separately. join (',', map {"$_:$ids{$_}"} keys %ids); join ',', map "$_:$ids{$_}", keys %ids; ** Thanks for these ... this was the focus of my mental block to day Looking at it here, I can't believe I didn't "get it" earlier, I tried,literally every combination of things but THIS one ** Anyway, I'm loading the DMOZ Data right now, into mySQL, so I'll have a good 30 to 40 million indexed words to monkey with. I'll report back some time trials on each of these methods. John ----- Original Message ----- From: Andrew Sweger To: Alex Leites Cc: John Cokos, CEO, iWeb, Inc. ; Sent: Friday, March 09, 2001 5:38 PM Subject: RE: SPUG: hashes, arrays, map, join > %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; > > is more evil. :) > > On Mar 9, 2001 @ 5:31pm, Alex Leites wrote: > > > One more thing: > > > > %ids = split /[,:]/, $results; > > > > is probably more efficient. > > -- > Andrew B. Sweger | N2H2, Incorporated > Manager, ICE Development Dept | 900 Fourth Avenue, Suite 3400 > Content Management Division | Seattle WA 98164-1059 > v=206.336.2947 f=206.493.0906 | http://www.n2h2.com/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Sat Mar 10 00:44:10 2001 From: jcokos at iwebsys.com (John Cokos) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join References: <008a01c0a91f$fcda0200$61affea9@ccokos> Message-ID: <000801c0a92d$9570e440$61affea9@ccokos> And the winner is .... (the numbers in front, are timestamps....) 984205861: Starting Program 984205861: Starting Test 1, reading 32,000+ rows from mySQL, Query 984205872: Query Finished, Building Sorted Array from query results 984205873: Done ... 1151 sorted, and ready Array Element 0: 0 Array Element 1: 892745342 Array Element 2: 892843995 Array Element 3: 893066815 Array Element 4: 893066933 Array Element 5: 893075888 Array Element 6: 893090421 Array Element 7: 893092009 Array Element 8: 893094274 Array Element 9: 893097182 Array Element 10: 893101655 984205930: Starting Program 984205930: Starting Test 2, Converting 32,000 key comma list into hash via: %ids = map { split(/:/) } split(/,/,$string); 984205983: Done ... 1151 sorted, and ready Array Element 0: 0 Array Element 1: 892745342 Array Element 2: 892843995 Array Element 3: 893066815 Array Element 4: 893066933 Array Element 5: 893075888 Array Element 6: 893090421 Array Element 7: 893092009 Array Element 8: 893094274 Array Element 9: 893097182 Array Element 10: 893101655 984206039: Starting Program 984206039: Starting Test 3, Converting 32,000 key comma list into hash via: %ids = split /[,:]/, $string; 984206046: Done ... 1151 sorted, and ready Array Element 0: 0 Array Element 1: 892745342 Array Element 2: 892843995 Array Element 3: 893066815 Array Element 4: 893066933 Array Element 5: 893075888 Array Element 6: 893090421 Array Element 7: 893092009 Array Element 8: 893094274 Array Element 9: 893097182 Array Element 10: 893101655 984206168: Starting Program 984206168: Starting Test 4, Converting 32,000 key comma list into hash via: %ids = $string =~ /(?:^|,)(d+):(d+)(?=,|$)/g; 984206177: Done ... 1151 sorted, and ready Array Element 0: 0 Array Element 1: 892745342 Array Element 2: 892843995 Array Element 3: 893066815 Array Element 4: 893066933 Array Element 5: 893075888 Array Element 6: 893090421 Array Element 7: 893092009 Array Element 8: 893094274 Array Element 9: 893097182 Array Element 10: 893101655 Using SQL as a benchmark, I tested the alternative methods, you can see the timing results above (geez, "map" is slow, isn't it ???) Looks like I can get a sorted array faster WITHOUT mySQL, too. John ----- Original Message ----- From: John Cokos To: Cc: Sent: Friday, March 09, 2001 9:07 PM Subject: Re: SPUG: hashes, arrays, map, join > To summarize ..... > > It seems that these are the options presented by you all: > > Alternatives to the use of map in populating the has to start with: > %ids = split /[,:]/, $results; > %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; > > To recreate the hash afterwards: > These appear the same, but just for grins, I'll try them separately. > join (',', map {"$_:$ids{$_}"} keys %ids); > join ',', map "$_:$ids{$_}", keys %ids; > > ** Thanks for these ... this was the focus of my mental block to day > Looking at it here, I can't believe I didn't "get it" earlier, I > tried,literally > every combination of things but THIS one ** > > > Anyway, I'm loading the DMOZ Data right now, into mySQL, so I'll have > a good 30 to 40 million indexed words to monkey with. I'll report back > some time trials on each of these methods. > > John > > > > ----- Original Message ----- > From: Andrew Sweger > To: Alex Leites > Cc: John Cokos, CEO, iWeb, Inc. ; > Sent: Friday, March 09, 2001 5:38 PM > Subject: RE: SPUG: hashes, arrays, map, join > > > > %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; > > > > is more evil. :) > > > > On Mar 9, 2001 @ 5:31pm, Alex Leites wrote: > > > > > One more thing: > > > > > > %ids = split /[,:]/, $results; > > > > > > is probably more efficient. > > > > -- > > Andrew B. Sweger | N2H2, Incorporated > > Manager, ICE Development Dept | 900 Fourth Avenue, Suite 3400 > > Content Management Division | Seattle WA 98164-1059 > > v=206.336.2947 f=206.493.0906 | http://www.n2h2.com/ > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Sat Mar 10 00:47:13 2001 From: jcokos at iwebsys.com (John Cokos) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join References: <008a01c0a91f$fcda0200$61affea9@ccokos> <000801c0a92d$9570e440$61affea9@ccokos> Message-ID: <001001c0a92d$f1555de0$61affea9@ccokos> Quick Aside .... I ran this on a JUNK machine: Win98, 64MB Ram, P500 On an actual linux server with some horsepower, these numbers will actually become reasonable. J- ----- Original Message ----- From: John Cokos To: John Cokos ; Sent: Friday, March 09, 2001 10:44 PM Subject: Re: SPUG: hashes, arrays, map, join > And the winner is .... > (the numbers in front, are timestamps....) > > 984205861: Starting Program > 984205861: Starting Test 1, reading 32,000+ rows from mySQL, Query > 984205872: Query Finished, Building Sorted Array from query results > 984205873: Done ... 1151 sorted, and ready > Array Element 0: 0 > Array Element 1: 892745342 > Array Element 2: 892843995 > Array Element 3: 893066815 > Array Element 4: 893066933 > Array Element 5: 893075888 > Array Element 6: 893090421 > Array Element 7: 893092009 > Array Element 8: 893094274 > Array Element 9: 893097182 > Array Element 10: 893101655 > > > 984205930: Starting Program > 984205930: Starting Test 2, Converting 32,000 key comma list into hash via: %ids = map { split(/:/) } split(/,/,$string); > 984205983: Done ... 1151 sorted, and ready > > Array Element 0: 0 > Array Element 1: 892745342 > Array Element 2: 892843995 > Array Element 3: 893066815 > Array Element 4: 893066933 > Array Element 5: 893075888 > Array Element 6: 893090421 > Array Element 7: 893092009 > Array Element 8: 893094274 > Array Element 9: 893097182 > Array Element 10: 893101655 > > > 984206039: Starting Program > 984206039: Starting Test 3, Converting 32,000 key comma list into hash via: %ids = split /[,:]/, $string; > 984206046: Done ... 1151 sorted, and ready > > Array Element 0: 0 > Array Element 1: 892745342 > Array Element 2: 892843995 > Array Element 3: 893066815 > Array Element 4: 893066933 > Array Element 5: 893075888 > Array Element 6: 893090421 > Array Element 7: 893092009 > Array Element 8: 893094274 > Array Element 9: 893097182 > Array Element 10: 893101655 > > > 984206168: Starting Program > 984206168: Starting Test 4, Converting 32,000 key comma list into hash via: %ids = $string =~ /(?:^|,)(d+):(d+)(?=,|$)/g; > 984206177: Done ... 1151 sorted, and ready > > Array Element 0: 0 > Array Element 1: 892745342 > Array Element 2: 892843995 > Array Element 3: 893066815 > Array Element 4: 893066933 > Array Element 5: 893075888 > Array Element 6: 893090421 > Array Element 7: 893092009 > Array Element 8: 893094274 > Array Element 9: 893097182 > Array Element 10: 893101655 > > > Using SQL as a benchmark, I tested the alternative methods, you > can see the timing results above (geez, "map" is slow, isn't it ???) > > Looks like I can get a sorted array faster WITHOUT mySQL, too. > > John > > > ----- Original Message ----- > From: John Cokos > To: > Cc: > Sent: Friday, March 09, 2001 9:07 PM > Subject: Re: SPUG: hashes, arrays, map, join > > > > To summarize ..... > > > > It seems that these are the options presented by you all: > > > > Alternatives to the use of map in populating the has to start with: > > %ids = split /[,:]/, $results; > > %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; > > > > To recreate the hash afterwards: > > These appear the same, but just for grins, I'll try them separately. > > join (',', map {"$_:$ids{$_}"} keys %ids); > > join ',', map "$_:$ids{$_}", keys %ids; > > > > ** Thanks for these ... this was the focus of my mental block to day > > Looking at it here, I can't believe I didn't "get it" earlier, I > > tried,literally > > every combination of things but THIS one ** > > > > > > Anyway, I'm loading the DMOZ Data right now, into mySQL, so I'll have > > a good 30 to 40 million indexed words to monkey with. I'll report back > > some time trials on each of these methods. > > > > John > > > > > > > > ----- Original Message ----- > > From: Andrew Sweger > > To: Alex Leites > > Cc: John Cokos, CEO, iWeb, Inc. ; > > Sent: Friday, March 09, 2001 5:38 PM > > Subject: RE: SPUG: hashes, arrays, map, join > > > > > > > %ids = $results =~ /(?:^|,)(\d+):(\d+)(?=,|$)/g; > > > > > > is more evil. :) > > > > > > On Mar 9, 2001 @ 5:31pm, Alex Leites wrote: > > > > > > > One more thing: > > > > > > > > %ids = split /[,:]/, $results; > > > > > > > > is probably more efficient. > > > > > > -- > > > Andrew B. Sweger | N2H2, Incorporated > > > Manager, ICE Development Dept | 900 Fourth Avenue, Suite 3400 > > > Content Management Division | Seattle WA 98164-1059 > > > v=206.336.2947 f=206.493.0906 | http://www.n2h2.com/ > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From biotechstox93 at juno.com Sat Mar 10 09:02:52 2001 From: biotechstox93 at juno.com (biotechstox93@juno.com) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: FREE Biotech Stock Info! 437 Message-ID: <841.281436.738852@juno.com> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20010310/9b3958f6/attachment.htm From billa at willapabay.org Mon Mar 12 15:11:35 2001 From: billa at willapabay.org (Bill Alford) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <005501c0a900$4c016d70$200516ac@esca.com> Message-ID: I forget where I saw this, but if you are going over a large map, using a loop and each() is fastest and/or most efficient technique. You don't have to make a temporary array with every key and you don't have all the lookups. while (($key, $value) = each(%ids)) { $string .= "$key:$value,"; } $string =~ s/,$//; Bill On Fri, 9 Mar 2001, Alex Leites wrote: > What's wrong with: > > join ',', map( "$_:$ids{$_}", keys %ids > > Do you care about the order? > > Alex > > -----Original Message----- > From: John Cokos, CEO, iWeb, Inc. [mailto:jcokos@iwebsys.com] > Sent: Friday, March 09, 2001 5:11 PM > To: spug-list@pm.org > Subject: SPUG: hashes, arrays, map, join > > > > > I've been knocking my head agains the wall all day > on this stupid little problem ... somebody please > bail me out. > > Assume a string like this. > my $results = "12345:15,32984732:25,733263:12,349874:5"; > > I want to place it into a hash, keyed by the first number, > valued by the second one. That's not a problem. > my %ids = (); > %ids = map { split(/\:/) } split(/\,/,$results); > > Now, I need to add (or delete) some of these keys. > delete $ids{12345}; > $ids{5555} = 12; > > Again, no problem, that works. > > The pickle, is getting this updated hash back into the comma > separated format that it started with. Totally lost here. > > This just flattens it. > print join(",", %ids); > > This works, but it's hideous (gotta be a smoother way). I can > see this being a pretty intense maneuver on a large set: > my %set = (); > my @array; > foreach my $key ( keys %ids) { push @array, "$key:$ids{$key}"; } > print join(",", @array); > > > Note, that in real life, that string ($results, above) may have upwards > of 100,000 comma separated values, so something efficient is pretty > important. > > Appreciate your advice, everyone. > > John > > > ======================================== > John Cokos, President / CEO: iWeb Inc. > http://www.iwebsys.com > jcokos@ccs.net > ======================================== > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Mon Mar 12 18:40:32 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: JoB with REI Message-ID: <20010312164032.A24728@timji.consultix.wa.com> Greetings, I am leaving eREI (the online division of Recreational Equipment Incorporated) for a new and very promising position. In doing so, I have been authorized to look for my replacement. If anyone is looking to become a developer at one of the few profitable "e" companies, please mail me your resume at rwolber@rei.com. This is a permanent, salaried position physically located in Kent Washington. We build and maintain www.rei.com, www.rei-outlet.com and www.rei.co.jp. As far as I know, telecommuting is not an option for this position. Qualifications are as follows: Some Java experience. They are re-architecting and many (but not all) of the projects are moving from Perl to Java. Since all of the other developers are pretty much on the same level when it comes to Java, there will be some decent opportunities for training. Perl experience. At least 2-3 years of solid devlopment experience. Experience should include OO, CGI and database programming as well as experience with standard configuration management methodologies. That's pretty much it. As far as where this job fits into the big picture of eREI, the position is in an area called "Marketing Systems". Our main "customer" is the analytics group. We write the tools and make the data available and they do whatever analysis is necessary to answer the business questions the suits are asking. My main projects right now are the online Data Warehouse and Bargain Sleuth (You can check out Bargain Sleuth at http://rei-outlet.com/reihtml/sleuth/sleuth.html). Both of them are written in Perl (and will probably stay that way). The job also comes with a generous salary (commensurate with experience), full benefits, profit sharing, huge employee discounts and the privilege of working in a very new and very earthquake-proof building :) As I said before, if you are interested please e-mail me at rwolber@rei.com or you can call me at (253)437-7287. Please contact me on or before Friday March 16. If you know of anyone who didn't receive this message, who you think would be interested, please pass this on to them. Thank you, -Chuck -- Quantum Linux Laboratories - ACCELERATING Business with Linux Technology * Education | * Enterprise Integration | http://www.quantumlinux.com * Support | chuckw@quantumlinux.com ----- End forwarded message ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Mon Mar 12 18:16:34 2001 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl Message-ID: <0103121649050C.12751@avatar.cardomain.com> Okay, run while you still can! We're running mod_perl on Apache. I am working on a module to allow people to search our pages. I got ht://dig. This is a fine piece of software, and it works great. Ht://dig has a program that works as a CGI script, and using the configuration files and templates, you can configure almost anything you would like to. We want to really customize stuff, really really customize it. So I figured we'd trick htdig to output XML, and use XML parser to parse it out, and then take that and convert it into hashes and arrays and scalars we can use to fully customize everything in Perl. Okay, so I wrote a module that takes the search parameters and returns a hash with all the results stored inside. I wrote a test script that runs from the command line and everything works beautifully. I am so happy I beam for joy! I plug it into Apache mod_perl and I get the dreaded segmentation fault. Not just once, over and over again, almost every time I try to run it. The only hint I have is that perhaps it is an out-of-memory problem. This would make sense. I have the program that consumes a lot of memory (the search), and XML::Parser trying to pack everything into 'Tree' style. But it doesn't fail during that - it fails when I start working on the tree with a couple of subs, so if it WAS a memory problem shouldn't it fail during the XML parsing or during the searching? How do I check to see how much memory the command-line script uses? What do I do to find out the problem, short of putting a "warn" between every line of code? How do I use the core dump - if it is useful at all? What rotting nuggets of useful knowledge are lodged in the wisdom teeth of the gurus, and could they use the toothbrush of the transfer of knowledge to reveal those morsels to me? :-) -- Jonathan Gardner gardner@sounddomain.com (425)820-2244 x123 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Mon Mar 12 21:06:10 2001 From: jcokos at iwebsys.com (John Cokos) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl References: <0103121649050C.12751@avatar.cardomain.com> Message-ID: <001101c0ab6a$8fd11020$61affea9@ccokos> You're barking right up my tree here .... I do CGI work for a living, and work with mod_perl quite a bit. That being said, let me ask you a few preliminary questions: 1. The CGI Script that actually runs: is it mod_perl compliant, in terms of exit status, "use strict" compatability, etc? 2. How do you have httpd.conf setup to accept mod_perl programs? 3. Sounds like you're going through a lot of machinations to get XML output. Seems to me that a "from scratch" solution, or one that's designed from the outset to work within the confines of mod_perl would be better suited than to try and shoehorn in something else. Generally, coredumps from mod_perl are the result of "dirty" coding. A few variables out of place, or a bad exit status can kill it pretty quickly. John ----- Original Message ----- From: Jonathan Gardner To: Sent: Monday, March 12, 2001 4:16 PM Subject: SPUG: Segmentation Fault in mod_perl > Okay, run while you still can! > > We're running mod_perl on Apache. I am working on a module to > allow people to search our pages. > > I got ht://dig. This is a fine piece of software, and it works great. Ht://dig > has a program that works as a CGI script, and using the configuration files and > templates, you can configure almost anything you would like to. > > We want to really customize stuff, really really customize it. So I figured > we'd trick htdig to output XML, and use XML parser to parse it out, and then > take that and convert it into hashes and arrays and scalars we can use to fully > customize everything in Perl. > > Okay, so I wrote a module that takes the search parameters and returns a hash > with all the results stored inside. I wrote a test script that runs from the > command line and everything works beautifully. I am so happy I beam for joy! > > I plug it into Apache mod_perl and I get the dreaded segmentation fault. Not > just once, over and over again, almost every time I try to run it. > > The only hint I have is that perhaps it is an out-of-memory problem. This would > make sense. I have the program that consumes a lot of memory (the search), and > XML::Parser trying to pack everything into 'Tree' style. But it doesn't fail > during that - it fails when I start working on the tree with a couple of subs, > so if it WAS a memory problem shouldn't it fail during the XML parsing or > during the searching? How do I check to see how much memory the command-line > script uses? > > What do I do to find out the problem, short of putting a "warn" > between every line of code? How do I use the core dump - if it is useful at > all? What rotting nuggets of useful knowledge are lodged in the wisdom > teeth of the gurus, and could they use the toothbrush of the transfer of > knowledge to reveal those morsels to me? :-) > > -- > Jonathan Gardner > gardner@sounddomain.com > (425)820-2244 x123 > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From wyllie at dilex.net Tue Mar 13 01:54:21 2001 From: wyllie at dilex.net (Andrew Wyllie) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl In-Reply-To: <0103121649050C.12751@avatar.cardomain.com>; from gardner@sounddomain.com on Mon, Mar 12, 2001 at 04:16:34PM -0800 References: <0103121649050C.12751@avatar.cardomain.com> Message-ID: <20010312235421.E21319@drella.newsof.com> Hi Jonathan, This has been discussed to some extent on the mod_perl mailing list so you may want to check the archives (perl.apache.org). In a nutshell, the expat that comes with apache should be disabled when you build apache with mod_perl. Depending on how you built mod_perl this may or may not have been done for you. The apache expat and the version of expat used by XML::Parser are not the same and cross each other up causing the segfaults. my apache config command looks like this: cd apache_1.3.19; ./configure --disable-rule=EXPAT \ --prefix=/usr/local/apache \ --activate-module=src/modules/perl/libperl.a I also found that using the DSO stuff and expat gave me some problems, but I did not really investigate this too much - I don't really need the DSO stuff. hope this helps andrew On Mon, 12 Mar 2001, Jonathan Gardner wrote: > Okay, run while you still can! > > We're running mod_perl on Apache. I am working on a module to > allow people to search our pages. > > I got ht://dig. This is a fine piece of software, and it works great. Ht://dig > has a program that works as a CGI script, and using the configuration files and > templates, you can configure almost anything you would like to. > > We want to really customize stuff, really really customize it. So I figured > we'd trick htdig to output XML, and use XML parser to parse it out, and then > take that and convert it into hashes and arrays and scalars we can use to fully > customize everything in Perl. > > Okay, so I wrote a module that takes the search parameters and returns a hash > with all the results stored inside. I wrote a test script that runs from the > command line and everything works beautifully. I am so happy I beam for joy! > > I plug it into Apache mod_perl and I get the dreaded segmentation fault. Not > just once, over and over again, almost every time I try to run it. > > The only hint I have is that perhaps it is an out-of-memory problem. This would > make sense. I have the program that consumes a lot of memory (the search), and > XML::Parser trying to pack everything into 'Tree' style. But it doesn't fail > during that - it fails when I start working on the tree with a couple of subs, > so if it WAS a memory problem shouldn't it fail during the XML parsing or > during the searching? How do I check to see how much memory the command-line > script uses? > > What do I do to find out the problem, short of putting a "warn" > between every line of code? How do I use the core dump - if it is useful at > all? What rotting nuggets of useful knowledge are lodged in the wisdom > teeth of the gurus, and could they use the toothbrush of the transfer of > knowledge to reveal those morsels to me? :-) > > -- > Jonathan Gardner > gardner@sounddomain.com > (425)820-2244 x123 > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > ............................................................................... Andrew Wyllie Open Source Integrator v.206.729.7439 __We can catify or stringify, c.206.851.9876 separately or together!__ perl-5.005_03 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From cmeyer at helvella.org Tue Mar 13 12:52:11 2001 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl In-Reply-To: <0103121649050C.12751@avatar.cardomain.com> References: <0103121649050C.12751@avatar.cardomain.com> Message-ID: <20010313105211.E29004@hobart.helvella.org> Jonathan, On Mon, Mar 12, 2001 at 04:16:34PM -0800, Jonathan Gardner wrote: > Okay, run while you still can! ... > What do I do to find out the problem, short of putting a "warn" > between every line of code? How do I use the core dump - if it is > useful at all? What rotting nuggets of useful knowledge are lodged in > the wisdom teeth of the gurus, and could they use the toothbrush of > the transfer of knowledge to reveal those morsels to me? :-) Andrew's suggestion about compiling Apache without the expat library solves many segfaults, which occur because of symbol conflicts between differing versions of expat. Look out for other apache modules that may use expat: PHP, mod_dav, AxKit, etc. If you need functionality from more than one user of expat, you'll need to compile a separate httpd for each one. Hopefully these many little incompatible expats will soon be cleared up with centralized expat development at sourceforge. If removing expat still doesn't fix your segfault crashing, there are some more debugging options. Try running httpd with the -X switch to get only one process, and use strace to see which system calls it completes or hangs on. With a little practice, it is easy to compare strace logs to your perl source and gain clues to the problem area(s). Another option is to compile with c level debugging turned on and run with gdb. I don't have much experience with the latter option, but I can point you to the appropriate mod_perl guide sections to get started: # the whole debugging section is well worth reading. Well, the whole # guide is well worth reading http://perl.apache.org/guide/debug.html # using strace / truss http://perl.apache.org/guide/debug.html#Using_the_System_Calls_Trace # using c level debugging: http://perl.apache.org/guide/debug.html#PERL_DEBUG_1_Build_Option http://perl.apache.org/guide/debug.html#Debug_Tracing Happy debugging, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From joshlanza at hotmail.com Wed Mar 14 02:01:09 2001 From: joshlanza at hotmail.com (Joshua Lanza) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Removing newlines from a multi-line string Message-ID: Hi all, I have a script that gets a chunk of HTML from an access database and plunks it into a template. The problem is that it puts newline characters in the HTML at the end of every line in the HTML blob, which is (1) unseemly and (2) making it difficult to manipulate the text after the pages are generated. I store the text in $html and then try $html =~ s/\n//ig; but nothing seems to happen. If this worked it would solve (2) from above but wouldn't help (1). I guess what I'm really looking for is why I'm getting the extra newlines in the first place. Any thoughts greatly appreciated, Josh _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dvergin at igc.org Wed Mar 14 03:41:18 2001 From: dvergin at igc.org (David Vergin) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Removing newlines from a multi-line string In-Reply-To: Message-ID: <000401c0ac6a$eb443300$0300000a@bigmindmedia.com> If you are on Windows, you are dealing with two characters at the end of each line: \r and \n. (And you don't need /i (case-insensitive matches)). So try: $html =~ s/[\n\r]//g; dv > -----Original Message----- > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > Joshua Lanza > Sent: Wednesday, March 14, 2001 12:01 AM > To: spug-list@pm.org > Subject: SPUG: Removing newlines from a multi-line string > > > Hi all, > > I have a script that gets a chunk of HTML from an access database and plunks > it into a template. The problem is that it puts newline characters in the > HTML at the end of every line in the HTML blob, which is (1) unseemly and > (2) making it difficult to manipulate the text after the pages are > generated. > > I store the text in $html and then try > > $html =~ s/\n//ig; > > but nothing seems to happen. If this worked it would solve (2) from above > but wouldn't help (1). I guess what I'm really looking for is why I'm > getting the extra newlines in the first place. Any thoughts greatly > appreciated, > > Josh > > > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dan at enic.cc Wed Mar 14 13:50:04 2001 From: dan at enic.cc (Dan Ebert) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Removing newlines from a multi-line string - questions References: <1CE5392373C4D311BB220008C733F5941E2EE4@EBINCRD01> Message-ID: <3AAFCB6C.598549AD@enic.cc> I am fairly sure that perl treats the \n and \r as distinct entities when a script is run on a UNIX platform. So you would need the s/[\n\r]//g to make sure you're getting rid of what you want. I don't know if perl handles \n & \r differently on a Windows platform. ----------------------------------------------------------- Dan Ebert dan@enic.cc eNIC Corporation "I haven't lost my mind; I know exactly where I left it." ----------------------------------------------------------- Lorraine Johnson wrote: > > Enlightenment search: > > 1. Joshua writes: > "The problem is that it puts newline characters in the HTML at the end of > every line in the HTML blob" > Um, doesn't the phrase "at the end of every line" imply that the HTML blob > already HAS newlines (end-of-line markers), and that Perl is PRESERVING > rather than ADDING newlines? > > 2. David writes > "on Windows, you are dealing with two characters at the end of each line" > My understanding is that Perl knows what and how many characters actually > comprise a newline (EOL) and handles them transparently. For example, on > Windows, \n is equivalent to CR plus LF. Doesn't a requirement to handle > text processing differently depending on platform go against the idea of > Perl portability? > > Thanks, > > Lorraine > > -----Original Message----- > From: David Vergin [mailto:dvergin@igc.org] > Sent: Wednesday, March 14, 2001 1:41 AM > To: Joshua Lanza; spug-list@pm.org > Subject: RE: SPUG: Removing newlines from a multi-line string > > If you are on Windows, you are dealing with two characters at the end of > each > line: \r and \n. > (And you don't need /i (case-insensitive matches)). So try: > > $html =~ s/[\n\r]//g; > > dv > > > -----Original Message----- > > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of > > Joshua Lanza > > Sent: Wednesday, March 14, 2001 12:01 AM > > To: spug-list@pm.org > > Subject: SPUG: Removing newlines from a multi-line string > > > > > > Hi all, > > > > I have a script that gets a chunk of HTML from an access database and > plunks > > it into a template. The problem is that it puts newline characters in the > > HTML at the end of every line in the HTML blob, which is (1) unseemly and > > (2) making it difficult to manipulate the text after the pages are > > generated. > > > > I store the text in $html and then try > > > > $html =~ s/\n//ig; > > > > but nothing seems to happen. If this worked it would solve (2) from above > > but wouldn't help (1). I guess what I'm really looking for is why I'm > > getting the extra newlines in the first place. Any thoughts greatly > > appreciated, > > > > Josh > > -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From joshlanza at hotmail.com Wed Mar 14 14:13:25 2001 From: joshlanza at hotmail.com (Joshua Lanza) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Removing newlines from a multi-line string - questions Message-ID: It was the "\r". Thank you all 10,000 times. SPUG rules! Windows does not rule! >From: Dan Ebert >CC: "'spug-list@pm.org'" >Subject: Re: SPUG: Removing newlines from a multi-line string - questions >Date: Wed, 14 Mar 2001 11:50:04 -0800 > > >I am fairly sure that perl treats the \n and \r as distinct entities >when a script is run on a UNIX platform. So you would need the >s/[\n\r]//g to make sure you're getting rid of what you want. I don't >know if perl handles \n & \r differently on a Windows platform. > > >----------------------------------------------------------- >Dan Ebert dan@enic.cc eNIC Corporation > >"I haven't lost my mind; I know exactly where I left it." >----------------------------------------------------------- > >Lorraine Johnson wrote: > > > > Enlightenment search: > > > > 1. Joshua writes: > > "The problem is that it puts newline characters in the HTML at the end >of > > every line in the HTML blob" > > Um, doesn't the phrase "at the end of every line" imply that the HTML >blob > > already HAS newlines (end-of-line markers), and that Perl is PRESERVING > > rather than ADDING newlines? > > > > 2. David writes > > "on Windows, you are dealing with two characters at the end of each >line" > > My understanding is that Perl knows what and how many characters >actually > > comprise a newline (EOL) and handles them transparently. For example, >on > > Windows, \n is equivalent to CR plus LF. Doesn't a requirement to >handle > > text processing differently depending on platform go against the idea of > > Perl portability? > > > > Thanks, > > > > Lorraine > > > > -----Original Message----- > > From: David Vergin [mailto:dvergin@igc.org] > > Sent: Wednesday, March 14, 2001 1:41 AM > > To: Joshua Lanza; spug-list@pm.org > > Subject: RE: SPUG: Removing newlines from a multi-line string > > > > If you are on Windows, you are dealing with two characters at the end of > > each > > line: \r and \n. > > (And you don't need /i (case-insensitive matches)). So try: > > > > $html =~ s/[\n\r]//g; > > > > dv > > > > > -----Original Message----- > > > From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf >Of > > > Joshua Lanza > > > Sent: Wednesday, March 14, 2001 12:01 AM > > > To: spug-list@pm.org > > > Subject: SPUG: Removing newlines from a multi-line string > > > > > > > > > Hi all, > > > > > > I have a script that gets a chunk of HTML from an access database and > > plunks > > > it into a template. The problem is that it puts newline characters in >the > > > HTML at the end of every line in the HTML blob, which is (1) unseemly >and > > > (2) making it difficult to manipulate the text after the pages are > > > generated. > > > > > > I store the text in $html and then try > > > > > > $html =~ s/\n//ig; > > > > > > but nothing seems to happen. If this worked it would solve (2) from >above > > > but wouldn't help (1). I guess what I'm really looking for is why I'm > > > getting the extra newlines in the first place. Any thoughts greatly > > > appreciated, > > > > > > Josh > > > > >-- > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jeff at planetoid.net Wed Mar 14 15:36:48 2001 From: jeff at planetoid.net (jeff saenz) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: [job seeker] - software engineer (c++,web,perl,*nix) References: Message-ID: <3AAFE470.51AA0BCC@planetoid.net> Sr. Level Internet Developer with a strong background in software engineering, web development, *nix is seeking a position in the Washington area. Skills include: * Perl/Apache/Mason * C++/Corba * HTML/Javascript * Solaris/Linux * MySQL/Postgres/ObjectStore Jeff "Sorry for the intrusion" Saenz -- Perl/Linux/Java Development Resume: http://resumes.yahoo.com/undertheash/perljavalinux - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Wed Mar 14 11:24:40 2001 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Removing newlines from a multi-line string In-Reply-To: <000401c0ac6a$eb443300$0300000a@bigmindmedia.com> References: <000401c0ac6a$eb443300$0300000a@bigmindmedia.com> Message-ID: <0103140929200P.12751@avatar.cardomain.com> On Wed, 14 Mar 2001, David Vergin wrote: > If you are on Windows, you are dealing with two characters at the end of each > line: \r and \n. > (And you don't need /i (case-insensitive matches)). So try: > > $html =~ s/[\n\r]//g; > > dv > > > $html =~ s/\n//ig; > > > > Josh You need the 's' option to make it a single line. Otherwise, you can MATCH the "\n" with $, but you can't replace it. $html =~ s/[\r\n]//sog; The 'o' option is good because it will compile the regex exactly once, rather than recompiling it each time it encounters it. It is good to remember the "\r" because windows sometimes submits a "\r" with each newline from a text box. (Like dv mentioned) The 'i' option is unnecessary unless you are using alphabetic characters. In this case, there is no such thing as a lower case "\n" so it is useless. -- Jonathan Gardner gardner@sounddomain.com (425)820-2244 x123 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Wed Mar 14 19:38:29 2001 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Removing newlines from a multi-line string Message-ID: <0103141738470Z.12751@avatar.cardomain.com> Let me correct myself... I feel like I am about two feet tall right now... > > You need the 's' option to make it a single line. Otherwise, you can MATCH the > "\n" with $, but you can't replace it. > If you use /\n/ you will match the newline no matter what. But if you use /./, you will never match the newline. That is why they have the /s option. For some reason I got it stuck in my head that when you want to treat \n as data rather than a logical seperator you should use /s. > > The 'o' option is good because it will compile the regex exactly once, rather > than recompiling it each time it encounters it. > Only when the regex has a variable inside. Otherwise, it is meaningless, and has no effect. Perl will compile regexes that have no variables inside once and only once, even if there is no /o. Sorry, my bad. Another habit of mine. So the difference between s/[\r\n]//sog and s/[\r\n]//g is that one is easier to type by two characters, and is thus the better answer because laziness is a virtue in Perl. Do I get extra points for being lazy and not looking anything up before I post? Please? -- Jonathan Gardner gardner@sounddomain.com (425)820-2244 x123 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Wed Mar 14 21:58:06 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: March 20 Meeting: Komodo & Regexes, ActiveState Message-ID: <20010314195806.B17170@timji.consultix.wa.com> SPUGsters, Sorry about the delay, but the globe-trotting ActiveState people have only recently gotten back to me with the following details for next week's talk. Sounds like it could be a good one, so hope to see you all there! NOTE: The next few meetings, including this one, will run from 7:30-9:30 (rather than the usual 7-9pm) due to scheduling issues. -Tim P.S. Same info on web-site too now. ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== "Perl, Komodo & Regular Expressions" Brian King and Neil Watkiss, Developers ActiveState Corp., Vancouver CA Regular expressions are often the bane of many a programmer. This talk provides an overview of the Regex debugger in Komodo, ActiveState's new cross-platform, multi-language, scripting IDE. The Regex Debugger, goes beyond the simple "matched or not" feedback available in all current Regex debuggers. 'Rx' is written in Perl and C and integrated into Komodo using Mozilla's XPCOM technology. Coming soon to Mozilla, PerlXPCOM will allow you to write your components directly in Perl. 1. Background: Komodo & Perl - A cross platform, multi-language IDE - Based on Mozilla - Perl debugging, syntax highlighting, auto-completion, etc. 2. Regular Expression Debugger - What was missing - Regex debugger - Never-before-seen features - Decided to write in Perl 3. Rx.pm - Based on re.xs (in the Perl core) - Mostly written in XS & C, some Perl - Exposes the Perl regular expression engine functions - Provides information about compilation and execution phases 4. Rx::Info.pm - Written completely in Perl - Provides an OO API to regular expressions and information 5. Integrating Rx into Komodo - An XPCOM component (introduce XPCOM briefly) - Written in C++ - Embeds a Perl interpreter 6. Future of Perl & Mozilla: PerlXPCOM - Current status *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Mar 15 11:43:54 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? Message-ID: <20010315094354.A23981@timji.consultix.wa.com> SPUGsters, I'm writing a little program that will eventually read input from SDTIN, but initially I want to test it using the DATA filehandle. I thought the following would work, but it doesn't; it just reads from STDIN. Anybody know the way to accomplish this? #! /usr/bin/perl -wn BEGIN { open STDIN, "<&DATA"; # comment-out after testing } s/^(.*?:)//; defined $1 and print "Extracted $1\n"; __DATA__ Data: right here *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Mar 15 11:57:50 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? In-Reply-To: <20010315094354.A23981@timji.consultix.wa.com>; from Tim Maher/CONSULTIX on Thu, Mar 15, 2001 at 09:43:54AM -0800 References: <20010315094354.A23981@timji.consultix.wa.com> Message-ID: <20010315095750.A24087@timji.consultix.wa.com> On Thu, Mar 15, 2001 at 09:43:54AM -0800, Tim Maher/CONSULTIX wrote: > SPUGsters, > > I'm writing a little program that will eventually read input from > SDTIN, but initially I want to test it using the DATA filehandle. > I thought the following would work, but it doesn't; it just reads from > STDIN. Anybody know the way to accomplish this? > > #! /usr/bin/perl -wn > > BEGIN { > open STDIN, "<&DATA"; # comment-out after testing > } > > s/^(.*?:)//; > defined $1 and print "Extracted $1\n"; > > __DATA__ > Data: right here For those put off by the AWKisness (-n usage) of the above program, the following one doesn't work any better: #! /usr/bin/perl -w open STDIN, "<&DATA"; while (<>) { # no arguments provided to script } __DATA__ Stuff here *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Mar 15 12:04:42 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? Message-ID: <20010315100442.A24197@timji.consultix.wa.com> > For those put off by the AWKisness (-n usage) of the above program, > the following one doesn't work any better: > > #! /usr/bin/perl -w > > open STDIN, "<&DATA"; > > while (<>) { # no arguments provided to script > > } > > __DATA__ > Stuff here Actually, this one *does* work; I couldn't tell initially because I had an invisible (junk) argument lingering in vi's !!-command buffer, that prevented STDIN from being accessed. Sorry! 8-{ I'd still like to know how to make the -n version work, though, if anybody has any ideas. *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ ----- End forwarded message ----- -- *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From LaurenS at bsquare.com Thu Mar 15 12:20:59 2001 From: LaurenS at bsquare.com (Lauren Smith) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? Message-ID: > -----Original Message----- > From: Tim Maher/CONSULTIX [mailto:tim@consultix-inc.com] > Sent: Thursday, March 15, 2001 9:58 AM > To: spug-list@pm.org > Subject: Re: SPUG: Dup'ing STDIN from DATA? > > For those put off by the AWKisness (-n usage) of the above program, > the following one doesn't work any better: > > #! /usr/bin/perl -w > > open STDIN, "<&DATA"; > > while (<>) { # no arguments provided to script > > } > > __DATA__ > Stuff here Works for me: #!perl -w open STDIN, "<&DATA"; while () { # no arguments provided to script s/.*? //; print $_; } __DATA__ Stuff here Output: here Is Perl making a distinction between "<>" and an explicit ""? Lauren - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Thu Mar 15 12:24:27 2001 From: jcokos at iwebsys.com (John Cokos, CEO, iWeb, Inc.) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl References: <0103121649050C.12751@avatar.cardomain.com> <001101c0ab6a$8fd11020$61affea9@ccokos> <020f01c0dd62$7d5611a0$2f88ddd1@aci2> Message-ID: <001a01c0ad7d$4f308130$0500a8c0@iwebx1> Although I'm not sure if this is related to the original problem, it's food for thought, nonetheless ..... I've noticed a quite serious problem when you have php and mod_perl both compiled into apache. The problems only arise when a mod_perl program attempts to connect to a database. At that point, mod_perl programs start throwing up Segfaults, and php scripts start returning no data at all. Definitely a bug somewhere, where these 2 technologies are bumping into each other's shared memory or something. I've found that in every case, turning php "off" always fixes the mod_perl problem. While not the best solution, it is the only solution when you're trying to do both. J- ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== ----- Original Message ----- From: "Richard Anderson" To: "John Cokos" ; "Jonathan Gardner" ; Cc: "Colin Meyer" Sent: Tuesday, May 15, 2001 9:14 AM Subject: Re: SPUG: Segmentation Fault in mod_perl > I've done a bit of work on search engines, and I have a couple of thoughts: > > John pointed us toward a few potentential minor syntax problems. The out-of-memory problem will pop up quite a bit if you are searching a large internap site like yahoo, yellowpages.com etc. and the search returns a lot of results. Imagine seaching the NYC phonebook for the string Smith! > > One try might be to use a more memory-efficient XML parser routine. Damian is probably a good resource on this (are you out there, mate?). > > Another approach is to limit your search to returning the first 50 results you find. If the user wants more results, add a link at the top and bottom of the page that takes him to results 51-100, and so on > > In future versions, you might consider ranking the results based on some goodness-of-fit criterion based on the search string. Word stemming and language dependencies are some more goodies to add. > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA > ----- Original Message ----- > From: "John Cokos" > To: "Jonathan Gardner" ; > Sent: Monday, March 12, 2001 8:06 PM > Subject: Re: SPUG: Segmentation Fault in mod_perl > > > > You're barking right up my tree here .... I do CGI > > work for a living, and work with mod_perl quite > > a bit. > > > > That being said, let me ask you a few preliminary > > questions: > > > > 1. The CGI Script that actually runs: is it mod_perl > > compliant, in terms of exit status, "use strict" compatability, > > etc? > > > > 2. How do you have httpd.conf setup to accept mod_perl > > programs? > > > > 3. Sounds like you're going through a lot of machinations > > to get XML output. Seems to me that a "from scratch" > > solution, or one that's designed from the outset to > > work within the confines of mod_perl would be better > > suited than to try and shoehorn in something else. > > > > Generally, coredumps from mod_perl are the result of > > "dirty" coding. A few variables out of place, or a bad > > exit status can kill it pretty quickly. > > > > John > > > > ----- Original Message ----- > > From: Jonathan Gardner > > To: > > Sent: Monday, March 12, 2001 4:16 PM > > Subject: SPUG: Segmentation Fault in mod_perl > > > > > > > Okay, run while you still can! > > > > > > We're running mod_perl on Apache. I am working on a module to > > > allow people to search our pages. > > > > > > I got ht://dig. This is a fine piece of software, and it works great. Ht://dig > > > has a program that works as a CGI script, and using the configuration files and > > > templates, you can configure almost anything you would like to. > > > > > > We want to really customize stuff, really really customize it. So I figured > > > we'd trick htdig to output XML, and use XML parser to parse it out, and then > > > take that and convert it into hashes and arrays and scalars we can use to fully > > > customize everything in Perl. > > > > > > Okay, so I wrote a module that takes the search parameters and returns a hash > > > with all the results stored inside. I wrote a test script that runs from the > > > command line and everything works beautifully. I am so happy I beam for joy! > > > > > > I plug it into Apache mod_perl and I get the dreaded segmentation fault. Not > > > just once, over and over again, almost every time I try to run it. > > > > > > The only hint I have is that perhaps it is an out-of-memory problem. This would > > > make sense. I have the program that consumes a lot of memory (the search), and > > > XML::Parser trying to pack everything into 'Tree' style. But it doesn't fail > > > during that - it fails when I start working on the tree with a couple of subs, > > > so if it WAS a memory problem shouldn't it fail during the XML parsing or > > > during the searching? How do I check to see how much memory the command-line > > > script uses? > > > > > > What do I do to find out the problem, short of putting a "warn" > > > between every line of code? How do I use the core dump - if it is useful at > > > all? What rotting nuggets of useful knowledge are lodged in the wisdom > > > teeth of the gurus, and could they use the toothbrush of the transfer of > > > knowledge to reveal those morsels to me? :-) > > > > > > -- > > > Jonathan Gardner > > > gardner@sounddomain.com > > > (425)820-2244 x123 > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From gardner at sounddomain.com Thu Mar 15 12:26:18 2001 From: gardner at sounddomain.com (Jonathan Gardner) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl In-Reply-To: <20010312235421.E21319@drella.newsof.com> References: <0103121649050C.12751@avatar.cardomain.com> <20010312235421.E21319@drella.newsof.com> Message-ID: <01031510301510.12751@avatar.cardomain.com> On Mon, 12 Mar 2001, Andrew Wyllie wrote: > Hi Jonathan, > > This has been discussed to some extent on the mod_perl mailing list > so you may want to check the archives (perl.apache.org). In a > nutshell, the expat that comes with apache should be disabled when > you build apache with mod_perl. Depending on how you built mod_perl > this may or may not have been done for you. The apache expat and > the version of expat used by XML::Parser are not the same and cross > each other up causing the segfaults. > > my apache config command looks like this: > > cd apache_1.3.19; > ./configure --disable-rule=EXPAT \ > --prefix=/usr/local/apache \ > --activate-module=src/modules/perl/libperl.a > > I also found that using the DSO stuff and expat gave me some problems, but I > did not really investigate this too much - I don't really need the DSO stuff. > > hope this helps > andrew > Oh yes it sure did help. It took me a while to get apache compiled (I'm a bit addicted to the simplicity of RPM) but after I got everything figured out it works great. I totally disabled DSO just to be on the safe side. Everything is running very smoothly now - if anyone is interested in how I used ht://dig and mod_perl on Apache to build an internal search engine, I'd be happy to describe my adventure. Is this the kind of stuff a Spug (or espug) meeting is made of? -- Jonathan Gardner gardner@sounddomain.com (425)820-2244 x123 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From largest at largest.org Thu Mar 15 12:32:14 2001 From: largest at largest.org (Joel Grow) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? Message-ID: Lauren Smith wrote: > Works for me: > > #!perl -w > > open STDIN, "<&DATA"; > > while () { # no arguments provided to script > s/.*? //; > print $_; > } > > __DATA__ > Stuff here > > Output: > here > > Is Perl making a distinction between "<>" and an explicit ""? It shouldn't--<> should check @ARGV and if it's an empty list set $ARGV[0] to '-', which is STDIN. I noticed that this code works on 5.6 but not on 5.004_04, so I thought Tim might have been running it on an older version of Perl. Joel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Alex.Leites at esca.com Thu Mar 15 12:43:36 2001 From: Alex.Leites at esca.com (Alex Leites) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? In-Reply-To: <661DB5E991F2AFF608256A100064DE2A.0064DE7808256A10@energy.alstom.com> Message-ID: <00b401c0ad7f$d8399c80$200516ac@esca.com> It works if you use INIT block instead of BEGIN. Alex -----Original Message----- From: Tim Maher/CONSULTIX [mailto:tim@consultix-inc.com] Sent: Thursday, March 15, 2001 10:22 AM To: spug-list@pm.org Subject: SPUG: Dup'ing STDIN from DATA? SPUGsters, I'm writing a little program that will eventually read input from SDTIN, but initially I want to test it using the DATA filehandle. I thought the following would work, but it doesn't; it just reads from STDIN. Anybody know the way to accomplish this? #! /usr/bin/perl -wn BEGIN { open STDIN, "<&DATA"; # comment-out after testing } s/^(.*?:)//; defined $1 and print "Extracted $1\n"; __DATA__ Data: right here *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From snickels at u.washington.edu Thu Mar 15 13:42:56 2001 From: snickels at u.washington.edu (Stephen Nickels) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Segmentation Fault in mod_perl In-Reply-To: <001a01c0ad7d$4f308130$0500a8c0@iwebx1> Message-ID: Wow, I've never seen this before. What versions are being run when you see this problem? I spent a summer with a bunch of boxes running mod_perl and php on apache, and never saw a problem. My home box runs linux 2.4.2, apache 1.3.12, php 4.0.1pl2 and mod_perl 1.24 and I've never had a mod_perl problem connecting to a database. I'm curious to know where and how you get these problems so I can watch for them in the future.... --Steve On Thu, 15 Mar 2001, John Cokos, CEO, iWeb, Inc. wrote: > Although I'm not sure if this is related to the original > problem, it's food for thought, nonetheless ..... > > I've noticed a quite serious problem when you have > php and mod_perl both compiled into apache. The problems > only arise when a mod_perl program attempts to > connect to a database. At that point, mod_perl programs > start throwing up Segfaults, and php scripts start returning > no data at all. > > Definitely a bug somewhere, where these 2 technologies > are bumping into each other's shared memory or something. > > I've found that in every case, turning php "off" always fixes > the mod_perl problem. While not the best solution, it > is the only solution when you're trying to do both. > > J- > > ======================================== > John Cokos, President / CEO: iWeb Inc. > http://www.iwebsys.com > jcokos@ccs.net > ======================================== > ----- Original Message ----- > From: "Richard Anderson" > To: "John Cokos" ; "Jonathan Gardner" ; > Cc: "Colin Meyer" > Sent: Tuesday, May 15, 2001 9:14 AM > Subject: Re: SPUG: Segmentation Fault in mod_perl > > > > I've done a bit of work on search engines, and I have a couple of thoughts: > > > > John pointed us toward a few potentential minor syntax problems. The out-of-memory problem will pop up quite a bit if you are > searching a large internap site like yahoo, yellowpages.com etc. and the search returns a lot of results. Imagine seaching the NYC > phonebook for the string Smith! > > > > One try might be to use a more memory-efficient XML parser routine. Damian is probably a good resource on this (are you out > there, mate?). > > > > Another approach is to limit your search to returning the first 50 results you find. If the user wants more results, add a link > at the top and bottom of the page that takes him to results 51-100, and so on > > > > In future versions, you might consider ranking the results based on some goodness-of-fit criterion based on the search string. > Word stemming and language dependencies are some more goodies to add. > > Richard Anderson, Ph.D. www.unixscripts.com > > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > > Raycosoft, LLC Seattle, WA, USA > > ----- Original Message ----- > > From: "John Cokos" > > To: "Jonathan Gardner" ; > > Sent: Monday, March 12, 2001 8:06 PM > > Subject: Re: SPUG: Segmentation Fault in mod_perl > > > > > > > You're barking right up my tree here .... I do CGI > > > work for a living, and work with mod_perl quite > > > a bit. > > > > > > That being said, let me ask you a few preliminary > > > questions: > > > > > > 1. The CGI Script that actually runs: is it mod_perl > > > compliant, in terms of exit status, "use strict" compatability, > > > etc? > > > > > > 2. How do you have httpd.conf setup to accept mod_perl > > > programs? > > > > > > 3. Sounds like you're going through a lot of machinations > > > to get XML output. Seems to me that a "from scratch" > > > solution, or one that's designed from the outset to > > > work within the confines of mod_perl would be better > > > suited than to try and shoehorn in something else. > > > > > > Generally, coredumps from mod_perl are the result of > > > "dirty" coding. A few variables out of place, or a bad > > > exit status can kill it pretty quickly. > > > > > > John > > > > > > ----- Original Message ----- > > > From: Jonathan Gardner > > > To: > > > Sent: Monday, March 12, 2001 4:16 PM > > > Subject: SPUG: Segmentation Fault in mod_perl > > > > > > > > > > Okay, run while you still can! > > > > > > > > We're running mod_perl on Apache. I am working on a module to > > > > allow people to search our pages. > > > > > > > > I got ht://dig. This is a fine piece of software, and it works great. Ht://dig > > > > has a program that works as a CGI script, and using the configuration files and > > > > templates, you can configure almost anything you would like to. > > > > > > > > We want to really customize stuff, really really customize it. So I figured > > > > we'd trick htdig to output XML, and use XML parser to parse it out, and then > > > > take that and convert it into hashes and arrays and scalars we can use to fully > > > > customize everything in Perl. > > > > > > > > Okay, so I wrote a module that takes the search parameters and returns a hash > > > > with all the results stored inside. I wrote a test script that runs from the > > > > command line and everything works beautifully. I am so happy I beam for joy! > > > > > > > > I plug it into Apache mod_perl and I get the dreaded segmentation fault. Not > > > > just once, over and over again, almost every time I try to run it. > > > > > > > > The only hint I have is that perhaps it is an out-of-memory problem. This would > > > > make sense. I have the program that consumes a lot of memory (the search), and > > > > XML::Parser trying to pack everything into 'Tree' style. But it doesn't fail > > > > during that - it fails when I start working on the tree with a couple of subs, > > > > so if it WAS a memory problem shouldn't it fail during the XML parsing or > > > > during the searching? How do I check to see how much memory the command-line > > > > script uses? > > > > > > > > What do I do to find out the problem, short of putting a "warn" > > > > between every line of code? How do I use the core dump - if it is useful at > > > > all? What rotting nuggets of useful knowledge are lodged in the wisdom > > > > teeth of the gurus, and could they use the toothbrush of the transfer of > > > > knowledge to reveal those morsels to me? :-) > > > > > > > > -- > > > > Jonathan Gardner > > > > gardner@sounddomain.com > > > > (425)820-2244 x123 > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > "When once you have tasted flight, you will forever walk the Earth with your eyes turned skyward, for there you have been, and there you will always long to return" -Leonardo da Vinci - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ced at carios2.ca.boeing.com Thu Mar 15 13:49:20 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:07:55 2004 Subject: SPUG: Dup'ing STDIN from DATA? Message-ID: <200103151949.LAA13118@carios2.ca.boeing.com> > #! /usr/bin/perl -wn > > BEGIN { > open STDIN, "<&DATA"; # comment-out after testing > } > > s/^(.*?:)//; > defined $1 and print "Extracted $1\n"; > > __DATA__ > Data: right here A dup needs to adjust to DATA's start position. Rgds, -- Charles DeRykus my $start = tell DATA; # see where DATA is positioned initially open(STDIN, "<&DATA") # comment-out after testing or die "dup failed: $!"; seek(STDIN, $start, 0) or die "can't seek"; # re-position to DATA start $_ = ; s/^(.*?:)//; defined $1 and print "Extracted $1\n"; __DATA__ Data: right here - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jcokos at iwebsys.com Thu Mar 15 14:41:27 2001 From: jcokos at iwebsys.com (John Cokos, CEO, iWeb, Inc.) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Segmentation Fault in mod_perl References: Message-ID: <00b801c0ad90$6012e200$0500a8c0@iwebx1> Basically the same system as you're running: Latest versions of apache, php, and mod_perl, on RedHat 7. I've seen this happen on Solaris boxes as well. Not sure what the cause is, but you can find lots of discussions about it on both the mod_perl email lists, and the php email lists. It's a known thingie. ======================================== John Cokos, President / CEO: iWeb Inc. http://www.iwebsys.com jcokos@ccs.net ======================================== ----- Original Message ----- From: "Stephen Nickels" To: "John Cokos, CEO, iWeb, Inc." Cc: "Richard Anderson" ; "Jonathan Gardner" ; ; "Colin Meyer" Sent: Thursday, March 15, 2001 11:42 AM Subject: Re: SPUG: Segmentation Fault in mod_perl > Wow, I've never seen this before. What versions are being run when you see > this problem? I spent a summer with a bunch of boxes running mod_perl and > php on apache, and never saw a problem. My home box runs linux 2.4.2, > apache 1.3.12, php 4.0.1pl2 and mod_perl 1.24 and I've never had a > mod_perl problem connecting to a database. > I'm curious to know where and how you get these problems so I can watch > for them in the future.... > > --Steve > > > On Thu, 15 Mar 2001, John Cokos, CEO, iWeb, Inc. wrote: > > > Although I'm not sure if this is related to the original > > problem, it's food for thought, nonetheless ..... > > > > I've noticed a quite serious problem when you have > > php and mod_perl both compiled into apache. The problems > > only arise when a mod_perl program attempts to > > connect to a database. At that point, mod_perl programs > > start throwing up Segfaults, and php scripts start returning > > no data at all. > > > > Definitely a bug somewhere, where these 2 technologies > > are bumping into each other's shared memory or something. > > > > I've found that in every case, turning php "off" always fixes > > the mod_perl problem. While not the best solution, it > > is the only solution when you're trying to do both. > > > > J- > > > > ======================================== > > John Cokos, President / CEO: iWeb Inc. > > http://www.iwebsys.com > > jcokos@ccs.net > > ======================================== > > ----- Original Message ----- > > From: "Richard Anderson" > > To: "John Cokos" ; "Jonathan Gardner" ; > > Cc: "Colin Meyer" > > Sent: Tuesday, May 15, 2001 9:14 AM > > Subject: Re: SPUG: Segmentation Fault in mod_perl > > > > > > > I've done a bit of work on search engines, and I have a couple of thoughts: > > > > > > John pointed us toward a few potentential minor syntax problems. The out-of-memory problem will pop up quite a bit if you are > > searching a large internap site like yahoo, yellowpages.com etc. and the search returns a lot of results. Imagine seaching the NYC > > phonebook for the string Smith! > > > > > > One try might be to use a more memory-efficient XML parser routine. Damian is probably a good resource on this (are you out > > there, mate?). > > > > > > Another approach is to limit your search to returning the first 50 results you find. If the user wants more results, add a link > > at the top and bottom of the page that takes him to results 51-100, and so on > > > > > > In future versions, you might consider ranking the results based on some goodness-of-fit criterion based on the search string. > > Word stemming and language dependencies are some more goodies to add. > > > Richard Anderson, Ph.D. www.unixscripts.com > > > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > > > Raycosoft, LLC Seattle, WA, USA > > > ----- Original Message ----- > > > From: "John Cokos" > > > To: "Jonathan Gardner" ; > > > Sent: Monday, March 12, 2001 8:06 PM > > > Subject: Re: SPUG: Segmentation Fault in mod_perl > > > > > > > > > > You're barking right up my tree here .... I do CGI > > > > work for a living, and work with mod_perl quite > > > > a bit. > > > > > > > > That being said, let me ask you a few preliminary > > > > questions: > > > > > > > > 1. The CGI Script that actually runs: is it mod_perl > > > > compliant, in terms of exit status, "use strict" compatability, > > > > etc? > > > > > > > > 2. How do you have httpd.conf setup to accept mod_perl > > > > programs? > > > > > > > > 3. Sounds like you're going through a lot of machinations > > > > to get XML output. Seems to me that a "from scratch" > > > > solution, or one that's designed from the outset to > > > > work within the confines of mod_perl would be better > > > > suited than to try and shoehorn in something else. > > > > > > > > Generally, coredumps from mod_perl are the result of > > > > "dirty" coding. A few variables out of place, or a bad > > > > exit status can kill it pretty quickly. > > > > > > > > John > > > > > > > > ----- Original Message ----- > > > > From: Jonathan Gardner > > > > To: > > > > Sent: Monday, March 12, 2001 4:16 PM > > > > Subject: SPUG: Segmentation Fault in mod_perl > > > > > > > > > > > > > Okay, run while you still can! > > > > > > > > > > We're running mod_perl on Apache. I am working on a module to > > > > > allow people to search our pages. > > > > > > > > > > I got ht://dig. This is a fine piece of software, and it works great. Ht://dig > > > > > has a program that works as a CGI script, and using the configuration files and > > > > > templates, you can configure almost anything you would like to. > > > > > > > > > > We want to really customize stuff, really really customize it. So I figured > > > > > we'd trick htdig to output XML, and use XML parser to parse it out, and then > > > > > take that and convert it into hashes and arrays and scalars we can use to fully > > > > > customize everything in Perl. > > > > > > > > > > Okay, so I wrote a module that takes the search parameters and returns a hash > > > > > with all the results stored inside. I wrote a test script that runs from the > > > > > command line and everything works beautifully. I am so happy I beam for joy! > > > > > > > > > > I plug it into Apache mod_perl and I get the dreaded segmentation fault. Not > > > > > just once, over and over again, almost every time I try to run it. > > > > > > > > > > The only hint I have is that perhaps it is an out-of-memory problem. This would > > > > > make sense. I have the program that consumes a lot of memory (the search), and > > > > > XML::Parser trying to pack everything into 'Tree' style. But it doesn't fail > > > > > during that - it fails when I start working on the tree with a couple of subs, > > > > > so if it WAS a memory problem shouldn't it fail during the XML parsing or > > > > > during the searching? How do I check to see how much memory the command-line > > > > > script uses? > > > > > > > > > > What do I do to find out the problem, short of putting a "warn" > > > > > between every line of code? How do I use the core dump - if it is useful at > > > > > all? What rotting nuggets of useful knowledge are lodged in the wisdom > > > > > teeth of the gurus, and could they use the toothbrush of the transfer of > > > > > knowledge to reveal those morsels to me? :-) > > > > > > > > > > -- > > > > > Jonathan Gardner > > > > > gardner@sounddomain.com > > > > > (425)820-2244 x123 > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > "When once you have tasted flight, you will forever walk > the Earth with your eyes turned skyward, for there you have been, > and there you will always long to return" > -Leonardo da Vinci > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From ced at carios2.ca.boeing.com Thu Mar 15 14:37:58 2001 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Dup'ing STDIN from DATA? Message-ID: <200103152037.MAA13219@carios2.ca.boeing.com> > A dup needs to adjust to DATA's start position. > my $start = tell DATA; # see where DATA is positioned initially > open(STDIN, "<&DATA") # comment-out after testing > or die "dup failed: $!"; > seek(STDIN, $start, 0) or die "can't seek"; # re-position to DATA start >... Above is true for 5.5 versions but several others others have pointed out that this'll work for 5.6 if DATA filehandle is opened in an INIT or a CHECK. The BEGIN won't work at all though: >From perldata: Note that you cannot read from the DATA filehandle in a BEGIN block: the BEGIN block is executed as soon as it is seen (during compilation), at which point the corresponding __DATA__ (or __END__) token has not yet been seen. Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tgy at chocobo.org Fri Mar 16 03:19:06 2001 From: tgy at chocobo.org (Tim Gim Yee) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Dup'ing STDIN from DATA? In-Reply-To: <20010315094354.A23981@timji.consultix.wa.com> Message-ID: On Thu, 15 Mar 2001, Tim Maher/CONSULTIX wrote: > I'm writing a little program that will eventually read input from > SDTIN, but initially I want to test it using the DATA filehandle. > I thought the following would work, but it doesn't; it just reads from > STDIN. Anybody know the way to accomplish this? > > #! /usr/bin/perl -wn > > BEGIN { > open STDIN, "<&DATA"; # comment-out after testing > } Reading from <>, maybe you want to dup ARGV instead of STDIN. BEGIN { @ARGV = '<&DATA' } > s/^(.*?:)//; > defined $1 and print "Extracted $1\n"; > > __DATA__ > Data: right here -- Tim Gim Yee tgy@chocobo.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Fri Mar 16 12:03:11 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Dup'ing STDIN from DATA? In-Reply-To: Message-ID: <52340000.984765791@flashingchance> -- Tim Gim Yee spake thusly: > On Thu, 15 Mar 2001, Tim Maher/CONSULTIX wrote: > >> I'm writing a little program that will eventually read input from >> SDTIN, but initially I want to test it using the DATA filehandle. >> I thought the following would work, but it doesn't; it just reads >> from STDIN. Anybody know the way to accomplish this? >> >> #! /usr/bin/perl -wn >> >> BEGIN { >> open STDIN, "<&DATA"; # comment-out after testing >> } > > Reading from <>, maybe you want to dup ARGV instead of STDIN. > > BEGIN { @ARGV = '<&DATA' } You're talking nonsense here. This would place '<&DATA' into the array @ARGV, which would presumably cause Perl to try to open an actual file named '<&DATA' when it got to 'while (<>)'. I haven't even tried this, and I'd be shocked if it did anything like what you expect. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20010316/7ac9a1fd/attachment.bin From tim at consultix-inc.com Fri Mar 16 13:20:41 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Basic Perl class next week, Kirkland Message-ID: <20010316112041.A8665@timji.consultix.wa.com> SPUGsters, Please pardon a quick commercial message that's directly relevant to many readers of this group. -Tim Maher ------------------------------------------- Course Dates Days Basic Perl + Modules 3/20-3/23 4 ------------------------------------------- Just a quick note to let you know that the basic Perl class I'm teaching next week still has some room left. Given my heavy Spring/Summer schedule of Geek Cruises, OpenSource Conferences, and international YAPC Conferences, this will probably be the last public offering of this class in the Seattle area until September. So if anybody is interested in attending, please get in touch with me soon! More details at: http://www.consultix-inc.com/perl.html COURSE DESCRIPTION: Perl Programming, plus Modules This lecture/lab course consists of three days of basic Perl training, followed by an additional day showing students how to exploit the efforts of other programmers by using the rich collection of "Perl Modules" (like "libraries" in other languages) that are freely available on the Internet. This class is for those who already know some other programming language, and UNIX, and who wish to write custom programs using Perl, a powerful and versatile language that has come to be known as "the duct tape of the Internet". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CONSULTIX ON-LINE RESOURCES General Consultix information: http://www.consultix-inc.com/ On-Site training information: http://www.consultix-inc.com/on-site.html Course Listings: UNIX/Shell, http://www.consultix-inc.com/unixlist.html Perl, http://www.consultix-inc.com/perllist.html Registration and Pricing: http://www.consultix-inc.com/reg.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Course Evaluations: http://www.consultix-inc.com/course_evals.html *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Fri Mar 16 14:27:48 2001 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Dup'ing STDIN from DATA? References: <52340000.984765791@flashingchance> Message-ID: <3AB27744.D232EFC6@activestate.com> Matt Tucker wrote: > > -- Tim Gim Yee spake thusly: > > > On Thu, 15 Mar 2001, Tim Maher/CONSULTIX wrote: > > > >> I'm writing a little program that will eventually read input from > >> SDTIN, but initially I want to test it using the DATA filehandle. > >> I thought the following would work, but it doesn't; it just reads > >> from STDIN. Anybody know the way to accomplish this? > >> > >> #! /usr/bin/perl -wn > >> > >> BEGIN { > >> open STDIN, "<&DATA"; # comment-out after testing > >> } > > > > Reading from <>, maybe you want to dup ARGV instead of STDIN. > > > > BEGIN { @ARGV = '<&DATA' } > > You're talking nonsense here. This would place '<&DATA' into the array > @ARGV, which would presumably cause Perl to try to open an actual file > named '<&DATA' when it got to 'while (<>)'. I haven't even tried this, > and I'd be shocked if it did anything like what you expect. Well it makes sense to me. And it does work. I know this because I actually *did* try it before I went and flamed you for flaming someone as bright as TGY. I'm actually shocked that you would post this *without* trying it. So this works: (No BEGIN block needed) ----8<---- #! /usr/bin/perl -w @ARGV = '<&DATA'; while (<>) { print } __DATA__ one little two little three little indians ----8<---- and this also works: (BEGIN Required. Note -p flag which is similar (but prints $_ automatically) to the -n that Tim Maher originally wanted to use) ----8<---- #! /usr/bin/perl -pw BEGIN { @ARGV = '<&DATA' } s/little/big/; s/indian/idiot/; __DATA__ one little two little three little indians ----8<---- BTW, This only works with 5.6.0+ (The *real* Perl ;) Cheers, Brian -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tuck at whistlingfish.net Fri Mar 16 15:05:08 2001 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Dup'ing STDIN from DATA? In-Reply-To: <3AB27744.D232EFC6@activestate.com> Message-ID: <38780000.984776708@benzene> -- Brian Ingerson spake thusly: >> You're talking nonsense here. This would place '<&DATA' into the >> array @ARGV, which would presumably cause Perl to try to open an >> actual file named '<&DATA' when it got to 'while (<>)'. I haven't >> even tried this, and I'd be shocked if it did anything like what you >> expect. > > Well it makes sense to me. And it does work. I know this because I > actually *did* try it before I went and flamed you for flaming someone > as bright as TGY. I'm actually shocked that you would post this > *without* trying it. Wow. I am shocked (as I said I'd be). Although it does make sense in a way, it's still odd. My apologies to Tim for mouthing off without actually checking my facts. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20010316/4784751c/attachment.bin From dcd at tc.fluke.com Fri Mar 16 15:13:12 2001 From: dcd at tc.fluke.com (David Dyck) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Dup'ing STDIN from DATA? In-Reply-To: <3AB27744.D232EFC6@activestate.com> Message-ID: On Fri, 16 Mar 2001, Brian Ingerson wrote: > BTW, This only works with 5.6.0+ (The *real* Perl ;) Maybe there's a bug in bleading edge perl 5.7.0 but to get the scripts you're talking about to work I had to add the call to tell(). (I submitted this bug via perlbug) --- script 1 #! /usr/bin/perl -w if ($] > 5.006) { tell(DATA) || die "tell:$!"; } @ARGV = '<&DATA'; while (<>) { print } __DATA__ one little two little three little indians --- end script 1 --- script 2 #! /usr/bin/perl -pw INIT { if ($] > 5.006) { tell(DATA) || die "tell:$!"; } } BEGIN { @ARGV = '<&DATA' } s/little/big/; s/indian/idiot/; __DATA__ one little two little three little indians --- end script 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Sat Mar 17 14:25:37 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Happy Birthday to SPUG! Message-ID: <20010317122537.A1423@timji.consultix.wa.com> SPUGsters, Just a quick note to commemorate the fact that this group was born 3 years ago today, at a meeting at a community center in Ballard. While contemplating my life atop a smoke-spewing volcano in Java, Indonesia a few weeks earlier, I had resolved to try to establish a local community to support those using this fantastic language. I wasn't sure if anybody would show up to that inaugural meeting, but as it happened, about two dozen gave up their inalienable rights as Americans to drink Green Beer and attended this meeting instead (or perhaps before!). There are hundreds of Perl groups now, but at the time, SPUG was only the sixth ever formed. (Incidentally, this is why we've retained the SPUG moniker, despite the fact that later groups came to be know by "Perl Monger" appellations.) Thanks to all those who've participated in making SPUG a success! (Actually, by all accounts, we're the MOST successful and productive Perl group on the planet.) In particular, please join me in thanking Winstar Northwest Nexus, our web-page sponsor, the folks at N2H2, especially Andy Sweger, who provide our meeting space, and of course Damian Conway ("The Damian"), who frequently ventures halfway across the globe to inspire and terrify us with his strangely deranged yet magical Perl musings. For those of you who are interested in contributing to the group, there are many ways to do so. We are always looking for speakers for upcoming meetings who can teach us something about the Perl language or describe interesting Perl applications they've discovered or written, so if you'd like to make a presentation, get in touch with me. I'm also looking for volunteers to help with other tasks, like recruiting speakers, maintaining the web page, coordinating job-ads, setting up additional internet-based services, coordinating joint software development activities, etc. This is our group, and we can do whatever we want with it, so if anybody has suggestions about improvements, especially if you're willing to help implement them, let me know! Happy SPUG-Patrick's Day! ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From bill at celestial.com Sat Mar 17 14:44:09 2001 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: <00e901c0df01$607ed4e0$1b88ddd1@aci2>; from Richard.Anderson@raycosoft.com on Wed, May 16, 2001 at 06:28:44PM -0700 References: <00e901c0df01$607ed4e0$1b88ddd1@aci2> Message-ID: <20010317124409.A4792@barryg.mi.celestial.com> On Wed, May 16, 2001 at 06:28:44PM -0700, Richard Anderson wrote: >Does anyone have comments for Mike? I think this would do it (assuming that the job is to resort the array in place). sub uniq { my %work = map{$_, 1} @_; @_ = (keys %work); } >Richard Anderson, Ph.D. www.unixscripts.com >Perl / Oracle / Unix Richard.Anderson@raycosoft.com >Raycosoft, LLC Seattle, WA, USA >----- Original Message ----- >From: "Mike" >To: "Richard Anderson" >Sent: Friday, March 16, 2001 2:12 PM >Subject: Uniq in perl > > >> This is something I had sitting around. I didn't write it. Its a subroutine >> that uniqs an array. I was just wondering if this is the best way to do it >> or if anyone has any thing better. Thanks >> >> >> ## Usage: &uniq( \@ARRAY ); >> sub uniq { >> my (@uwork, @unew, $uname); >> @uwork = @{$_[0]}; >> @uwork = sort( @uwork ); >> @unew = ( shift @uwork ); >> >> foreach $uname ( @uwork ) { >> @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); >> } >> >> @{$_[0]}=@unew; >> } >> >> :wq >> >> > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > -- 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/ Once at a social gathering, Gladstone said to Disraeli, ``I predict, Sir, that you will die either by hanging or of some vile disease''. Disraeli replied, "That all depends upon whether I embrace your principles or your mistress". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jimfl at colltech.com Sat Mar 17 14:52:37 2001 From: jimfl at colltech.com (Jim Flanagan) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: <00e901c0df01$607ed4e0$1b88ddd1@aci2> Message-ID: The most concise way is to make a hash with each of the elements of the list as keys, like this: for (@list) { $uniq{$_} = 1; } @uniq = keys %uniq; Alternatively, if you want to emulate the behavior of 'uniq -c' (which counts the number of occurrances, you can do: for (@list) {$occurances{$_}++;} on 5/16/01 5:28 PM, Richard Anderson at Richard.Anderson@raycosoft.com wrote: > Does anyone have comments for Mike? > > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA > ----- Original Message ----- > From: "Mike" > To: "Richard Anderson" > Sent: Friday, March 16, 2001 2:12 PM > Subject: Uniq in perl > > >> This is something I had sitting around. I didn't write it. Its a subroutine >> that uniqs an array. I was just wondering if this is the best way to do it >> or if anyone has any thing better. Thanks >> >> >> ## Usage: &uniq( \@ARRAY ); >> sub uniq { >> my (@uwork, @unew, $uname); >> @uwork = @{$_[0]}; >> @uwork = sort( @uwork ); >> @unew = ( shift @uwork ); >> >> foreach $uname ( @uwork ) { >> @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); >> } >> >> @{$_[0]}=@unew; >> } -- Jim Flanagan Collective Technologies jimfl@colltech.com http://www.colltech.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From andy at n2h2.com Sat Mar 17 20:58:35 2001 From: andy at n2h2.com (Andrew Sweger) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Happy Birthday to SPUG! In-Reply-To: <20010317122537.A1423@timji.consultix.wa.com> Message-ID: Happy Birthday! And thank _you_! I recall that it was very warm in that community center. Only three years? Seems longer. On Mar 17, 2001 @ 12:25pm, Tim Maher/CONSULTIX wrote: > Just a quick note to commemorate the fact that this group was born > 3 years ago today, at a meeting at a community center in Ballard. > While contemplating my > life atop a smoke-spewing volcano in Java, Indonesia a few weeks > earlier, I had resolved to try to establish a local community > to support those using this fantastic language. I wasn't sure > if anybody would show up to that inaugural meeting, but as it > happened, about two dozen gave up their inalienable rights as > Americans to drink Green Beer and attended this meeting instead > (or perhaps before!). There are hundreds of Perl groups now, but > at the time, SPUG was only the sixth ever formed. (Incidentally, > this is why we've retained the SPUG moniker, despite the fact > that later groups came to be know by "Perl Monger" appellations.) -- Andrew B. Sweger | N2H2, Incorporated Manager, ICE Development Dept | 900 Fourth Avenue, Suite 3400 Content Management Division | Seattle WA 98164-1059 v=206.336.2947 f=206.493.0906 | http://www.n2h2.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From BrianI at activestate.com Sun Mar 18 22:44:38 2001 From: BrianI at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl References: <00e901c0df01$607ed4e0$1b88ddd1@aci2> Message-ID: <3AB58EB6.3020607@ActiveState.com> sub uniq { sort keys %{{ map {($_, 1)} @{$_[0]} }} } Richard Anderson wrote: > Does anyone have comments for Mike? > > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA > ----- Original Message ----- > From: "Mike" > To: "Richard Anderson" > Sent: Friday, March 16, 2001 2:12 PM > Subject: Uniq in perl > > > >> This is something I had sitting around. I didn't write it. Its a subroutine >> that uniqs an array. I was just wondering if this is the best way to do it >> or if anyone has any thing better. Thanks >> >> >> ## Usage: &uniq( \@ARRAY ); >> sub uniq { >> my (@uwork, @unew, $uname); >> @uwork = @{$_[0]}; >> @uwork = sort( @uwork ); >> @unew = ( shift @uwork ); >> >> foreach $uname ( @uwork ) { >> @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); >> } >> >> @{$_[0]}=@unew; >> } >> >> :wq >> >> > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Mon Mar 19 01:47:53 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Re: Happy Birthday to SPUG! In-Reply-To: <00fa01c0e01c$269ad000$1f88ddd1@aci2>; from Richard Anderson on Fri, May 18, 2001 at 09:28:17PM -0700 References: <20010317122537.A1423@timji.consultix.wa.com> <00fa01c0e01c$269ad000$1f88ddd1@aci2> Message-ID: <20010318234753.A3809@timji.consultix.wa.com> On Fri, May 18, 2001 at 09:28:17PM -0700, Richard Anderson wrote: >At the risk of starting a flame war, I would like to differ with >Tim's statement that "this is our group". Actually, Tim has veto >power over all SPUG decisions, as he controls the web site and >mailing list. It's true, I do exercise "Supreme Control" over these things, but I try to exercise that in a *benevolent* manner. For example, I have always sought opinions from the membership (the SPUG-list subscribers) on important decisions. You may recall that, for example, we have had email-voting for different prospective meeting locations in the past, which dictated the final outcome. On the other hand, I've never asked for anybody's opinion about whether or not I should book Damian Conway as a speaker. I wouldn't see any point in polling the membership or having a special Board Meeting to decide such a thing - that's a decision I can make on my own, on the basis of what I think is best for the group. >Tim has exercised his veto power in the past. (I >have transgressed his rules twice now and been flamed by him for >doing so - details available upon request). I'm not saying that I'm sorry if you felt "flamed"; my recollection was more along the lines of a mild rebuke, along with a statement of policy. I'm acutely aware of the personality conflict between us; perhaps that's affecting your recollections. >this is a bad thing, as no one is more qualified than Tim in terms >of time, expertise and motivation to lead the group. However, Thanks for throwing me a crumb 8-} >if Tim wants others to begin putting significant amounts of effort >into running the group, I think he should consider sharing some >of the executive authority. Methods for doing this might include I'm not aware of any current shortcomings in the group that could be alleviated by adding additional decision-makers and layers of bureaucracy, or any significant new benefits that such changes might allow. My overall impression is that most members are perfectly content with things the way they are, and that the last thing on their minds is finding ways to slow down decision making and increase administrivia. But if I'm misreading the feeling out there, please speak up and let us know! >bylaws (which would legitimize our nebulous tax-exempt status), >electing a board of directors, etc., etc. This may not be >appropriate for the free-wheeling nature of a Perl users group. I'm proud to say that I'm not a lawyer, but AFAIK, there's absolutely *nothing* nebulous about our tax-exempt status; IMHO, it couldn't be more secure. Although we've never had a Board of Directors, the major decisions have always been reached through deliberations with core members. Back in '98, these included (the late) Marty Cudmore, Matthew Bustad, Andy Sweger, Greg Heil, Sandy Morton, and others. This past December, a more current core-group of members assembled for a "Steering Committee" meeting, in which we reviewed the past year and talked about goals for the future. (One outgrowth of that meeting was the decision to focus more on beginning-level topics in a percentage of future meetings.) >I recall that the group that originally set up the www.perl.org >web site fell apart after too much bickering on process. Perhaps >SPUG could adopt the model of the group that spawned it three years >ago: the Seattle Unix Users Group: a board of directors that meets ** Huh? What history books have you been reading? ** The Seattle UNIX Users Group had *ABSOLUTELY NOTHING TO DO* with the formation of SPUG! I did get lots of ideas about "alternative ways of doing things" by attending its meetings and serving on its Board of Directors, and some early SPUGsters were also affiliated with SLUG, but as I've related previously, I got the SPUG idea on top of a volcano in SE Asia (no kidding!) and started the group on my return to Seattle. It is *entirely misleading* to say that SLUG "spawned" SPUG, and, if you'll pardon me for saying so, such a view unfairly diminishes my initial contribution. (Now, Richard, I suppose you'll accuse me of flaming you again, but I'm just setting the record straight on a factual matter; this job doesn't pay much 8-}, so I hope you'll excuse me for insisting on at least getting the credit for starting the group! Sheesh!) >once a month or quarterly at a time and place separated from the >general meeting. This would keep the general meeting focused on >teaching / learning Perl, which is what the organization is all >about, yet create a forum where those (like myself) with beefs >can air them without disrupting the general meeting. > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Java / Oracle / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA I'm all for the provision of "beefing venues", and the solicitation of constructive criticism and frequent feedback. However, as this exchange clearly shows, the list seems to be doing a pretty good job of providing these services! I think you're proposing solutions that don't have corresponding problems. E.g., what significant benefits can we hope to obtain by electing officers and holding more meetings? Okay, at least one person (you) might feel a greater feeling of ownership in the group, but would the ensuing benefits be worth the costs of such a change in structure? I wonder. What do the rest of you members think? -Tim ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From moonbeam at catmanor.com Mon Mar 19 03:01:01 2001 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Re: Happy Birthday to SPUG! In-Reply-To: Mail from 'Tim Maher/CONSULTIX ' dated: Mon, 19 Mar 2001 00:32:43 -0800 Message-ID: <200103190901.BAA10806@catmanor.com> > >On Mon, Mar 19, 2001 at 12:15:29AM -0800, William Julien wrote: >> >> You are right on the mark. The last thing that the "silent majority" >> wants is an increased bureaucracy. The surfs out here in perl land >> are very happy with your *benevolent* leadership. > >Thanks for the show of support, VI-Bill! I only wish you had posted >your message to the group, rather than privately to me, so Richard >can see that he's in the minority. > >-Tim I had meant to post to the group. (Doh!) Thanks for CC'ing my message. I can't tell you how much benifit your classes and this forum has benifited me. I have recieved two major awards for my perl cgi/dbi work in the last year. This is a direct result of this successful forum, your teaching and leadership. We are behind you. Go Tim Go! William Julien _,'| _.-''``-...___..--'; moonbeam@catmanor.com /, \'. _..-' , ,--...--''' vi is my shepherd; < \ .`--''' ` /| i shall not font. `-,;' ; ; ; __...--'' __...--_..' .;.' (,__....----''' (,..--'' perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);' perl -e '( $ ,, $ ")=("a".."z")[0,-1]; print "sh", $ ","m\n";;";;"' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From RHackman at ese.washington.edu Mon Mar 19 10:44:12 2001 From: RHackman at ese.washington.edu (Rebecca Hackman) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: UW Perl Course Message-ID: Dear SPUG members: Interested in developing your Perl skills by taking an exciting Perl class at the University of Washington this spring? We have a few spaces left in our "Perl and the World Wide Web" course, taught by Joel Grow (Software Development Engineer, Amazon.com) and Brian Aker (Senior Slashdot Architect, VA Linux Systems). This is the third course in our UW Certificate Program in Perl Programming and is open to individuals on a space-available basis who want to take the course without pursuing the certificate. By the end of the course you will have a solid understanding of these topics: * HTML, HTTP, CGI, SSL * Using CGI.pm * Persistence on the WWW * SQL and DBI.pm * Apache and mod_perl * XML, RSS, and SOAP * Real-world web site design This is an advanced course. To succeed you'll need to arrive with strong Perl skills and a basic understanding of these topics: * Basic data types: scalars, arrays, and hashes * Control structures, loops, and blocks * Regular expressions * Subroutines * I/O and file and directory functions * Understanding and using scope * DBM files * References and complex data structures * Object-oriented programming The course is held in downtown Seattle on Monday evenings from 6-9 pm beginning Monday, March 26th. The course fee is $545.00 plus a $30.00 registration fee. For further information, please call me at (206) 221-6243 or send me email at rhackman@ese.washington.edu. There is also information about the course here: http://www.outreach.washington.edu/extinfo/certprog/per/per_main.asp Best regards, Rebecca Hackman Academic Programs University of Washington Educational Outreach 5001 25th Avenue NE, Seattle, WA 98105-4190 rhackman@ese.washington.edu (206) 221-6243 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From BrianI at activestate.com Mon Mar 19 10:50:20 2001 From: BrianI at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Re: Happy Birthday to SPUG! References: <20010317122537.A1423@timji.consultix.wa.com> <00fa01c0e01c$269ad000$1f88ddd1@aci2> <20010318234753.A3809@timji.consultix.wa.com> Message-ID: <3AB638CC.80302@ActiveState.com> Tim Maher/CONSULTIX wrote: > On Fri, May 18, 2001 at 09:28:17PM -0700, Richard Anderson wrote: >> At the risk of starting a flame war, I would like to differ with >> Tim's statement that "this is our group". Actually, Tim has veto >> power over all SPUG decisions, as he controls the web site and >> mailing list. > It's true, I do exercise "Supreme Control" over these things, but > I try to exercise that in a *benevolent* manner. For example, I > have always sought opinions from the membership (the SPUG-list > subscribers) on important decisions. You may recall that, for It's a tricky business trying to lead a group of people with different ideas and agendas down a road that best fits the needs of the group as a whole. I have similar issues on the Inline mailing list. I want everyone involved to have a say on how Inline progresses, but at the end of the day, I'm the one who knows what's best for the project. Perhaps, in a strict sense, it was misleading for Tim to say: > This is our group, and we can do whatever we want with it, so if > anybody has suggestions about improvements, especially if you're > willing to help implement them, let me know! But I would have said the same thing in his shoes. I think Tim has done an admirable job of sheparding this bunch of rogue geeks down a pretty righteous path. Happy birthday, SPUG! Cheers, Brian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From davidpa at avaya.com Mon Mar 19 10:49:47 2001 From: davidpa at avaya.com (Patterson, David S (Pat)) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Re: Happy Birthday to SPUG Message-ID: If there is anyone in the local Perl user community aspiring to a leadership position who feels that they've been eclipsed from making as much of a contribution as they would like, I'll remind you that ESPUG could always use more organizing talent and energy... > --- "Programmer - A red-eyed, mumbling mammal capable of conversing with inanimate objects..." > D. S. "Pat" Patterson > Software Engineer > Avaya, Inc. > 6464 185th Ave NE > Redmond, WA 98052-6736 > 425-558-8672 > 888-501-4835 Pgr > davidpa@avaya.com > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Mon Mar 19 11:01:26 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: UW Perl Course In-Reply-To: ; from Rebecca Hackman on Mon, Mar 19, 2001 at 08:44:12AM -0800 References: Message-ID: <20010319090126.B8699@timji.consultix.wa.com> On Mon, Mar 19, 2001 at 08:44:12AM -0800, Rebecca Hackman wrote: > > Dear SPUG members: > > Interested in developing your Perl skills by taking an exciting Perl class > at the University of Washington this spring? We have a few spaces left in > our "Perl and the World Wide Web" course, taught by Joel Grow (Software > Development Engineer, Amazon.com) and Brian Aker (Senior Slashdot Architect, > VA Linux Systems). This is the third course in our UW Certificate Program > in Perl Programming and is open to individuals on a space-available basis > who want to take the course without pursuing the certificate. I have one point to add: the aforementioned Joel Grow is our planned SPUG speaker for the "Beginner's Night" meeting on April 17th, so those interested in getting a taste of his talents, prior to enrolling in a subsequent offering of his UW Perl course, can do so on that night. -Tim ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Mon Mar 19 11:10:02 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl Message-ID: Here is a solution based on hash slices: sub uniq { my %hash ; @hash{@_} = 1 ; sort keys %hash ; } If you dislike the "my" you might prefer: sub uniq { @_{@_) = 1 ; sort keys %_ ; } Asim -----Original Message----- From: Brian Ingerson [mailto:BrianI@activestate.com] Sent: Sunday, March 18, 2001 8:45 PM To: Richard Anderson Cc: spug; shivan@ici.net Subject: Re: SPUG: Fw: Uniq in perl sub uniq { sort keys %{{ map {($_, 1)} @{$_[0]} }} } Richard Anderson wrote: > Does anyone have comments for Mike? > > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA > ----- Original Message ----- > From: "Mike" > To: "Richard Anderson" > Sent: Friday, March 16, 2001 2:12 PM > Subject: Uniq in perl > > > >> This is something I had sitting around. I didn't write it. Its a subroutine >> that uniqs an array. I was just wondering if this is the best way to do it >> or if anyone has any thing better. Thanks >> >> >> ## Usage: &uniq( \@ARRAY ); >> sub uniq { >> my (@uwork, @unew, $uname); >> @uwork = @{$_[0]}; >> @uwork = sort( @uwork ); >> @unew = ( shift @uwork ); >> >> foreach $uname ( @uwork ) { >> @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); >> } >> >> @{$_[0]}=@unew; >> } >> >> :wq >> >> > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From algard at cardomain.com Mon Mar 19 11:53:45 2001 From: algard at cardomain.com (Alex Algard) Date: Wed Aug 4 00:07:56 2004 Subject: FW: SPUG: Re: Happy Birthday to SPUG! Message-ID: > I'm also looking for volunteers to help > with other tasks, like recruiting speakers, maintaining the web > page, coordinating job-ads, setting up additional internet-based > services, coordinating joint software development activities, etc. If there's more structure in terms of creating official positions within SPUG, then certain people (myself not included though :) ) may feel more inclined to contribute and may feel that they have more purpose (e.g. Dir. of Speaking Engagements, Dir. of Publicity, Social Coordinator, Recruiting Liaison, Sys Admin, etc.), just like in any organization. You'll have a much easier time recruiting "volunteers" that way. Based on the attendance that I observed at a couple of meetings last year, maybe we could do a better job at getting the word out about our existence to the 1000+ Puget Sound Perl coders out there, so that we can all benefit from the collective Perl brain power here (or maybe it's just that their attendance is as flaky as mine). Then on the other hand, it seems like SPUG is doing well with little politics/bickering with most authority vested in Tim, so maybe if it ain't broken, don't fix it... Just my $0.02. ________________________ Alex Algard CarDomain Networks, Inc. http://www.cardomain.net 425-820-2244 x111 | fax: 425-820-5951 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From matthew.bustad at onebox.com Mon Mar 19 12:19:26 2001 From: matthew.bustad at onebox.com (Matthew Bustad) Date: Wed Aug 4 00:07:56 2004 Subject: FW: SPUG: Re: Happy Birthday to SPUG! Message-ID: <20010319181926.QIUR281.mta09.onebox.com@onebox.com> > -----Original Message----- > From: Tim Maher/CONSULTIX [mailto:tim@consultix-inc.com] ... > What do the rest of you members think? Mgmt meetings are held before and after every meeting over "Adult Beverages". If God wanted lines longer than 80 chars, he would have created a wider vt100. Thank you Tim for all your work. -Matthew.Bustad __________________________________________________ FREE voicemail, email, and fax...all in one place. Sign Up Now! http://www.onebox.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Mon Mar 19 14:22:38 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <005501c0a900$4c016d70$200516ac@esca.com>; from Alex.Leites@esca.com on Fri, Mar 09, 2001 at 05:20:30PM -0800 References: <005501c0a900$4c016d70$200516ac@esca.com> Message-ID: <20010319122238.A20003@ero.com> On Fri, Mar 09, 2001 at 05:20:30PM -0800, Alex Leites wrote: > What's wrong with: > > join ',', map( "$_:$ids{$_}", keys %ids > > Do you care about the order? If you do, just add a sort. dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jeff at planetoid.net Mon Mar 19 14:35:47 2001 From: jeff at planetoid.net (jeff saenz) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl References: <00e901c0df01$607ed4e0$1b88ddd1@aci2> Message-ID: <3AB66DA3.642EF3F2@planetoid.net> What if you convert the array values to hash keys and let the hash eliminate the duplicates? Something like: @hash{@array} = (); or maybe a map. but i think maps are inefficient. something like that. Richard Anderson wrote: > Does anyone have comments for Mike? > > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA > ----- Original Message ----- > From: "Mike" > To: "Richard Anderson" > Sent: Friday, March 16, 2001 2:12 PM > Subject: Uniq in perl > > > This is something I had sitting around. I didn't write it. Its a subroutine > > that uniqs an array. I was just wondering if this is the best way to do it > > or if anyone has any thing better. Thanks > > > > > > ## Usage: &uniq( \@ARRAY ); > > sub uniq { > > my (@uwork, @unew, $uname); > > @uwork = @{$_[0]}; > > @uwork = sort( @uwork ); > > @unew = ( shift @uwork ); > > > > foreach $uname ( @uwork ) { > > @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); > > } > > > > @{$_[0]}=@unew; > > } > > > > :wq > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Mon Mar 19 15:15:30 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: hashes, arrays, map, join In-Reply-To: <20010319122238.A20003@ero.com>; from dean@ero.com on Mon, Mar 19, 2001 at 12:22:38PM -0800 References: <005501c0a900$4c016d70$200516ac@esca.com> <20010319122238.A20003@ero.com> Message-ID: <20010319131530.A29770@ero.com> Not sure where this came from, it's a bit old eh? On Mon, Mar 19, 2001 at 12:22:38PM -0800, Dean Hudson wrote: > On Fri, Mar 09, 2001 at 05:20:30PM -0800, Alex Leites wrote: > > What's wrong with: > > > > join ',', map( "$_:$ids{$_}", keys %ids > > > > Do you care about the order? > > If you do, just add a sort. > > dean. > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From billa at willapabay.org Mon Mar 19 17:58:05 2001 From: billa at willapabay.org (Bill Alford) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: <3AB66DA3.642EF3F2@planetoid.net> Message-ID: All the solutions I've seen so far look good for treating the list as a set (I may have missed one that didn't). But, from the uniq man page: Discard all but one of successive identical lines from INPUT (or standard input), writing to OUTPUT (or standard output). It looks like that's what's happening below. Here's what I can come up with (not tested and a little verbose, but I like verbose :) : sub uniq { if (! @_) { return @_; # for the empty set case } my $last = shift; my @result = ( $last ); my $cur; foreach $cur ( @_ ) { # assuming string input if ($cur ne $last) { $last = $cur; push(@result,$cur); } } return @result; } On Mon, 19 Mar 2001, jeff saenz wrote: > What if you convert the array values to hash keys and let the hash eliminate the > duplicates? Something like: > > @hash{@array} = (); > or maybe a map. but i think maps are inefficient. something like that. > > Richard Anderson wrote: > > > Does anyone have comments for Mike? > > > > Richard Anderson, Ph.D. www.unixscripts.com > > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > > Raycosoft, LLC Seattle, WA, USA > > ----- Original Message ----- > > From: "Mike" > > To: "Richard Anderson" > > Sent: Friday, March 16, 2001 2:12 PM > > Subject: Uniq in perl > > > > > This is something I had sitting around. I didn't write it. Its a subroutine > > > that uniqs an array. I was just wondering if this is the best way to do it > > > or if anyone has any thing better. Thanks > > > > > > > > > ## Usage: &uniq( \@ARRAY ); > > > sub uniq { > > > my (@uwork, @unew, $uname); > > > @uwork = @{$_[0]}; > > > @uwork = sort( @uwork ); > > > @unew = ( shift @uwork ); > > > > > > foreach $uname ( @uwork ) { > > > @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); > > > } > > > > > > @{$_[0]}=@unew; > > > } > > > > > > :wq > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From billa at willapabay.org Mon Mar 19 17:59:53 2001 From: billa at willapabay.org (Bill Alford) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: Message-ID: Ooops, that argument was an array reference, not the full array. Just change as appropriate below. On Mon, 19 Mar 2001, Bill Alford wrote: > All the solutions I've seen so far look good for treating the list as a > set (I may have missed one that didn't). But, from the uniq man page: > > Discard all but one of successive identical lines from > INPUT (or standard input), writing to OUTPUT (or standard > output). > > It looks like that's what's happening below. > > Here's what I can come up with (not tested and a little verbose, but I > like verbose :) : > > sub uniq { > if (! @_) { > return @_; # for the empty set case > } > my $last = shift; > my @result = ( $last ); > my $cur; > > foreach $cur ( @_ ) { > # assuming string input > if ($cur ne $last) { > $last = $cur; > push(@result,$cur); > } > } > return @result; > } > > > > On Mon, 19 Mar 2001, jeff saenz wrote: > > > What if you convert the array values to hash keys and let the hash eliminate the > > duplicates? Something like: > > > > @hash{@array} = (); > > or maybe a map. but i think maps are inefficient. something like that. > > > > Richard Anderson wrote: > > > > > Does anyone have comments for Mike? > > > > > > Richard Anderson, Ph.D. www.unixscripts.com > > > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > > > Raycosoft, LLC Seattle, WA, USA > > > ----- Original Message ----- > > > From: "Mike" > > > To: "Richard Anderson" > > > Sent: Friday, March 16, 2001 2:12 PM > > > Subject: Uniq in perl > > > > > > > This is something I had sitting around. I didn't write it. Its a subroutine > > > > that uniqs an array. I was just wondering if this is the best way to do it > > > > or if anyone has any thing better. Thanks > > > > > > > > > > > > ## Usage: &uniq( \@ARRAY ); > > > > sub uniq { > > > > my (@uwork, @unew, $uname); > > > > @uwork = @{$_[0]}; > > > > @uwork = sort( @uwork ); > > > > @unew = ( shift @uwork ); > > > > > > > > foreach $uname ( @uwork ) { > > > > @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); > > > > } > > > > > > > > @{$_[0]}=@unew; > > > > } > > > > > > > > :wq > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Mon Mar 19 18:54:48 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: ; from billa@willapabay.org on Mon, Mar 19, 2001 at 03:59:53PM -0800 References: Message-ID: <20010319165448.B26305@ero.com> this may make -w complain but: @out = grep {!/^$last$/ and $last = $_} @in; behaves like uniq; it only gets rid of adjacent duplicated lines. dean. On Mon, Mar 19, 2001 at 03:59:53PM -0800, Bill Alford wrote: > Ooops, that argument was an array reference, not the full array. Just > change as appropriate below. > > On Mon, 19 Mar 2001, Bill Alford wrote: > > > All the solutions I've seen so far look good for treating the list as a > > set (I may have missed one that didn't). But, from the uniq man page: > > > > Discard all but one of successive identical lines from > > INPUT (or standard input), writing to OUTPUT (or standard > > output). > > > > It looks like that's what's happening below. > > > > Here's what I can come up with (not tested and a little verbose, but I > > like verbose :) : > > > > sub uniq { > > if (! @_) { > > return @_; # for the empty set case > > } > > my $last = shift; > > my @result = ( $last ); > > my $cur; > > > > foreach $cur ( @_ ) { > > # assuming string input > > if ($cur ne $last) { > > $last = $cur; > > push(@result,$cur); > > } > > } > > return @result; > > } > > > > > > > > On Mon, 19 Mar 2001, jeff saenz wrote: > > > > > What if you convert the array values to hash keys and let the hash eliminate the > > > duplicates? Something like: > > > > > > @hash{@array} = (); > > > or maybe a map. but i think maps are inefficient. something like that. > > > > > > Richard Anderson wrote: > > > > > > > Does anyone have comments for Mike? > > > > > > > > Richard Anderson, Ph.D. www.unixscripts.com > > > > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > > > > Raycosoft, LLC Seattle, WA, USA > > > > ----- Original Message ----- > > > > From: "Mike" > > > > To: "Richard Anderson" > > > > Sent: Friday, March 16, 2001 2:12 PM > > > > Subject: Uniq in perl > > > > > > > > > This is something I had sitting around. I didn't write it. Its a subroutine > > > > > that uniqs an array. I was just wondering if this is the best way to do it > > > > > or if anyone has any thing better. Thanks > > > > > > > > > > > > > > > ## Usage: &uniq( \@ARRAY ); > > > > > sub uniq { > > > > > my (@uwork, @unew, $uname); > > > > > @uwork = @{$_[0]}; > > > > > @uwork = sort( @uwork ); > > > > > @unew = ( shift @uwork ); > > > > > > > > > > foreach $uname ( @uwork ) { > > > > > @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); > > > > > } > > > > > > > > > > @{$_[0]}=@unew; > > > > > } > > > > > > > > > > :wq > > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From starfire at zipcon.net Mon Mar 19 19:14:08 2001 From: starfire at zipcon.net (starfire) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Portable way to get local time zone Message-ID: What is a portable way to get the local timezone from within a mod_perl module? I see that on Linux 2.2.16 I can do "ls -l /etc/localtime" and on Solaris 2.7 I can do "tail -1 /etc/TIMEZONE", but I want something that is portable. The $TZ variable does not seem to be set in my mod_perl program's environment ... -- Richard.Anderson@raycosoft.com www.unixscripts.com Perl/Java/Oracle/Unix consulting Seattle, WA, USA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From greg.badros at infospace.com Mon Mar 19 19:54:12 2001 From: greg.badros at infospace.com (Greg J. Badros) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: Dean Hudson's message of "Mon, 19 Mar 2001 16:54:48 -0800" References: <20010319165448.B26305@ero.com> Message-ID: Dean Hudson writes: > this may make -w complain but: > > @out = grep {!/^$last$/ and $last = $_} @in; > > behaves like uniq; it only gets rid of adjacent duplicated lines. You've gotta be careful to quote meta-characters in $last: @out = grep {!/^\Q$last\E$/ and $last = $_} @in; # untested should work better, but the regex could just be replaced by `ne', too. Greg > > dean. > > On Mon, Mar 19, 2001 at 03:59:53PM -0800, Bill Alford wrote: > > Ooops, that argument was an array reference, not the full array. Just > > change as appropriate below. > > > > On Mon, 19 Mar 2001, Bill Alford wrote: > > > > > All the solutions I've seen so far look good for treating the list as a > > > set (I may have missed one that didn't). But, from the uniq man page: > > > > > > Discard all but one of successive identical lines from > > > INPUT (or standard input), writing to OUTPUT (or standard > > > output). > > > > > > It looks like that's what's happening below. > > > > > > Here's what I can come up with (not tested and a little verbose, but I > > > like verbose :) : > > > > > > sub uniq { > > > if (! @_) { > > > return @_; # for the empty set case > > > } > > > my $last = shift; > > > my @result = ( $last ); > > > my $cur; > > > > > > foreach $cur ( @_ ) { > > > # assuming string input > > > if ($cur ne $last) { > > > $last = $cur; > > > push(@result,$cur); > > > } > > > } > > > return @result; > > > } > > > > > > > > > > > > On Mon, 19 Mar 2001, jeff saenz wrote: > > > > > > > What if you convert the array values to hash keys and let the hash eliminate the > > > > duplicates? Something like: > > > > > > > > @hash{@array} = (); > > > > or maybe a map. but i think maps are inefficient. something like that. > > > > > > > > Richard Anderson wrote: > > > > > > > > > Does anyone have comments for Mike? > > > > > > > > > > Richard Anderson, Ph.D. www.unixscripts.com > > > > > Perl / Oracle / Unix Richard.Anderson@raycosoft.com > > > > > Raycosoft, LLC Seattle, WA, USA > > > > > ----- Original Message ----- > > > > > From: "Mike" > > > > > To: "Richard Anderson" > > > > > Sent: Friday, March 16, 2001 2:12 PM > > > > > Subject: Uniq in perl > > > > > > > > > > > This is something I had sitting around. I didn't write it. Its a subroutine > > > > > > that uniqs an array. I was just wondering if this is the best way to do it > > > > > > or if anyone has any thing better. Thanks > > > > > > > > > > > > > > > > > > ## Usage: &uniq( \@ARRAY ); > > > > > > sub uniq { > > > > > > my (@uwork, @unew, $uname); > > > > > > @uwork = @{$_[0]}; > > > > > > @uwork = sort( @uwork ); > > > > > > @unew = ( shift @uwork ); > > > > > > > > > > > > foreach $uname ( @uwork ) { > > > > > > @unew=( @unew, $uname) if ( $uname ne $unew[ -1 ] ); > > > > > > } > > > > > > > > > > > > @{$_[0]}=@unew; > > > > > > } > > > > > > > > > > > > :wq > > > > > > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > > > > > > > > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From scott at sabmail.rresearch.com Mon Mar 19 20:25:08 2001 From: scott at sabmail.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: <20010319165448.B26305@ero.com> References: <20010319165448.B26305@ero.com> Message-ID: <20010319182508.A26192@sabami.seaslug.org> On Mon, Mar 19, 2001 at 04:54:48PM -0800, Dean Hudson wrote: > this may make -w complain but: > > @out = grep {!/^$last$/ and $last = $_} @in; > > behaves like uniq; it only gets rid of adjacent duplicated lines. A couple problems: 1) The $last in the regexp needs to be escaped for use there (e.g. with "\Q$last\E" if I remember correctly. 2) That doesn't work if $_ happens to test false (as would happen with a blank line if @in were full of chomp()'d lines). So, something more along the lines of: @out = grep {my $x = (defined $last && $last ne $_); $last = $_; $x} @in; might be the trick (though it's not going to win any perl golf contests). Or if you can afford to allocate some extra data for a list of indices... @out = @in[grep {$_ == 0 or $in[$_-1] ne $in[$_]} 0..$#in]; Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dean at ero.com Mon Mar 19 21:55:17 2001 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Fw: Uniq in perl In-Reply-To: <20010319182508.A26192@sabami.seaslug.org>; from scott@sabmail.rresearch.com on Mon, Mar 19, 2001 at 06:25:08PM -0800 References: <20010319165448.B26305@ero.com> <20010319182508.A26192@sabami.seaslug.org> Message-ID: <20010319195517.A18604@ero.com> On Mon, Mar 19, 2001 at 06:25:08PM -0800, Scott Blachowicz wrote: > 1) The $last in the regexp needs to be escaped for use there (e.g. > with "\Q$last\E" if I remember correctly. only if you want it to work without insidious bugs. ne is prolly the best choice. > 2) That doesn't work if $_ happens to test false (as would happen with > a blank line if @in were full of chomp()'d lines). blank chomp()'d lines don't make sense in the context of uniq(1). the following should produce similar output: open (UNIQ, "|/usr/bin/uniq") or die; print UNIQ while(<>); my $last = ""; print grep {$_ ne $last and $last = $_} <>; so 2) is thusly outside of the project's scope. unfortunately the grep doesn't deal with any of uniq's command line options which may in turn be _in_ scope. dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From torin at daft.com Tue Mar 20 00:28:22 2001 From: torin at daft.com (Darren/Torin/Who Ever...) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Portable way to get local time zone In-Reply-To: References: Message-ID: <87r8zt2br7.fsf@perv.daft.com> Richard Anderson, in an immanent manifestation of deity, wrote: >What is a portable way to get the local timezone from within a mod_perl >module? I see that on Linux 2.2.16 I can do "ls -l /etc/localtime" and on >Solaris 2.7 I can do "tail -1 /etc/TIMEZONE", but I want something that is >portable. > >The $TZ variable does not seem to be set in my mod_perl program's >environment ... You can look at the difference between localtime() and gmtime(). I did this at first. But then I needed to do more and found out that there is a Time::Timezone modules on CPAN... Darren -- Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-206-ELF-LIPZ @ Make a little hot-tub in your soul. @ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From largest at largest.org Tue Mar 20 01:15:52 2001 From: largest at largest.org (Joel Grow) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: oddity (bug?) with isa() In-Reply-To: Message-ID: Hello SPUG-o-nauts, Riley and I have been puzzling over some seemingly odd isa() behavior. Our understanding was that when you call Widget->isa('Thingie') Perl would look in @Widget::ISA for 'Thingie'--if it's there isa() returns true, else it returns false. It appears, however, that something else is also going on. One thought is that Perl is also checking to see if there's a 'Thingie' symbol table. Consider the following code, a calling script and 2 versions of Widget.pm. The only difference in the versions of the module is the 'package Thingy;' line in the 2nd version. use'ing version 1, the calling script outputs "Nope, not a Thingy\n". use'ing version 2, the calling script outputs "As I suspected, it's a Thingy\n". why? Joel ----8<---- #!/usr/local/bin/perl # the calling script use strict; use Widget; my $widgy = Widget->new(); print $widgy->isa('Thingy') ? "As I suspected, it's a Thingy\n" : "Nope, not a Thingy\n"; ----8<---- # Widget.pm, VERSION 1 package Widget; use strict; use vars '@ISA'; @ISA = 'Thingy'; sub new { bless {}, $_[0] } 1; ----8<---- # Widget.pm, VERSION 2 package Thingy; package Widget; use strict; use vars '@ISA'; @ISA = 'Thingy'; sub new { bless {}, $_[0] } 1; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Tue Mar 20 01:38:30 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: 3/20 Mtg: Komodo & Regexes Message-ID: <20010319233830.A1181@timji.consultix.wa.com> Here's the final reminder about tomorrow's meeting, featuring luminaries from ActiveState from up across our Northern border. NOTE: The next few meetings, including this one, will run from 7:30-9:30 (rather than the usual 7-9pm) due to scheduling issues. That means we can spend more time at the pre-meeting watering hole, conducting the really important business of socializing, drinking, and dining! 8-} -Tim ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== "Perl, Komodo & Regular Expressions" Brian King and Neil Watkiss, Developers ActiveState Corp., Vancouver CA Regular expressions are often the bane of many a programmer. This talk provides an overview of the Regex debugger in Komodo, ActiveState's new cross-platform, multi-language, scripting IDE. The Regex Debugger, goes beyond the simple "matched or not" feedback available in all current Regex debuggers. 'Rx' is written in Perl and C and integrated into Komodo using Mozilla's XPCOM technology. Coming soon to Mozilla, PerlXPCOM will allow you to write your components directly in Perl. 1. Background: Komodo & Perl - A cross platform, multi-language IDE - Based on Mozilla - Perl debugging, syntax highlighting, auto-completion, etc. 2. Regular Expression Debugger - What was missing - Regex debugger - Never-before-seen features - Decided to write in Perl 3. Rx.pm - Based on re.xs (in the Perl core) - Mostly written in XS & C, some Perl - Exposes the Perl regular expression engine functions - Provides information about compilation and execution phases 4. Rx::Info.pm - Written completely in Perl - Provides an OO API to regular expressions and information 5. Integrating Rx into Komodo - An XPCOM component (introduce XPCOM briefly) - Written in C++ - Embeds a Perl interpreter 6. Future of Perl & Mozilla: PerlXPCOM - Current status *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* ----- End forwarded message ----- -- *==========================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | Email: tim@consultix-inc.com Web: http://www.consultix-inc.com | | TIM MAHER: Unix/Perl DAMIAN CONWAY: Adv. Perl COLIN MEYER: Perl/DBI | | *We are currently scheduling On-Site Classes on UNIX and Perl topics!* | *==========================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Tue Mar 20 03:26:42 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Portable way to get local time zone References: <87r8zt2br7.fsf@perv.daft.com> Message-ID: <024a01c0b11f$e16a8190$1f88ddd1@aci2> Looking at the difference between localtime() and gmtime() will tell me the offset between local time and GMT, but it won't tell me what time zone I am in. For example, in the summer in Phoenix the offset is the same as the offset in L.A., but in the winter the Phoenix offset is the same as the Denver offset. So if the offset is seven hours, how do I know if I am in Denver, Phoenix or L.A? The Time::Timezone CPAN module looks like a good start, but I doubt that it is portable to all Unices. Here's a comment from the source code: # Hack to deal with 'PST8PDT' format of TZ # Note that this can't deal with all the esoteric forms, but it # does recognize the most common: [:]STDoff[DST[off][,rule]] Does anyone know a 100% portable method for getting the name of the locat time zone?? Richard Anderson, Ph.D. www.unixscripts.com Perl / Java / Oracle / Unix Richard.Anderson@raycosoft.com Raycosoft, LLC Seattle, WA, USA ----- Original Message ----- From: "Darren/Torin/Who Ever..." To: "starfire" Cc: Sent: Monday, March 19, 2001 10:28 PM Subject: Re: SPUG: Portable way to get local time zone > Richard Anderson, in an immanent manifestation of deity, wrote: > >What is a portable way to get the local timezone from within a mod_perl > >module? I see that on Linux 2.2.16 I can do "ls -l /etc/localtime" and on > >Solaris 2.7 I can do "tail -1 /etc/TIMEZONE", but I want something that is > >portable. > > > >The $TZ variable does not seem to be set in my mod_perl program's > >environment ... > > You can look at the difference between localtime() and gmtime(). I did > this at first. > > But then I needed to do more and found out that there is a > Time::Timezone modules on CPAN... > > Darren > -- > > Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-206-ELF-LIPZ > @ Make a little hot-tub in your soul. @ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From johnl at meer.net Tue Mar 20 07:46:02 2001 From: johnl at meer.net (John Labovitz) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Portable way to get local time zone In-Reply-To: <024a01c0b11f$e16a8190$1f88ddd1@aci2> Message-ID: > Does anyone know a 100% portable method for getting the name of the locat time > zone?? Try the "POSIX" module's tzset() and tzname() subroutines. (Type "man POSIX" and search for "tzname".) These are identical to the C library routines, and most Unixes use the same base timezone information & library (from NIH). The tzset() subroutine initializes the program to the timezone as specified in $ENV{TZ}, or whatever is the default on the system. The tzname() subroutine returns a list of two "short"-style timezone names. Note that these short names can be ambiguous -- for instance, "EST" stands for timezones in both eastern Australia and the eastern US. john - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Tue Mar 20 09:06:33 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: oddity (bug?) with isa() Message-ID: We had a class called Widget that inherited from a non-existent Thingy class, and our call to isa for Thingy on a Widget failed. We could add this to your VERSION 1 code somewhere: package Thingy; return 1; It would then work. Perl -w did help me identify the problem: Can't locate package Thingy for @Widget::ISA. Hope that helps, Steve Howell - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Tue Mar 20 10:49:11 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: oddity (bug?) with isa() Message-ID: In a message dated 3/19/01 11:38:59 PM Pacific Standard Time, largest@largest.org writes: > Riley and I have been puzzling over some seemingly odd isa() behavior. > Our understanding was that when you call > > Widget->isa('Thingie') > > Perl would look in @Widget::ISA for 'Thingie'--if it's there isa() returns > true, else it returns false. It appears, however, that something else is > also going on. One thought is that Perl is also checking to see if > there's a 'Thingie' symbol table. > > Consider the following code, a calling script and 2 versions of Widget.pm. > The only difference in the versions of the module is the 'package Thingy;' > line in the 2nd version. > > use'ing version 1, the calling script outputs "Nope, not a Thingy\n". > use'ing version 2, the calling script outputs "As I suspected, it's a > Thingy\n". > > why? The isa function does a lot more than look for "Thingy" in @Widget::ISA, because it has to look for grandparent classes. When isa searches the inheritance tree for Thingy, presumably it verifies that ISA'd packages are, in fact, packages, and perl does warns you if they're not (as expected), and isa does return false if they're not (not expected??). Damian's book points out some interesting facts about isa. For example, the isa function is hard coded into the Perl executable, and for greater speed, it memorizes its return values. P.S. I misread your original post a bit before sending my previous reply. I guess you had already figured out that the nonexistence of package Thingy caused isa to act unexpectedly. I hope my elaboration here sheds more light. ---- Steve Howell - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Showell30 at aol.com Tue Mar 20 11:01:27 2001 From: Showell30 at aol.com (Showell30@aol.com) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: wrapping MLDBM to allow prev/next Message-ID: <6e.8bd889c.27e8e6e7@aol.com> # Hello SPUG. Surely I am reinventing some wheels here. # Please comment. # # Thanks, # # Steve # # see documentation at __END__ package dbsteve; use DB_File; use strict; sub new { # pass in File my $class = shift; my $self = {}; my $file = $self->{File} = shift; $self->{Dirty} = 1; my %table; tie (%table, 'MLDBM', $self->{File}, O_CREAT|O_RDWR, 0666, $DB_BTREE) or die "Can't open DB."; $self->{Table} = \%table; _debug($self); return bless $self, $class; } sub store { my ($self, $key, $value) = @_; $self->{Table}{$key} = $value; $self->{Dirty} = 1; $self->_setindex($key); } sub fetch { my ($self, $key) = @_; return undef if not exists $self->{Table}{$key}; $self->_setindex($key); return $self->{Table}{$key}; } sub prev { my ($self) = @_; $self->_clean(); return (undef, undef) if $self->{CurrKey} <= 0; my $key = $self->{Keys}[--$self->{CurrKey}]; return ($key, $self->{Table}{$key}); } sub next { my ($self) = @_; $self->_clean(); return (undef, undef) if $self->{CurrKey} >= $#{$self->{Keys}}; my $key = $self->{Keys}[++$self->{CurrKey}]; return ($key, $self->{Table}{$key}); } sub _clean { my ($self) = @_; return if not $self->{Dirty}; $self->{Dirty} = 0; $self->{Keys} = [keys %{$self->{Table}}]; $self->{CurrKey} = 0; } sub _debug { while (my($key, $data) = each(%{$_[0]->{Table}})) { print "$key\n", join(":", @$data), "\n"; } } sub _setindex { my ($self, $key) = @_; $self->_clean(); for my $i (0..$#{$self->{Keys}}) { if ($self->{Keys}[$i] eq $key) { $self->{CurrKey} = $i; last; } } } return 1; __END__ =head1 DESCRIPTION Here is what I needed in my database: 1. Ability to store about 3000 records. 2. Low performance inserts. 3. High performance searching. 4. High performance sequential access through the database (with keys ordered). This package wraps an MLDBM database that has a BTREE DB_File for its guts. It augments the MLDBM/DB_File interface by allowing you to do previous and next from the middle of the database. It removes the hash tie interface, partly due to non-virtuous laziness, but also partly to improve the clarity of the calling code. Example usage: my $db = $steve->new("File.txt"); $db->store($key, $value); $value = $db->fetch($key); # undef means not found ($key, $value) = $db->next(); ($key, $value) = $db->prev(); (This has been tested under Win98 only.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From law at isomedia.com Wed Mar 21 11:19:23 2001 From: law at isomedia.com (Lynn A Wilkins) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Portable way to get local time zone In-Reply-To: References: Message-ID: <01032109204906.09942@Maggie> Isn't the defference between localtime() and gmtime() the your timezone? (In hours.) -law On Mon, 19 Mar 2001, starfire wrote: > What is a portable way to get the local timezone from within a mod_perl > module? I see that on Linux 2.2.16 I can do "ls -l /etc/localtime" and on > Solaris 2.7 I can do "tail -1 /etc/TIMEZONE", but I want something that is > portable. > > The $TZ variable does not seem to be set in my mod_perl program's > environment ... > > -- > Richard.Anderson@raycosoft.com www.unixscripts.com > Perl/Java/Oracle/Unix consulting Seattle, WA, USA > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Wed Mar 21 15:18:12 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Next Eastside SPUG Meeting: March 28, Wed Message-ID: If anyone's interested in speaking at the Eastside-SPUG meeting let me know. I have some ideas for topics which we can discuss over e-mail and you are also welcome to talk about anything else that you feel might be interesting to the group. Also at the next meeting we are going to try out an idea from the C++ Users Group: Have a Tech Q&A at the beginning of the meeting. If you have questions about Perl -- all levels welcome -- bring them to the Tech Q&A and we'll wrestle them with our collective Perl intelligence. I'll post the details of the meeting in another announcement shortly. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Wed Mar 21 20:06:06 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Portable way to get local time zone References: <01032109204906.09942@Maggie> Message-ID: <008401c0b274$ad640e60$2e88ddd1@aci2> No - please read my previous email: ----- Original Message ----- From: "Richard Anderson" To: "starfire" ; "Darren/Torin/Who Ever..." Cc: Sent: Tuesday, March 20, 2001 1:26 AM Subject: Re: SPUG: Portable way to get local time zone > Looking at the difference between localtime() and gmtime() will tell me the offset between local time and GMT, but it won't tell me what time zone I am in. For example, in the summer in Phoenix the offset is the same as the offset in L.A., but in the winter the Phoenix offset is the same as the Denver offset. So if the offset is seven hours, how do I know if I am in Denver, Phoenix or L.A? > Phoenix is in neither PST nor MST - it is in its own special time zone. Other areas of the world (e.g. southern Indiana) are just as weird. Richard Anderson, Ph.D. www.unixscripts.com Perl / Java / Oracle / Unix Richard.Anderson@raycosoft.com Raycosoft, LLC Seattle, WA, USA ----- Original Message ----- From: "Lynn A Wilkins" To: "starfire" ; ; Sent: Wednesday, March 21, 2001 9:19 AM Subject: Re: SPUG: Portable way to get local time zone > Isn't the defference between localtime() and gmtime() the your timezone? (In > hours.) > -law > > > On Mon, > 19 Mar 2001, starfire wrote: > What is a portable way to get the local timezone > from within a mod_perl > module? I see that on Linux 2.2.16 I can do "ls -l > /etc/localtime" and on > Solaris 2.7 I can do "tail -1 /etc/TIMEZONE", but I > want something that is > portable. > > > > The $TZ variable does not seem to be set in my mod_perl program's > > environment ... > > > > -- > > Richard.Anderson@raycosoft.com www.unixscripts.com > > Perl/Java/Oracle/Unix consulting Seattle, WA, USA > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From damian at mail.csse.monash.edu.au Thu Mar 22 00:27:22 2001 From: damian at mail.csse.monash.edu.au (Damian Conway) Date: Wed Aug 4 00:07:56 2004 Subject: SPUG: Conway on Perl v6, 2/19 Seattle Message-ID: <200103220627.RAA29786@indy05.csse.monash.edu.au> > Special February Meeting: > Title: Whither Perl 6.0? > Speaker: Aussie Perl Guru Dr. Damian Conway > Indentured Servant #1 to Perl Community, > via Development Grant from "Yet Another Society" > Time: February 19th, 2001 (Third MONDAY), 7:00pm-9pm > Location: Union Bank of California Bldg, 5th Floor Mtg Room > > NOTE: Usual location and time, but Monday, rather than Tuesday! Yes, the truth can finally be revealed: I will actually be travelling *backwards* in time to have given that talk, which I will soon be having written from memory, perhaps at the very moment you will have had been being reading this. (Man, this transtemporal travel is tough on the tenses!) Damian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From damian at mail.csse.monash.edu.au Thu Mar 22 00:30:50 2001 From: damian at mail.csse.monash.edu.au (Damian Conway) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Conway Cruise Today, 1:30 Kirkland Message-ID: <200103220630.RAA29822@indy05.csse.monash.edu.au> > Damian Conway arrived yesterday, and to help him get reoriented to > the local high-tech scene, I've just decided to take him on the > 1:30pm Argosy Lake Washington cruise today (2/18/01). And a big thanks to all those of you who will have had been being traveling back to last month to have had joined us. It will have been a blast. (Help, Mr Wizard!) Damian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From tim at consultix-inc.com Thu Mar 22 01:09:34 2001 From: tim at consultix-inc.com (Tim Maher/CONSULTIX) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Classic Mail Revival Message-ID: <20010321230934.B23185@timji.consultix.wa.com> >Date: Thu, 22 Mar 2001 17:30:50 +1100 (EST) >From: Damian Conway >To: spug-list@pm.org, Tim Maher/CONSULTIX >Subject: Re: SPUG: Conway Cruise Today, 1:30 Kirkland >Cc: fnjt1 >Reply-To: damian@conway.org > > > Damian Conway arrived yesterday, and to help him get reoriented to > > the local high-tech scene, I've just decided to take him on the > > 1:30pm Argosy Lake Washington cruise today (2/18/01). > >And a big thanks to all those of you who will have had been being traveling >back to last month to have had joined us. It will have been a blast. > (Help, Mr Wizard!) >Damian I suspect that these "classic mail messages" are appearing today due to the reinstatement of the original Perl-Mongers mailing-list server, coming back online with these old messages still in its outgoing queue. (We had been running on temporary hardware for the last month or so.) Either that, or we're in Big Trouble, Will Robinson! 8-} I'm betting that the time-warp is now over, but we shall see. . . -Tim ========================================================== | Tim Maher, Ph.D. Tel: (206) 781-UNIX | | SPUG Founder & Leader Email: spug@halcyon.com | | Seattle Perl Users Group HTTP: www.halcyon.com/spug | ========================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From seppy at mail.tanzatech.com Thu Mar 22 10:45:51 2001 From: seppy at mail.tanzatech.com (Jafaar Nyang'oro) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Output files Message-ID: <200103221145.AA2489188670@mail.tanzatech.com> SPUG-ers, I need to create a script that would format the output from files created by processes running in Windows NT to look like the output that has been created by UNIX processes. I have included the files in question below. I'll appreciate for any pointers on how to write that sort of a script. In all, there are three files: sysinfo.out, contacts.out, and dept.out UNIX Files ---------- file: sysinfo.out Run Date: Tue Mar 20 16:17:36 CST 2001 Operating System: SunOS OS Version: 5.7 CPU Count: 8 Host Name: dbsun01 Hardware: Sun Ultra Bigbox IP Address(es): 166.76.135.16 dbsun01 dbsun01.intra db735f04af # Added by TRIS Install 166.76.94.221 dbsun01a Good To Go?: file: contact.out Primary name: Pcontact Smith Primary number: 555-1212 Backup name: Bcontact Jones Backup number: 555-1213 Department(s): 704dss Application(s) in use: winders 3.x, psoft Server Location: Hoffman Estates, IL, B2-255A file: dept.out Department(s): 704dss NT Files -------- file: nt-sysinfo.out Thu Mar 22 01:27:20 2001 NT Type: NT Advanced Server Version: 4.0, Build = 1381, CSD = Service Pack 6 CPU Count: 1 Host Name: 6010TPOS Hardware: IBM Netfinity 3500 IP Address(es): IP Address: 166.76.33.128 file: nt-contact.out Primary name: Jafaar Nyang'oro Primary number: 65924 Backup name: Mr. Backup Backup number: 61234 Department(s): 704SAG Application(s): TPOS; SOLAR Server Location: Hoffman Estates Ill. file: nt-dept.out Department(s): 704SAG - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Thu Mar 22 14:41:08 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Conway on Perl v6, 2/19 Seattle Message-ID: When you get back could you add this functionality to the next release of Quantum::Superposition? Asim -----Original Message----- From: Damian Conway [mailto:damian@mail.csse.monash.edu.au] Sent: Wednesday, March 21, 2001 10:27 PM To: spug-list@pm.org; Tim Maher/CONSULTIX Subject: Re: SPUG: Conway on Perl v6, 2/19 Seattle > Special February Meeting: > Title: Whither Perl 6.0? > Speaker: Aussie Perl Guru Dr. Damian Conway > Indentured Servant #1 to Perl Community, > via Development Grant from "Yet Another Society" > Time: February 19th, 2001 (Third MONDAY), 7:00pm-9pm > Location: Union Bank of California Bldg, 5th Floor Mtg Room > > NOTE: Usual location and time, but Monday, rather than Tuesday! Yes, the truth can finally be revealed: I will actually be travelling *backwards* in time to have given that talk, which I will soon be having written from memory, perhaps at the very moment you will have had been being reading this. (Man, this transtemporal travel is tough on the tenses!) Damian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dave at dave.org.uk Thu Mar 22 15:22:13 2001 From: dave at dave.org.uk (Dave Cross) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Conway on Perl v6, 2/19 Seattle In-Reply-To: Message-ID: <5.0.2.1.2.20010322211953.01b8fec0@pop.dave.org.uk> At 20:41 22/03/2001, JALIS,ASIM (HP-FtCollins,ex1) wrote: >-----Original Message----- >From: Damian Conway [mailto:damian@mail.csse.monash.edu.au] >Sent: Wednesday, March 21, 2001 10:27 PM >To: spug-list@pm.org; Tim Maher/CONSULTIX >Subject: Re: SPUG: Conway on Perl v6, 2/19 Seattle > > > > > Special February Meeting: > > > Title: Whither Perl 6.0? > > > Speaker: Aussie Perl Guru Dr. Damian Conway > > > Indentured Servant #1 to Perl Community, > > > via Development Grant from "Yet Another Society" > > > Time: February 19th, 2001 (Third MONDAY), 7:00pm-9pm > > > Location: Union Bank of California Bldg, 5th Floor Mtg Room > > > > > > NOTE: Usual location and time, but Monday, rather than Tuesday! > > > >Yes, the truth can finally be revealed: I will actually be travelling > >*backwards* in time to have given that talk, which I will soon be having > >written from memory, perhaps at the very moment you will have had > >been being reading this. > > > >(Man, this transtemporal travel is tough on the tenses!) > >When you get back could you add this functionality to the next >release of Quantum::Superposition? You're not thinking. Damian should add it to the _previous_ version of Quantum::Superpositions _before_ he comes back :) Dave... -- SMS: sms@dave.org.uk Data Munging with Perl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jondunn at speakeasy.org Thu Mar 22 15:36:59 2001 From: jondunn at speakeasy.org (Jonathan Dunn) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Conway on Perl v6, 2/19 Seattle In-Reply-To: <5.0.2.1.2.20010322211953.01b8fec0@pop.dave.org.uk> References: Message-ID: <5.0.2.1.1.20010322133625.02a30b60@mail.speakeasy.org> I know how we got those emails. Someone installed: FTP::FTL Jonathan Dunn jondunn@speakeasy.org http://www.speakeasy.org/~jondunn/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From creede at rrauto.com Thu Mar 22 17:23:55 2001 From: creede at rrauto.com (Creede Lambard) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Conway on Perl v6, 2/19 Seattle References: <5.0.2.1.1.20010322133625.02a30b60@mail.speakeasy.org> Message-ID: <03c301c0b327$29e93660$1f4181ce@rrauto.com> Boy, I knew Perl was getting faster all the time, but this is great! 'Scuse me while I go see if CPAN has Yahoo::Finance::Quotes::Tomorrow yet. -- Creede ----- Original Message ----- From: Jonathan Dunn To: Sent: Thursday, March 22, 2001 1:36 PM Subject: RE: SPUG: Conway on Perl v6, 2/19 Seattle > > I know how we got those emails. Someone installed: > > FTP::FTL > > Jonathan Dunn > jondunn@speakeasy.org > http://www.speakeasy.org/~jondunn/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From briani at activestate.com Fri Mar 23 11:26:07 2001 From: briani at activestate.com (Brian Ingerson) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Re: Inline::File References: <000401c0b3b2$ce88db40$0300000a@bigmindmedia.com> Message-ID: <3ABB872F.F06B51E1@activestate.com> David Vergin wrote: > > Hi Brian, > > Enjoyed the bit on Inline::File the other night at SPUG. But I have been unable > to locate it. Any clue would be appreciated. David, You can pick up the initial version at Damian's site: http://www.csse.monash.edu.au/~damian/CPAN/ It has a few minor bugs but is definitely good enough to start playing with. Damian and I agreed that I would add the next round of functionality and then put it on CPAN. I'm in the middle of doing that, but unfortunately I will be away from my computer for the next week. Cheers, Brian NOTE: One bug is that it won't run on threaded perls like ActivePerl. If you need to use ActivePerl apply the following (one character) fix to Inline::Files::AUTOLOAD() # For some crazy reason this will not work on a threaded perl: # vf_open *$symbol, "$open_mode$$symbol", $symbol or return; # but this will: vf_open $symbol, "$open_mode$$symbol", $symbol or return; -- perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf ("Just Another %s Hacker",x);}};print JAxH+Perl' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jondunn at speakeasy.org Fri Mar 23 13:04:08 2001 From: jondunn at speakeasy.org (Jonathan Dunn) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Perl sighting on sit-com Message-ID: <5.0.2.1.1.20010323105657.02bf2da0@mail.speakeasy.org> The first time I've had this experience. Probably the last. I was watching Comedy Central's reruns of "Sports Night" last night: "...alright, I'll tell you what's going to happen: we're going to telnet into the network mainframe and FTP a Perl script right through a DK back door into the CGI server..." Jonathan Dunn jondunn@speakeasy.org http://www.speakeasy.org/~jondunn/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jamesn at trendwestresorts.com Fri Mar 23 14:14:34 2001 From: jamesn at trendwestresorts.com (JAMES NIGH) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Perl sighting on sit-com Message-ID: <72E0370D7D60D411A47700010230395A0238C8A0@trimail> > The first time I've had this experience. Probably the last. > > I was watching Comedy Central's reruns of "Sports Night" last night: > > "...alright, I'll tell you what's going to happen: we're > going to telnet > into the network mainframe and FTP a Perl script right > through a DK back > door into the CGI server..." uh, what the heck is a "DK back door"??? -- James Nigh Applications Developer Trendwest Resorts jamesn@trendwestresorts.com 425.498.2764 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mk832mn57 at yahoo.com Sat Mar 24 10:31:03 2001 From: mk832mn57 at yahoo.com (mk832mn57@yahoo.com) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: . Message-ID: <56l4o3GUFDF1xAHEv> Important message................Please print and read................. We will put your product or service instantly into the hands of millions of prospects! Since 1996, Tech Data Technologies has provided bulk email marketing to thousands of well- satisfied customers. We offer the most competitive prices in the industry, made possible by our high percentage of repeat business. We have the most advanced, direct email technology, employed by only a knowledgeable few in the world. We have over 160 million active email addresses, increasing our list at the rate of half a million to one million a month. You will have instant, guaranteed results, something no other form of marketing can claim. Our turn around time is a remarkable 24 hours. Our email addresses are sorted by country, state, city and target. Your marketing campaign will speed with pinpoint accuracy to your desired audience! Call us for a free consultation at 323 876 6148 [U.S.A.]. For a limited time, take advantage of our special -- Three million general U.S. emails for just $600 per million! We include, at no cost, a bulletproof email address for 30 days, a $400 value! BULK EMAIL PRICES 750,000...................$562 1,200,000...................$720 1,600,000...................$960 3,000,000+..................PLEASE CALL FOR A QUOTE Best of ALL, Tech Data Services can be used as a 100% TAX WRITE OFF for your Business! ======================================================================= "Many business people are finding out that they can now advertise in ways that they never could have afforded in the past. The cost of sending mass e-mail is extremely low, and the response rate is high and quick." - USA TODAY ======================================================================== 1) Let's say you... Sell a $24.95 PRODUCT or SERVICE. 2) Let's say you... Mass Email to 1,000,000 PEOPLE DAILY. 3) Let's say you... Receive JUST 1 ORDER for EVERY 2,500 EMAILS. CALCULATION OF YOUR EARNINGS BASED ON THE ABOVE STATISTICS: [Day 1]: $9,980 [Week 1]: $69,860 [Month 1]: $279,440 Now you know why you receive so many email advertisements... ===> MASS EMAIL ADVERTISING IS EXTREMELY PROFITABLE! Under Bill s.1618 TITLE III passed by the 105th U.S. Congress this letter is not considered "spam" as long as we include: 1) contact information and, 2) the way to be removed from future mailings (see below). To Remove Yourself From This List: Please email see2meu4@yahoo.com with the email address that you would like removed and the word REMOVE in the subject heading. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Sean at DigiDot.com Sun Mar 25 11:40:32 2001 From: Sean at DigiDot.com (Sean Ruddy) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Perl sighting on sit-com References: <72E0370D7D60D411A47700010230395A0238C8A0@trimail> Message-ID: <3ABE2D90.C069787D@DigiDot.com> JAMES NIGH wrote: > > > > The first time I've had this experience. Probably the last. > > > > I was watching Comedy Central's reruns of "Sports Night" last night: > > > > "...alright, I'll tell you what's going to happen: we're > > going to telnet > > into the network mainframe and FTP a Perl script right > > through a DK back > > door into the CGI server..." > > uh, what the heck is a "DK back door"??? > > -- > James Nigh > Applications Developer > Trendwest Resorts > jamesn@trendwestresorts.com > 425.498.2764 > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From starfire at zipcon.net Mon Mar 26 15:02:30 2001 From: starfire at zipcon.net (starfire) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Getting the name of the method I'm in Message-ID: I want to access the name of a method from inside the method, so I can write it to the Apache error log. For example: sub my_method() { my ($self, $r) = @_; my method_name = ??; $r->log_error(ref($self) . "::${method_name}: Can't open file $file: $!"); } I don't like hard coding it, in case the code is copied and/or the method name is changed. $0 won't give me what I want. Any suggestions? -- Richard Anderson, Ph.D. www.unixscripts.com Perl / Java / SQL / Unix Richard.Anderson@raycosoft.com Raycosoft, LLC Seattle, WA, USA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From dcd at tc.fluke.com Mon Mar 26 15:20:35 2001 From: dcd at tc.fluke.com (David Dyck) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Getting the name of the method I'm in In-Reply-To: Message-ID: On Mon, 26 Mar 2001, starfire wrote: > I want to access the name of a method from inside the method, so I can > write it to the Apache error log. For example: > > sub my_method() { > my ($self, $r) = @_; > my method_name = ??; > $r->log_error(ref($self) > . "::${method_name}: Can't open file $file: $!"); > } > > I don't like hard coding it, in case the code is copied and/or the method > name is changed. $0 won't give me what I want. > > Any suggestions? this should work for you but it includes the package name: my $method_name = (caller(0))[3]; # package and subroutine name $method_name =~ s/^.*:://; # strip off package name perl -le 'package mypackage;sub y{ print +(caller(0))[3]; } &y' prints mypackage::y also see perldata, as you may be able to use __PACKAGE__ instead of ref($self) The special literals __FILE__, __LINE__, and __PACKAGE__ represent the current filename, line number, and package name at that point in your program. They may be used only as separate tokens; they will not be interpolated into strings. If there is no current package (due to an empty C directive), __PACKAGE__ is the undefined value. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From jeff at planetoid.net Mon Mar 26 15:33:33 2001 From: jeff at planetoid.net (jeff saenz) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Getting the name of the method I'm in References: Message-ID: <3ABFB5AD.1233AE4A@planetoid.net> try the caller routine. i think i saw an example of it in carp.pm starfire wrote: > I want to access the name of a method from inside the method, so I can > write it to the Apache error log. For example: > > sub my_method() { > my ($self, $r) = @_; > my method_name = ??; > $r->log_error(ref($self) > . "::${method_name}: Can't open file $file: $!"); > } > > I don't like hard coding it, in case the code is copied and/or the method > name is changed. $0 won't give me what I want. > > Any suggestions? > > -- > Richard Anderson, Ph.D. www.unixscripts.com > Perl / Java / SQL / Unix Richard.Anderson@raycosoft.com > Raycosoft, LLC Seattle, WA, USA > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ -- Perl/Linux/Java Development Resume: http://resumes.yahoo.com/undertheash/perljavalinux - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From mmertel at ix.netcom.com Mon Mar 26 16:58:59 2001 From: mmertel at ix.netcom.com (Mark Mertel) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: off topic - the ugly underbelly of consulting Message-ID: <3ABFC9B3.57B25D06@ix.netcom.com> all, do any of you independent consultant/programmers out there have a line on getting some professional liability insurance ? got a new contract requirement which requires it. someone mentioned that 'associations' sometimes have a way of offering it because they are a larger group. mmertel@ix.netcom.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From greg at mccarroll.demon.co.uk Mon Mar 26 18:24:14 2001 From: greg at mccarroll.demon.co.uk (Greg McCarroll) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: off topic - the ugly underbelly of consulting In-Reply-To: <3ABFC9B3.57B25D06@ix.netcom.com>; from mmertel@ix.netcom.com on Mon, Mar 26, 2001 at 02:58:59PM -0800 References: <3ABFC9B3.57B25D06@ix.netcom.com> Message-ID: <20010327012414.A11981@mccarroll.demon.co.uk> * Mark Mertel (mmertel@ix.netcom.com) wrote: > this is all from a UK perspective, so may not be directly useful ... > on getting some professional liability insurance ? sometimes professional bodies offer it as part of their `package' > got a new contract > requirement which requires it. someone mentioned that 'associations' > sometimes have a way of offering it because they are a larger group. > i'm assuming my association you mean a group of consultants working together under an umbrella organisation - in general this sounds like a scam to me, buy the insurance its best in the long run - so what if you spend an extra couple of hundred dollars, its worth it - just double check what you are buying. sorry if this is not that much use to you, Greg - London.pm -- Greg McCarroll http://www.mccarroll.uklinux.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From djames at serv.net Mon Mar 26 17:41:38 2001 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: off topic - the ugly underbelly of consulting In-Reply-To: <3ABFC9B3.57B25D06@ix.netcom.com>; from Mark Mertel on Mon, Mar 26, 2001 at 02:58:59PM -0800 References: <3ABFC9B3.57B25D06@ix.netcom.com> Message-ID: <20010326154138.B1192@itchy.serv.net> On Mon, Mar 26, 2001 at 02:58:59PM -0800, Mark Mertel wrote: > do any of you independent consultant/programmers out there have a line > on getting some professional liability insurance ? got a new contract > requirement which requires it. someone mentioned that 'associations' > sometimes have a way of offering it because they are a larger group. I'll have to look and see if I've still got the paperwork on the policy I used to carry. Don't fret (yet), it wasn't that expensive. I think I paid around $200/year for something like $4m of liability coverage. I stopped coverage many years ago however, so I may have tossed the paperwork. If I come across it, I'll let you know the name of the company that carried it (I bought it through an insurance broker). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From Richard.Anderson at raycosoft.com Mon Mar 26 20:08:02 2001 From: Richard.Anderson at raycosoft.com (Richard Anderson) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Re: off topic - the ugly underbelly of consulting References: <3ABFC9B3.57B25D06@ix.netcom.com> Message-ID: <01bb01c0b662$c88f5220$2388ddd1@aci2> The ICCA (Independent Computer Consultants Assoc) has some good recommendations on inexpensive, reputable companies that can help you. If you are serious about consulting, you will find their membership fee to be a god investment. I consider insurance to be relatively insignificant. Unless you are off your medication, the chances of a client suing you for breech of contract are miniscule. ;-) More important than insurance is a binding arbitration clause, which does wonders for bringing deadbeat clients to heel. The AAA (American Arbitration Assoc) has more details on their web site. I never sign a contract, be it a contract that I originated or the client's contract, that does not have a binding arbitration clause. No legitimate business will have a problem with such a clause. If they do, thank them for their time and be on your way - there is no future in working with a client that is unwilling to sign a binding arbitration clause. Richard Anderson, Ph.D. www.unixscripts.com Perl / Java / SQL / Unix Richard.Anderson@raycosoft.com Raycosoft, LLC Seattle, WA, USA ----- Original Message ----- From: "Mark Mertel" To: "SPUG" Sent: Monday, March 26, 2001 2:58 PM Subject: SPUG: off topic - the ugly underbelly of consulting > all, > > do any of you independent consultant/programmers out there have a line > on getting some professional liability insurance ? got a new contract > requirement which requires it. someone mentioned that 'associations' > sometimes have a way of offering it because they are a larger group. > > mmertel@ix.netcom.com > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Tue Mar 27 11:52:15 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:57 2004 Subject: Eastside-SPUG: Meeting On Wednesday: Perl Tools Message-ID: The next Eastside-SPUG meeting will be tomorrow, Wednesday, at our usual Avaya location. See below for directions. Also the meeting will be in the cafeteria the entrance to which is behind the building. So find and use the back entrance. TOPICS * TECH Q&A First we'll have a Tech Q&A where people can ask questions about Perl. Questions from all levels are welcome. Hopefully this will make the group more useful to both beginner Perl programmers as well as to advanced ones. * Some Tools For Writing Large Perl Programs I will demo some Perl tools that I have created whose purpose is to make it easier to write large Perl programs. * Perl Module Browser. This is a simple IDE for Perl which hooks into the tags support that both Emacs and Vi have. Allows you to have a "package" or a "sub" view of your code. * Strict Structs and Methods. A simple scheme for avoiding errors object field names and in object method arguments. For example, if you declare a method with 2 arguments and pass it 3, this will tell you that. Also, the run-time cost is zero (unlike some other solutions to this problem on CPAN). DATE AND TIME Wednesday, March 28, 2001. 7.00 pm - 9.00 pm * Tech Q&A * Some Tools For Writing Large Perl Programs MEETING LOCATION AND DIRECTIONS Conference Room Avaya, Inc (previously Lucent) 6464 185th Ave NE Redmond, WA 98052-6736 * Take 520-East to Redmond. * Get off the freeway at exit #14 (Redmond Way/Route 202). * Keep right on ramp. * Turn right onto Redmond Way at light. * Turn left onto 185th Ave NE. * Drive up a couple of blocks. Look for the Avaya/Lucent Building on your right. * Find back entrance to cafeteria. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From asim_jalis at hp.com Tue Mar 27 12:18:32 2001 From: asim_jalis at hp.com (JALIS,ASIM (HP-FtCollins,ex1)) Date: Wed Aug 4 00:07:57 2004 Subject: Eastside-SPUG: Meeting On Wednesday: Perl Tools Message-ID: As always if anyone else is interested in presenting something at the meeting tomorrow or at future meetings let me know. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/ From djames at serv.net Tue Mar 27 13:22:58 2001 From: djames at serv.net (Daniel James) Date: Wed Aug 4 00:07:57 2004 Subject: SPUG: Re: off topic - the ugly underbelly of consulting In-Reply-To: <01bb01c0b662$c88f5220$2388ddd1@aci2>; from Richard Anderson on Mon, Mar 26, 2001 at 06:08:02PM -0800 References: <3ABFC9B3.57B25D06@ix.netcom.com> <01bb01c0b662$c88f5220$2388ddd1@aci2> Message-ID: <20010327112258.A37035@itchy.serv.net> On Mon, Mar 26, 2001 at 06:08:02PM -0800, Richard Anderson wrote: > I consider insurance to be relatively insignificant. Unless you are > off your medication, the chances of a client suing you for breech of > contract are miniscule. ;-) More important than insurance is a binding > arbitration clause, which does wonders for bringing deadbeat clients to > heel. The AAA (American Arbitration Assoc) has more details on their > web site. Many larger companies (my present employer included) require that all independent contractors they work with carry this liability insurance. Frankly, I wasn't worried about getting sued, but I was not to be paid until I provided proof of liability coverage. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/