From rbowen at rcbowen.com Sun Oct 1 15:35:30 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: Next Monday's meeting Message-ID: <39D7A012.E19EDB0E@rcbowen.com> Having not seen any discussion of next week's meeting (of course, I could have just missed it, with all that's going on) I just wanted to send out a reminder that next Monday is the date for the next PM meeting (yes, it's October already) and that I will not be there. So, if you're going to talk about Net::Telnet, or whatever it was, someone should take good notes for me. Rich From rbowen at rcbowen.com Sun Oct 1 20:20:33 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: cool POD stuff Message-ID: <39D7E2E1.42F56484@rcbowen.com> In the name of leraning cool new stuff, I have been poking around with POD, and unearthed something that someone sent me back in June, and I have never had a chance to look it. It's on CPAN, and is called, for some reason that I've not yet been able to divine, Marek::Pod::HTML It's a replacement for pod2html and podtohtml. It does the normal pod->html conversion stuff, with some interesting changes 1) If you give it a directory to convert, it converts everything in that directory, generates a TOC and an Index for all the .pod files in that directory. 2) It actually supports the X<> tag. You can put stuff in X<> tags, and it actually makes it into an index of the whole set of documents. This is something that I've wanted for a while, and it turns out it's been sitting in unread email for several months. Anyways, thought you folks would like to know. Rich From fprice at upended.org Wed Oct 4 13:06:50 2000 From: fprice at upended.org (Frank Price) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: Neat alarm trick Message-ID: <20001004140650.D737@localhost.localdomain> Hi Lexpm: I found a neat trick and a related question. First the trick: I have a script which does rcp system calls. Sometimes the other server is screwed up and the system call just hangs for a long time. I wanted a away to time it out after a certain amount of time. The solution is to use alarm(). Alarm sends an ALRM signal to any children, which works since system() forks a child. You wrap this in an eval block, and set a ALRM signal handler. Outside the eval, you can test for $@ and take action. Example: eval { local $SIG{'ALRM'} = sub { local $SIG{'TERM'} = 'IGNORE'; kill TERM => -$$; die 'Caught alarm signal'; }; alarm(10); print "starting system call ...\n"; system("cp /dev/zero /dev/null"); alarm(0); }; if ($@) { if ($@ =~ /Caught alarm signal/) { die ("system call blocked!!!"); } else { die } } Here's the question: since I want to kill the system call if the alarm goes off, looks like I have to explicitly send it a TERM signal. That's why the $SIG{'ALRM'} does 'kill TERM => -$$' (this sends a TERM to everything in the process group). First I ignore TERM for this process so the script doesn't get killed off. But I really just want to kil the system() child; however I couldn't find a good way to find it's PID. Is there a better way? Thanks, -Frank. -- Frank Price | fprice@upended.org | www.upended.org/fprice/ GPG key: www.upended.org/fprice/gpg.asc | E Pluribus Unix From fireston at lexmark.com Wed Oct 4 13:32:49 2000 From: fireston at lexmark.com (Mik Firestone) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: Neat alarm trick In-Reply-To: <20001004140650.D737@localhost.localdomain> Message-ID: <200010041832.OAA25095@interlock2.lexmark.com> To the best of my ( incredibly limitted ) knowledge, not the way you are trying. And I have been looking for a few weeks myself. I have a few suggestions. The system call is a convenience - it is really just forks a child and spins the parent into a wait loop while the child exec's the shell call. What if you were to do it yourself? Something like this ( completely untested ): $timeout = 0; LOOP: while ( 1 ) { if ( $spid = fork() ) { #--- # I am the parent, do a few things and waitpid #--- select undef,undef,undef,0.5; # Keep my loop loose $result = waitpid( $spid, 1 ); # non-blocking last LOOP if ( $result == $spid ); # Child process exited if ( ++$counter > 20 ) { # 10 seconds $timeout = 1; kill HUP, $spid; last LOOP; } } else { #--- # This is important - you *must* use the LIST format here - # strings and shell characters are bad. Exec never returns, so we # needn't worry about an exit. #--- exec "/fully/qualified/path/to/rcp", "option", "option",...; } } if ( $timeout ) { print "The horror, the horror\n"; } This WILL NOT work if the exec causes a shell to spawn - you will then be at least a few PIDs removed from the original child process. See perlfunc:exec for a complete explanation of when exec spawns shells and when it won't. This is also going to be somewhat dependant on the quirks of your execvp(3) call. HTH ( but no promises :) Mik On Wed, 4 Oct 2000, Frank Price is rumored to have said: >Hi Lexpm: > >I found a neat trick and a related question. First the trick: I have >a script which does rcp system calls. Sometimes the other server is >screwed up and the system call just hangs for a long time. I wanted a >away to time it out after a certain amount of time. > >The solution is to use alarm(). Alarm sends an ALRM signal to any >children, which works since system() forks a child. You wrap this in >an eval block, and set a ALRM signal handler. Outside the eval, you >can test for $@ and take action. > >Example: > >eval { > local $SIG{'ALRM'} = sub { > local $SIG{'TERM'} = 'IGNORE'; > kill TERM => -$$; > die 'Caught alarm signal'; > }; > alarm(10); > print "starting system call ...\n"; > system("cp /dev/zero /dev/null"); > alarm(0); >}; >if ($@) { > if ($@ =~ /Caught alarm signal/) { > die ("system call blocked!!!"); > } else { die } >} > >Here's the question: since I want to kill the system call if the >alarm goes off, looks like I have to explicitly send it a TERM signal. >That's why the $SIG{'ALRM'} does 'kill TERM => -$$' (this sends a TERM >to everything in the process group). First I ignore TERM for this >process so the script doesn't get killed off. But I really just want >to kil the system() child; however I couldn't find a good way to find >it's PID. Is there a better way? > >Thanks, > >-Frank. > -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: If I am engaged in a duel to the death with the hero and I am fortunate enough to knock the weapon out of his hand, I will graciously allow him to retrieve it. This is not from a sense of fair play; rather, he will be so startled and confused that I will easily be able to dispatch him. -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: My force-field generators will be located inside the shield they generate. -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: I will design all doomsday machines myself. If I must hire a mad scientist to assist me, I will make sure that he is sufficiently twisted to never regret his evil ways and seek to undo the damage he's caused. From gcasillo at ket.org Wed Oct 4 15:15:14 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: KET unable to host next Monday's meeting Message-ID: <39DB8FD2.2428DC14@ket.org> Dave Hempy and I have conversed and neither of us are going to be able to host next Monday's meeting. We are both backlogged with work right now. Additionally, an in-house group has reserved the meeting room during our regular meeting time. We're sorry we can't continue to host the LPM meetings, but we hope to attend these meetings soon and contribute however possible. Gregg Casillo Web Programmer, KET gcasillo@ket.org From fprice at upended.org Wed Oct 4 18:51:19 2000 From: fprice at upended.org (Frank Price) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: Neat alarm trick In-Reply-To: <200010041832.OAA25095@interlock2.lexmark.com>; from fireston@lexmark.com on Wed, Oct 04, 2000 at 02:32:49PM -0400 References: <20001004140650.D737@localhost.localdomain> <200010041832.OAA25095@interlock2.lexmark.com> Message-ID: <20001004195119.B2117@localhost.localdomain> On Wed, Oct 04, 2000 at 02:32:49PM -0400, Mik Firestone wrote: > > I have a few suggestions. The system call is a convenience - it is really > just forks a child and spins the parent into a wait loop while the child > exec's the shell call. What if you were to do it yourself? OK, seems like it should work. A few questions: > while ( 1 ) { > if ( $spid = fork() ) { > # I am the parent, do a few things and waitpid > select undef,undef,undef,0.5; # Keep my loop loose So this 4-arg form of select does the same thing as the alarm, right? Not quite sure why it's necessary if the waitpid doesn't block. > $result = waitpid( $spid, 1 ); # non-blocking > last LOOP if ( $result == $spid ); # Child process exited > if ( ++$counter > 20 ) { # 10 seconds > $timeout = 1; > kill HUP, $spid; Is kill HUP sufficient or should it be kill TERM? > This WILL NOT work if the exec causes a shell to spawn - you will then be at > least a few PIDs removed from the original child process. See perlfunc:exec > for a complete explanation of when exec spawns shells and when it won't. This > is also going to be somewhat dependant on the quirks of your execvp(3) call. In that case kill -$$ actually might be best, it seems, since it should kill all the related processes. Think that's right? > HTH ( but no promises :) Sure! Thanks, -Frank. -- Frank Price | fprice@upended.org | www.upended.org/fprice/ GPG key: www.upended.org/fprice/gpg.asc | E Pluribus Unix From fprice at upended.org Thu Oct 5 16:41:19 2000 From: fprice at upended.org (Frank Price) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: KET unable to host next Monday's meeting In-Reply-To: <39DB8FD2.2428DC14@ket.org>; from gcasillo@ket.org on Wed, Oct 04, 2000 at 04:15:14PM -0400 References: <39DB8FD2.2428DC14@ket.org> Message-ID: <20001005174119.A3203@localhost.localdomain> On Wed, Oct 04, 2000 at 04:15:14PM -0400, Gregg Casillo wrote: > Dave Hempy and I have conversed and neither of us are going to be able > to host next Monday's meeting. We are both backlogged with work right > now. Additionally, an in-house group has reserved the meeting room > during our regular meeting time. We're sorry we can't continue to host > the LPM meetings, but we hope to attend these meetings soon and > contribute however possible. So ... what shall we do? Should we try to find another meeting place on such short notice, or perhaps postpone/cancel this month's meeting? -Frank. -- Frank Price | fprice@upended.org | www.upended.org/fprice/ GPG key: www.upended.org/fprice/gpg.asc | E Pluribus Unix From janine at emazing.com Thu Oct 5 16:49:16 2000 From: janine at emazing.com (Janine) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: KET unable to host next Monday's meeting In-Reply-To: <20001005174119.A3203@localhost.localdomain> Message-ID: Do we have something to talk about this time? I don't remember if it we picked out another module or if we were continuing with CGI.pm or if it was still undecided. Janine > -----Original Message----- > From: owner-lexington-pm-list@pm.org > [mailto:owner-lexington-pm-list@pm.org]On Behalf Of Frank Price > Sent: Thursday, October 05, 2000 5:41 PM > To: lexington-pm-list@happyfunball.pm.org > Subject: Re: LPM: KET unable to host next Monday's meeting > > > On Wed, Oct 04, 2000 at 04:15:14PM -0400, Gregg Casillo wrote: > > Dave Hempy and I have conversed and neither of us are going to be able > > to host next Monday's meeting. We are both backlogged with work right > > now. Additionally, an in-house group has reserved the meeting room > > during our regular meeting time. We're sorry we can't continue to host > > the LPM meetings, but we hope to attend these meetings soon and > > contribute however possible. > > So ... what shall we do? Should we try to find another meeting place > on such short notice, or perhaps postpone/cancel this month's meeting? > > -Frank. > -- > Frank Price | fprice@upended.org | www.upended.org/fprice/ > GPG key: www.upended.org/fprice/gpg.asc | E Pluribus Unix > > From rbowen at rcbowen.com Thu Oct 5 10:35:18 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: KET unable to host next Monday's meeting References: <39DB8FD2.2428DC14@ket.org> Message-ID: <39DC9FB6.22A54E77@rcbowen.com> Gregg Casillo wrote: > > Dave Hempy and I have conversed and neither of us are going to be able > to host next Monday's meeting. We are both backlogged with work right > now. Additionally, an in-house group has reserved the meeting room > during our regular meeting time. We're sorry we can't continue to host > the LPM meetings, but we hope to attend these meetings soon and > contribute however possible. Just a quick reminder that I will NOT be there on Monday, so if someone is going to arrange a location for Monday's meeting, it needs to be someone other than me, or I guess the meeting won't happen. Anyone want to volunteer a location? Rich From fprice at upended.org Thu Oct 5 17:40:28 2000 From: fprice at upended.org (Frank Price) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: KET unable to host next Monday's meeting In-Reply-To: ; from janine@emazing.com on Thu, Oct 05, 2000 at 05:49:16PM -0400 References: <20001005174119.A3203@localhost.localdomain> Message-ID: <20001005184028.C3203@localhost.localdomain> On Thu, Oct 05, 2000 at 05:49:16PM -0400, Janine wrote: > Do we have something to talk about this time? I don't remember if > it we picked out another module or if we were continuing with CGI.pm > or if it was still undecided. Not officially. We tossed around doing Net::Telnet or some such, but nothing was decided. I've actually been trying CGI lately, and getting frustrated, so that would work for me. But I think we need a place first!! We could just pick a public bar/restaurant and go there. Someplace quiet and preferably non-smoking might be good. -Frank. -- Frank Price | fprice@upended.org | www.upended.org/fprice/ GPG key: www.upended.org/fprice/gpg.asc | E Pluribus Unix From drankin at bohemians.lexington.ky.us Wed Oct 11 05:58:46 2000 From: drankin at bohemians.lexington.ky.us (David Rankin) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: HLIM 0.2.8, and a request for help Message-ID: <20001011065846.D29722@hilda.bohemians.lexington.ky.us> I've just released version 0.2.8 of HLIM, the Home Library Information Manager. HLIM is a Perl DB front-end designed to track your entire home library collection using either a barcode scanner (right now, it supports the :Cuecat) or manual entry. Unfortunately, I'm having an annoying error messages out of one of HLIM's Perl modules. Every time it's run on my NetBSD box with 5.004_04, I see: Value of construct can be "0"; test with defined() at /usr/pkg/lib/perl5/site_perl/HLIM.pm line 65535. I don't have 2^8 - 1 lines in the module, so I am at a complete loss as to why this thing is generating the error message. Could someone with more experience in this area take a look? (But don't laugh or fuss about the stupid POD messages I have in the modules. :) The project homepage is http://hlim.sourceforge.net and downloads are at http://sourceforge.net/project/showfiles.php?group_id=10563 Many thanks, David -- David W. Rankin, Jr. Husband, Father, and UNIX Sysadmin. Email: drankin@bohemians.lexington.ky.us Address/Phone Number: Ask me. From sungo at qx.net Thu Oct 12 10:26:19 2000 From: sungo at qx.net (sungo@qx.net) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: next month Message-ID: ok folks. rich is not going to have time to think about next month's lpm. it seems he will be in *london* for the rest of this month and speaking at something called ApacheCon, whatever that is. :) so its up to us. a) we need a place to meet. tom has offered asbury. are there counter offers, objections, etc etc? b) we need a topic and a speaker/leader. if you all would like, i can do a talk on the perl-gtk module set. or if not, that's happy too. so speak up, speak loud, and lets get this sucker planned. -------- Matt Cashner Web Applications Developer The Creative Group (http://www.cre8tivegroup.com) sungo@earthling.net | Codito, ergo sum From pstackhouse at ket.org Fri Oct 13 09:48:02 2000 From: pstackhouse at ket.org (Paul Stackhouse) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: next month References: Message-ID: <39E720A2.A78D5672@ket.org> Would you all consider joining with a larger organization of computer users? The Central Kentucky Computer Society leases office space including 2 labs and a meeting room (for 30 people) with projector. They offer a monthly newsletter, around seven hundred members, sponsors regional events, etc. The caveat would be that regular meeting attenders would be asked to become members (not a hard sell) at $29/year. Seven current members would petition for a meeting night and someone would have to agree to be the (gasp!) leader the group. Here is a calendar of current meetings: http://www.ckcs.org/calendar.shtml The general meeting on the second Monday is not held at the resource center, but the portable projector is moved to UK Gluck Center for the evening. I am copying this message to CKCS's president, Jim McCormick. -paul sungo@qx.net wrote: > > ok folks. rich is not going to have time to think about next month's lpm. > it seems he will be in *london* for the rest of this month and speaking at > something called ApacheCon, whatever that is. :) so its up to us. > > a) we need a place to meet. tom has offered asbury. are there counter offers, > objections, etc etc? > > b) we need a topic and a speaker/leader. if you all would like, i can do a > talk on the perl-gtk module set. or if not, that's happy too. > > so speak up, speak loud, and lets get this sucker planned. > > -------- > Matt Cashner > Web Applications Developer > The Creative Group (http://www.cre8tivegroup.com) > sungo@earthling.net | Codito, ergo sum -- Paul Stackhouse Webmaster Kentucky Educational TV Voice: 859-258-7135 600 Cooper Drive Fax: 859-258-7399 Lexington, KY 40502 http://www.ket.org From sungo at qx.net Fri Oct 13 09:53:12 2000 From: sungo at qx.net (sungo@qx.net) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: next month In-Reply-To: <39E720A2.A78D5672@ket.org> Message-ID: On Fri, 13 Oct 2000, Paul Stackhouse wrote: > Would you all consider joining with a larger organization of computer > users? The Central Kentucky Computer Society leases office space > including 2 labs and a meeting room (for 30 people) with projector. > They offer a monthly newsletter, around seven hundred members, sponsors > regional events, etc. i'd like to keep perlmongers a separate entity. > The caveat would be that regular meeting attenders would be asked to > become members (not a hard sell) at $29/year. Seven current members > would petition for a meeting night and someone would have to agree to be > the (gasp!) leader the group. Here is a calendar of current meetings. i'm here to learn about perl (and perl only thank you) and geek a bit. i'm not paying dues for that privilege. i very much enjoy the get together hang out eat food and talk code approach. in other words, i very much enjoy perlmongers quite the way it is even if we are a bit disorganized some of the time. -------- Matt Cashner Web Applications Developer The Creative Group (http://www.cre8tivegroup.com) sungo@earthling.net | Codito, ergo sum From janine at emazing.com Fri Oct 13 10:16:02 2000 From: janine at emazing.com (Janine) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: next month In-Reply-To: Message-ID: Ditto. I went through the same thing with KIPCUG (Kentucky-Indiana PC Users Group) when I started the Louisville Perl Mongers. Even though they offer meeting rooms and A/V equipment, the whole dues and membership thing bothered me. Janine > -----Original Message----- > From: owner-lexington-pm-list@pm.org > [mailto:owner-lexington-pm-list@pm.org]On Behalf Of sungo@qx.net > Sent: Friday, October 13, 2000 10:53 AM > To: lexington-pm-list@happyfunball.pm.org > Subject: Re: LPM: next month > > > On Fri, 13 Oct 2000, Paul Stackhouse wrote: > > > Would you all consider joining with a larger organization of computer > > users? The Central Kentucky Computer Society leases office space > > including 2 labs and a meeting room (for 30 people) with projector. > > They offer a monthly newsletter, around seven hundred members, sponsors > > regional events, etc. > > i'd like to keep perlmongers a separate entity. > > > The caveat would be that regular meeting attenders would be asked to > > become members (not a hard sell) at $29/year. Seven current members > > would petition for a meeting night and someone would have to agree to be > > the (gasp!) leader the group. Here is a calendar of current meetings. > > i'm here to learn about perl (and perl only thank you) and geek a bit. > i'm not paying dues for that privilege. i very much enjoy the get together > hang out eat food and talk code approach. in other words, i very much > enjoy perlmongers quite the way it is even if we are a bit disorganized > some of the time. > > > -------- > Matt Cashner > Web Applications Developer > The Creative Group (http://www.cre8tivegroup.com) > sungo@earthling.net | Codito, ergo sum > > > From hempy at ket.org Fri Oct 13 12:02:32 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: next month In-Reply-To: <39E720A2.A78D5672@ket.org> References: Message-ID: <5.0.0.25.0.20001013130058.037d8ea0@mail.ket.org> The CKCS facilities are quite functional. I wouldn't mind spending $29/year to support another volunteer computer-evangelizing organization. -dave At 10:48 AM 10/13/2000 -0400, you wrote: >Would you all consider joining with a larger organization of computer >users? The Central Kentucky Computer Society leases office space >including 2 labs and a meeting room (for 30 people) with projector. >They offer a monthly newsletter, around seven hundred members, sponsors >regional events, etc. > >The caveat would be that regular meeting attenders would be asked to >become members (not a hard sell) at $29/year. Seven current members >would petition for a meeting night and someone would have to agree to be >the (gasp!) leader the group. Here is a calendar of current meetings: > > http://www.ckcs.org/calendar.shtml > >The general meeting on the second Monday is not held at the resource >center, but the portable projector is moved to UK Gluck Center for the >evening. > >I am copying this message to CKCS's president, Jim McCormick. > > -paul > >sungo@qx.net wrote: > > > > ok folks. rich is not going to have time to think about next month's lpm. > > it seems he will be in *london* for the rest of this month and speaking at > > something called ApacheCon, whatever that is. :) so its up to us. > > > > a) we need a place to meet. tom has offered asbury. are there counter > offers, > > objections, etc etc? > > > > b) we need a topic and a speaker/leader. if you all would like, i can do a > > talk on the perl-gtk module set. or if not, that's happy too. > > > > so speak up, speak loud, and lets get this sucker planned. > > > > -------- > > Matt Cashner > > Web Applications Developer > > The Creative Group (http://www.cre8tivegroup.com) > > sungo@earthling.net | Codito, ergo sum > >-- >Paul Stackhouse Webmaster >Kentucky Educational TV Voice: 859-258-7135 >600 Cooper Drive Fax: 859-258-7399 >Lexington, KY 40502 http://www.ket.org -- David Hempy Internet Database Administrator Kentucky Educational Television -- (859)258-7164 -- (800)333-9764 From tombraun at aircontroltechniques.com Tue Oct 17 18:00:44 2000 From: tombraun at aircontroltechniques.com (Tom Braun) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: next month In-Reply-To: Message-ID: <000001c0388e$17b62b60$080614ac@student.asbury.edu> I agree. I'd rather not pay (poor college student). However, I'm afraid what Asbury is offering may not be much better. They first require a faculty sponser, which I could probably get, but they also require one of their employees to be there the whole time if their A/V equipment is there. They only pay them minimum wage, so we would probably be spending $10 or $15 dollars per meeting, which isn't too much per person but does add up. I'm trying to get this waved, but I may not have an answer until a couple days before our next meeting. The other option would be to meet in a room where there is no A/V equipment, which would most likely be free regardless. Is this something I should pursue further? I don't want to waste time if there is no interest. Tom -----Original Message----- From: owner-lexington-pm-list@pm.org [mailto:owner-lexington-pm-list@pm.org]On Behalf Of Janine Sent: Friday, October 13, 2000 11:16 AM To: lexington-pm-list@happyfunball.pm.org Subject: RE: LPM: next month Ditto. I went through the same thing with KIPCUG (Kentucky-Indiana PC Users Group) when I started the Louisville Perl Mongers. Even though they offer meeting rooms and A/V equipment, the whole dues and membership thing bothered me. Janine > -----Original Message----- > From: owner-lexington-pm-list@pm.org > [mailto:owner-lexington-pm-list@pm.org]On Behalf Of sungo@qx.net > Sent: Friday, October 13, 2000 10:53 AM > To: lexington-pm-list@happyfunball.pm.org > Subject: Re: LPM: next month > > > On Fri, 13 Oct 2000, Paul Stackhouse wrote: > > > Would you all consider joining with a larger organization of computer > > users? The Central Kentucky Computer Society leases office space > > including 2 labs and a meeting room (for 30 people) with projector. > > They offer a monthly newsletter, around seven hundred members, sponsors > > regional events, etc. > > i'd like to keep perlmongers a separate entity. > > > The caveat would be that regular meeting attenders would be asked to > > become members (not a hard sell) at $29/year. Seven current members > > would petition for a meeting night and someone would have to agree to be > > the (gasp!) leader the group. Here is a calendar of current meetings. > > i'm here to learn about perl (and perl only thank you) and geek a bit. > i'm not paying dues for that privilege. i very much enjoy the get together > hang out eat food and talk code approach. in other words, i very much > enjoy perlmongers quite the way it is even if we are a bit disorganized > some of the time. > > > -------- > Matt Cashner > Web Applications Developer > The Creative Group (http://www.cre8tivegroup.com) > sungo@earthling.net | Codito, ergo sum > > > From hempy at ket.org Thu Oct 19 17:05:43 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: Question about escapes in a regex Message-ID: <5.0.0.25.0.20001019175456.02981970@mail.ket.org> Okay...I want to replace a styleid (such as '\s15\qt'...and yes, those are backslashes in the ID, not escape sequences) with a stylename throughout an RTF file. So I try: $styleid = '\s15\qt'; $wholefile =~ s/$styleid/$stylename/g; Simple enough, right? Wrong. :-( After pulling out the last three hairs on my head, I concocted a test script (see below if you care), which shows that the backslashes in $styleid's value are being interpreted in a doublequotish way by the regex. My current solution is to escape all those backslashes: $styleid = '\s15\qt'; $styleid =~ s[\\][\\\\]g; $wholefile =~ s/$styleid/$stylename/g; So I'm good to go, but I'm a little uneasy with the cludgeness of my solution, and the fact that I can't just make it work the way I want it to. I don't like modifying then un-modifying the value (or creating a copy to modify). Any perl gurus have experience/insight with this? -dave Appendix A. The Script use strict; my $wholefile = ' {\s15\qt more stuff KET_TESTING_STYLE} {\s12\qt more stuff KET_TESTING2_STYLE} \s12\qt some stuff here is some \s12\qt stuff. but now some \s15\qt other stuff. '; my $stylesheet = $wholefile; while ($stylesheet =~ /{([^{}]*?)}/g) { my $style = $1; next unless ($style =~ /^(\\s\d+\S+) .* KET_(\w+)_STYLE/); my ($styleid, $stylename) = ($1, $2); print "$styleid: ($stylename) \n"; print "\nNeed to replace [$styleid] in [$wholefile]\n\n"; print "\nTry substituting [$styleid] directly:\n"; if ($wholefile =~ s/$styleid/$stylename/g) { print ":-) Substituted [$styleid]\n"; } else { print ":-( [$styleid] was not substituted!\n"; } $styleid =~ s[\\][\\\\]g; print "\nTry substituting it escaped: [$styleid]:\n"; if ($wholefile =~ s/$styleid/$stylename/g) { print ":-) Substituted [$styleid]\n"; } else { print ":-( [$styleid] was not substituted!\n"; } } print "\nResult: [$wholefile]\n\n"; Appendix B. The Execution D:\Temp>t.pl Found a style definition: \s15\qt = TESTING Need to replace [\s15\qt] in [ {\s15\qt more stuff KET_TESTING_STYLE} {\s12\qt more stuff KET_TESTING2_STYLE} \s12\qt some stuff here is some \s12\qt stuff. but now some \s15\qt other stuff. ] Try substituting [\s15\qt] directly: :-( [\s15\qt] was not substituted! Try substituting it escaped: [\\s15\\qt]: :-) Substituted [\\s15\\qt] Found a style definition: \s12\qt = TESTING2 Need to replace [\s12\qt] in [ {TESTING more stuff KET_TESTING_STYLE} {\s12\qt more stuff KET_TESTING2_STYLE} \s12\qt some stuff here is some \s12\qt stuff. but now some TESTING other stuff. ] Try substituting [\s12\qt] directly: :-( [\s12\qt] was not substituted! Try substituting it escaped: [\\s12\\qt]: :-) Substituted [\\s12\\qt] Result: [ {TESTING more stuff KET_TESTING_STYLE} {TESTING2 more stuff KET_TESTING2_STYLE} TESTING2 some stuff here is some TESTING2 stuff. but now some TESTING other stuff. ] D:\Temp> -- David Hempy Internet Database Administrator Kentucky Educational Television -- (859)258-7164 -- (800)333-9764 From sungo at qx.net Thu Oct 19 17:34:40 2000 From: sungo at qx.net (sungo@qx.net) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: Question about escapes in a regex In-Reply-To: <5.0.0.25.0.20001019175456.02981970@mail.ket.org> Message-ID: perldoc -f quotemeta that builtin should do what you want quite nicely. -------- Matt Cashner Web Applications Developer The Creative Group (http://www.cre8tivegroup.com) sungo@earthling.net | Codito, ergo sum From sungo at qx.net Sat Oct 21 15:59:38 2000 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: testers needed :) Message-ID: <200010212059.e9LKxfd01570@katerina.cre8tivegroup.com> hey all. i've got a little app that could use some testers (besides rich and i). i'm specifically interested in the gtk gui side of this app. it can be found at http://matt.cre8tivegroup.com/pmp3 the requirements are listed there. i already know it doesnt work on *bsd because of the codec it relies on. the console side of the app might even work under windows. i'd love to find out if it could. so yeah, i'd love feedback, comments, bug reports, etc. thanks all. m. From rbowen at rcbowen.com Wed Oct 25 12:08:47 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: testers needed :) References: <200010212059.e9LKxfd01570@katerina.cre8tivegroup.com> Message-ID: <39F7139F.3F72ED74@rcbowen.com> Matt Cashner wrote: > > hey all. i've got a little app that could use some testers (besides rich > and i). i'm specifically interested in the gtk gui side of this app. > > it can be found at http://matt.cre8tivegroup.com/pmp3 > > the requirements are listed there. i already know it doesnt work on *bsd > because of the codec it relies on. the console side of the app might > even work under windows. i'd love to find out if it could. > > so yeah, i'd love feedback, comments, bug reports, etc. thanks all. pmp3 rocks. Rich -- Author: Apache Server Unleashed - www.apacheunleashed.com Come See Me At ApacheCon! - www.apachecon.com From sungo at qx.net Wed Oct 25 12:15:35 2000 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: testers needed :) Message-ID: <200010251715.e9PHFcR00544@katerina.cre8tivegroup.com> On Wed, 25 Oct 2000 13:08:47 -0400, Rich Bowen said: > pmp3 rocks. have you tried the latest version? lots o changes since you left for london. -- Matt Cashner Web Applications Developer The Creative Group (http://www.cre8tivegroup.com) sungo@earthling.net | Codito, ergo sum From oneiros at dcr.net Thu Oct 26 13:37:33 2000 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: a problem with modularity using Net::LDAP Message-ID: I'm attempting to make a module which essentially returns an object from a different module. Basically, the plan is, that so I don't have to keep track of multiple passwords in multiple places, I'm using a module which contains information which I need for conecting to our LDAP server, but which will return a Net::LDAP object. [and I can pass it arguments so that it'll bind as admin, read-only to everything, as a standard user or anonymously, to either the main server, or to one of the two development servers] When I return a Net::LDAP object from this module, however, I get: Can't call method "search" on an undefined value at ./update_ldap.pl line 156. If I return a reference to the object, and then dereference the returned value, I get the same thing. So, I was thinking, maybe it's a problem with the scope of the variable. [even though it's technically just a reference], so I changed it so the temporary variable that I was storing the object in while I did the bind was a package variable, and so, wouldn't just be valid in the confines of that function. But of course, I got the same result. Has anyone ever done anything similar, and know what the correct syntax is to pass an object from an unrelated module? ----- Joe Hourcle From rbowen at rcbowen.com Sat Oct 28 08:11:26 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:54 2004 Subject: LPM: testers needed :) References: <200010251715.e9PHFcR00544@katerina.cre8tivegroup.com> Message-ID: <39FAD07E.597236CB@rcbowen.com> Matt Cashner wrote: > > On Wed, 25 Oct 2000 13:08:47 -0400, Rich Bowen said: > > > pmp3 rocks. > > have you tried the latest version? lots o changes since you left for > london. No. Not yet. I'll get it monday. Rich -- Author: Apache Server Unleashed - www.apacheunleashed.com Come See Me At ApacheCon! - www.apachecon.com