From rbowen at rcbowen.com Sat Jan 1 08:55:21 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:36 2004 Subject: LPM: Happy ... Message-ID: <386E1559.BA783218@rcbowen.com> > perl -e '@time = localtime; print $time[5], "\n"' ; 100 :-) Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From soward at uky.edu Sat Jan 1 09:56:47 2000 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Happy ... References: <386E1559.BA783218@rcbowen.com> Message-ID: <386E23BF.C1644A2B@uky.edu> Rich Bowen wrote: > > > perl -e '@time = localtime; print $time[5], "\n"' ; > 100 > Just a reminder of course, that the above results are the correct and expected ones: > All array elements are numeric, and come straight > out of a struct tm. In particular this means that > $mon has the range 0..11 and $wday has the range > 0..6 with sunday as day 0. Also, $year is the > number of years since 1900, that is, $year is 123 > in year 2023, and not simply the last two digits > of the year. If you assume it is, then you create > non-Y2K-compliant programs--and you wouldn't want > to do that, would you? -- John Soward University of Kentucky Technical Services e:soward@uky.edu p:(606)257-2900 f:(606)323-1978 w: http://neworder.cc.uky.edu/ From gcasillo at ket.org Sat Jan 1 15:59:12 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Happy ... References: <386E1559.BA783218@rcbowen.com> Message-ID: <386E78B0.A1B7F1C8@ket.org> Yeah, we ran into a problem with this today. A schedule we use to display KET's programming was looking for "jan100" at midnight last night. Dave Hempy, another Perlmonger and fellow KET hacker came up with the following solution: $year = $year % 100; $year = sprintf("%02d",$year); If you want to work with the entire four digit year, I guess you'd add 1900 to your year and go from there. But if you've been working with two digits, this works quite well. Felice Nuovo Anno, Gregg Casillo Rich Bowen wrote: > > perl -e '@time = localtime; print $time[5], "\n"' ; > 100 > > :-) > > Rich > -- > http://www.ApacheUnleashed.com/ > Lexington Perl Mongers - http://lexington.pm.org/ > PGP Key - http://www.rcbowen.com/pgp.txt From mandrews at bit0.com Sat Jan 1 16:58:29 2000 From: mandrews at bit0.com (Mike Andrews) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Happy ... In-Reply-To: <386E78B0.A1B7F1C8@ket.org> Message-ID: Yup, that's how I do it too, either $year % 100 or $year + 1900. Apparently a few CGI scripts out there in the world were printing "19100" for the year today. Heh. Mike Andrews (MA12) * mandrews@dcr.net * http://www.bit0.com/ VP, sysadmin, & network guy, Digital Crescent Inc, Frankfort KY Internet services for Frankfort, Lawrenceburg, Owenton, & Shelbyville "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." On Sat, 1 Jan 2000, Gregg Casillo wrote: > Yeah, we ran into a problem with this today. A schedule we use to > display KET's programming was looking for "jan100" at midnight last > night. Dave Hempy, another Perlmonger and fellow KET hacker came up with > the following solution: > > $year = $year % 100; > $year = sprintf("%02d",$year); > > If you want to work with the entire four digit year, I guess you'd add > 1900 to your year and go from there. But if you've been working with two > digits, this works quite well. > > Felice Nuovo Anno, > Gregg Casillo > > Rich Bowen wrote: > > > > perl -e '@time = localtime; print $time[5], "\n"' ; > > 100 > > > > :-) > > > > Rich > > -- > > http://www.ApacheUnleashed.com/ > > Lexington Perl Mongers - http://lexington.pm.org/ > > PGP Key - http://www.rcbowen.com/pgp.txt > From hempy at ket.org Mon Jan 3 10:33:31 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: NT v. unix (was Re: LPM: Happy ...) In-Reply-To: <386E1559.BA783218@rcbowen.com> Message-ID: <4.1.20000103110928.03e2b6b0@mail.ket.org> At 09:55 AM 1/1/2000 -0500, Rich wrote: >> perl -e '@time = localtime; print $time[5], "\n"' ; >100 > Hmm... Trying to figure out why this didn't work on my machine: >D:\src>perl -e '@time = localtime; print $time[5], "\n"' ; >Can't find string terminator "'" anywhere before EOF at -e line 1. > > While on unix: >cooper 1$ perl -e '@time = localtime; print $time[5], "\n"' ; >100 >cooper 2$ > So, a little playing around on WinNT finally finds a working solution: >D:\src>perl -e '@time = localtime; print $time[5], "\n"' ; >Can't find string terminator "'" anywhere before EOF at -e line 1. > >D:\src>perl -e '@time = localtime; print $time[5]; ' >Can't find string terminator "'" anywhere before EOF at -e line 1. > >D:\src>perl -e '@time = localtime; print $time[5], "\n"; ' >Can't find string terminator "'" anywhere before EOF at -e line 1. > >D:\src>perl -e "@time = localtime; print $time[5], '\n'; " >100\n >D:\src>perl -e "@time = localtime; print $time[5], \"\n\"; " >100 > >D:\src> > I'm not exactly clear where the breakdown is. Something to do with the treating of the ' (single quote) quoting, I suspect by the command interpreter. It appears that (at least) one of the single quotes is making it to perl. Is this the expected behavior under unix? I would have expected the entire string to come in as a single element of @ARGV, with the quotes already stripped. This is just a hunch, and clearly not the case on NT, anyway. Illumination, anyone? Also, the final, working version I have for NT doesn't work on unix: >cooper 3$ perl -e "@time = localtime; print $time[5], \"\n\"; " >Unmatched " >cooper 4$ Flailing about a bunch of escapes doesn't seem to help: >cooper 7$ perl -e "@time = localtime; print $time[5], \\\"\\\n\\\"; " >Unmatched " >cooper 8$ perl -e "@time = localtime; print $time[5], \\"\\n\\"; " >time - Undefined variable >cooper 9$ Can anyone show me a platform-independent version of this command line script? -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From rbowen at rcbowen.com Mon Jan 3 10:49:22 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: NT v. unix (was Re: LPM: Happy ...) References: <4.1.20000103110928.03e2b6b0@mail.ket.org> Message-ID: <3870D312.28A07A8C@rcbowen.com> Unfortunately, this is a feature of the command line processor, not of Perl. On NT, you need to use "" to surround your command line arguments. On some Unixes you can use "" or '', and on some, apparently, you can only use ''. All of those backslashes confuse me. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From sml at zfx.com Mon Jan 3 10:51:53 2000 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:05:37 2004 Subject: NT v. unix (was Re: LPM: Happy ...) References: <4.1.20000103110928.03e2b6b0@mail.ket.org> Message-ID: <3870D3A9.794B@zfx.com> David Hempy wrote: > Also, the final, working version I have for NT doesn't work on unix: > > >cooper 3$ perl -e "@time = localtime; print $time[5], \"\n\"; " don't forget about the friendly -l switch. it does many things, but in its most basic version, it adds a newline after every print: $ perl -le '@time = localtime; print $time[5]' saves some pesky backslashes and other typing. -- Steve Lane From fprice at mis.net Mon Jan 3 17:23:25 2000 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Discussing modules Message-ID: Hi LPM --- I'm working on a module that's getting pretty close to being usable. Ultimately I'd like to put it on CPAN since I haven't found anything there like it. But, I've never contributed before, and this is my first "real" OO module, so I'd like some feedback first to make sure I don't commit any cardinal sins. And of course to maybe improve the approach :-) Some of the issues I'm wondering about are module naming, other modules inheriting this one, preserving object states, efficiency, letting the user specify alternate methods, etc. Is there any interest in discussing some of these issues on the list? -Frank. ____ ____ Frank Price fprice@mis.net Linux: the choice of a GNU generation -|- Why not go mad? From hempy at ket.org Mon Jan 3 17:42:51 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Discussing modules In-Reply-To: Message-ID: <4.1.20000103183703.035d5770@mail.ket.org> At 06:23 PM 1/3/2000 -0500, you wrote: >Hi LPM --- > >I'm working on a module that's getting pretty close to being usable. >Ultimately I'd like to put it on CPAN since I haven't found anything >there like it.... Sounds like fun! Sounds like a worthwhile discussion for next week's meeting... ... which is Monday, January 10th, 6 PM. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From hempy at ket.org Tue Jan 4 00:23:24 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Thanks, Frank Price and Rich Bowen! In-Reply-To: <4.1.20000103183703.035d5770@mail.ket.org> References: Message-ID: <4.1.20000104011438.03e977f0@mail.ket.org> I am finishing up *the* ugliest code I have ever written in *any* language. It converts RTF to HTML. Because of its stench, I want to turn it into a module so I don't have to look at it while writing the more interesting code! ;-) I recalled writing modules was a topic of a recent meeting, but certainly don't remember enough details to do it from memory. I checked the website (http://lexington.pm.org/meetings/) and sure enough, there it was, in more detail than I could have possibly recorded myself. Thanks to Frank and Rich for presenting and posting the topic on the website! If any of you need to refer back to meetings, be sure to check out the website. -dave :-) -- David Hempy Internet Database Administrator Kentucky Educational Television From janine.ladick at fetterprinting.com Tue Jan 4 06:49:27 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Discussing modules In-Reply-To: Message-ID: <200001041348.IAA02056@sidewinder.fetterprinting.com> > Some of the issues I'm wondering about are module naming, other > modules inheriting this one, preserving object states, efficiency, > letting the user specify alternate methods, etc. > > Is there any interest in discussing some of these issues on the list? I'd say yes, since both you and Dave (and possibly others) have projects like this going on. Janine From rbowen at rcbowen.com Tue Jan 4 07:36:22 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Monday's Meeting Message-ID: <3871F756.B0BF7174@rcbowen.com> We'll be meeting on Monday, as Dave said in his note. We don't have a "formal" speaker lined up, but there's still time for someone to volunteer. Otherwise, it looks like there's some interest in talking about module issues (particularly, OO modules), as Frank mentioned in his note. We can either discuss that here on the list, or discuss it some on Monday. Or, more likely, both. See you Monday. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From rbowen at rcbowen.com Tue Jan 4 08:13:14 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Re: John Gibson? References: <3871FFB3.C7D15734@rcbowen.com> Message-ID: <3871FFFA.69B4D181@rcbowen.com> Any of you folks still have contact with John Gibson? His mail is bouncing, and I need to know whether to unsu*scribe him or change the address to something else. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From fprice at mis.net Tue Jan 4 17:59:37 2000 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Monday's Meeting In-Reply-To: <3871F756.B0BF7174@rcbowen.com> Message-ID: On Tue, 4 Jan 2000, Rich Bowen wrote: # We'll be meeting on Monday, as Dave said in his note. We don't have a # "formal" speaker lined up, but there's still time for someone to # volunteer. Otherwise, it looks like there's some interest in talking # about module issues (particularly, OO modules), as Frank mentioned in # his note. We can either discuss that here on the list, or discuss it # some on Monday. Or, more likely, both. I'd be happy to lead a discussion on OO modules at the meeting if nothing better comes up. Should we start from the ground up, or just dive right in to some particular aspect? -Frank. ____ ____ Frank Price fprice@mis.net Linux: the choice of a GNU generation -|- Why not go mad? From repett0 at sac.uky.edu Tue Jan 4 18:10:39 2000 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Monday's Meeting In-Reply-To: Message-ID: ground up :). Um where and when is the meeting Ron Petty UKLUG treasurer On Tue, 4 Jan 2000, Frank Price wrote: > On Tue, 4 Jan 2000, Rich Bowen wrote: > > # We'll be meeting on Monday, as Dave said in his note. We don't have a > # "formal" speaker lined up, but there's still time for someone to > # volunteer. Otherwise, it looks like there's some interest in talking > # about module issues (particularly, OO modules), as Frank mentioned in > # his note. We can either discuss that here on the list, or discuss it > # some on Monday. Or, more likely, both. > > I'd be happy to lead a discussion on OO modules at the meeting if > nothing better comes up. Should we start from the ground up, or just > dive right in to some particular aspect? > > -Frank. > ____ ____ > Frank Price fprice@mis.net > Linux: the choice of a GNU generation -|- Why not go mad? > From rich at mullikin.com Tue Jan 4 18:32:06 2000 From: rich at mullikin.com (R Mullikin) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Monday's Meeting In-Reply-To: ; from repett0@sac.uky.edu on Tue, Jan 04, 2000 at 07:10:39PM -0500 References: Message-ID: <20000104193206.A21152@mullikin.com> Info on meetings, and directions, is usually here http://lexington.pm.org On Tue, Jan 04, 2000 at 07:10:39PM -0500, Thus spake repett0@sac.uky.edu (repett0@sac.uky.edu): > > ground up :). Um where and when is the meeting > > Ron Petty > UKLUG treasurer > > On Tue, 4 Jan 2000, Frank Price wrote: > > > On Tue, 4 Jan 2000, Rich Bowen wrote: > > > > # We'll be meeting on Monday, as Dave said in his note. We don't have a > > # "formal" speaker lined up, but there's still time for someone to > > # volunteer. Otherwise, it looks like there's some interest in talking > > # about module issues (particularly, OO modules), as Frank mentioned in > > # his note. We can either discuss that here on the list, or discuss it > > # some on Monday. Or, more likely, both. > > > > I'd be happy to lead a discussion on OO modules at the meeting if > > nothing better comes up. Should we start from the ground up, or just > > dive right in to some particular aspect? > > > > -Frank. > > ____ ____ > > Frank Price fprice@mis.net > > Linux: the choice of a GNU generation -|- Why not go mad? > > > -- ===================================================== Richard Mullikin hdwinfo@horsedata.com Handicapper's Data Warehouse www.horsedata.com ===================================================== From janine.ladick at fetterprinting.com Wed Jan 5 06:38:06 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Monday's Meeting In-Reply-To: References: <3871F756.B0BF7174@rcbowen.com> Message-ID: <200001051337.IAA22478@sidewinder.fetterprinting.com> > I'd be happy to lead a discussion on OO modules at the meeting if > nothing better comes up. Should we start from the ground up, or just > dive right in to some particular aspect? I vote for ground up, unless that'll bore the Perl gurus in the group. Janine From janine.ladick at fetterprinting.com Wed Jan 5 06:44:12 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Perl/Tk Message-ID: <200001051343.IAA22547@sidewinder.fetterprinting.com> Hello, List! Anyone out there using the Tk module? I'm starting a project today which will be much more successful if I can provide a graphical interface, and I was wondering if any of you had wisdom to hand down from the mountain. TIA, Janine From rbowen at rcbowen.com Wed Jan 5 07:48:47 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Monday's Meeting References: <3871F756.B0BF7174@rcbowen.com> <200001051337.IAA22478@sidewinder.fetterprinting.com> Message-ID: <38734BBF.D00A0637@rcbowen.com> Janine Ladick wrote: > > > I'd be happy to lead a discussion on OO modules at the meeting if > > nothing better comes up. Should we start from the ground up, or just > > dive right in to some particular aspect? > > I vote for ground up, unless that'll bore the Perl gurus in the group. Ground up is good. Perl's OO implementation is fairly bare-bones, from the little that I understand about how languages like Java and C++ do things. I never really understood Java OO, but Perl OO makes a lot of sense to me. Perhaps Java would make more sense to me now. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From rbowen at rcbowen.com Wed Jan 5 07:50:38 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Perl/Tk References: <200001051343.IAA22547@sidewinder.fetterprinting.com> Message-ID: <38734C2E.1E3EB44F@rcbowen.com> Janine Ladick wrote: > > Hello, List! > > Anyone out there using the Tk module? I'm starting a project today > which will be much more successful if I can provide a graphical > interface, and I was wondering if any of you had wisdom to hand > down from the mountain. I've used it a little bit, but it was a while ago. there are few new Perl/TK books out. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From janine.ladick at fetterprinting.com Wed Jan 5 07:07:32 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Upgraded DBI module (Win32) Message-ID: <200001051406.JAA23562@sidewinder.fetterprinting.com> There was some talk on the list last month about problems with DBI on Win32. I just read that Activestate released an upgraded DBI module last week. Dave - I know you've already found a workaround, but you might want to download the new module and see if your ODBC problems are now resolved. Janine From gcasillo at ket.org Wed Jan 5 11:05:37 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Perl/Tk References: <200001051343.IAA22547@sidewinder.fetterprinting.com> Message-ID: <387379E0.E9890298@ket.org> I bought O'Reilly's book, Learning Perl/Tk, over the holidays and started tinkering with Tk. I recommend the book if you're interested in killing trees. After working with a few widgets, it has a Java AWT feel to it, but the language is much more intuitive. And it's significantly faster. Of course if you haven't already, you need to download the Tk modules from CPAN. If you don't know which modules you need, I'd be happy help you find them. Gregg From marek at cs.uky.edu Wed Jan 5 11:30:06 2000 From: marek at cs.uky.edu (Victor Marek) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Perl/Tk In-Reply-To: Gregg Casillo "Re: LPM: Perl/Tk" (Jan 5, 12:05pm) Message-ID: <200001051730.MAA22931@mostowski.cs.engr.uky.edu> Brad, Actually, Mr. Cunningham is not a prospective graduate student. He is a graduating student fm Vanderbilt whom I met when I visited Nashville and, since he was (is?) looking for a job, encouraged to send me his resume. Let me know how are you doing. Maybe we could get for lunch sometimes? w.. -- Victor W. Marek Department of Computer Science marek@cs.uky.edu University of Kentucky marek@cs.engr.uky.edu Lexington, KY 40506 606-257-3496 (office) 606-257-3961 (Dept) http://www.cs.engr.uky.edu/~marek 606-323-1971 (FAX) From marek at cs.uky.edu Wed Jan 5 11:33:13 2000 From: marek at cs.uky.edu (Victor Marek) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Sorry, Message-ID: <200001051733.MAA22942@mostowski.cs.engr.uky.edu> Sorry, wrong reply key. Please forgive... VM -- Victor W. Marek Department of Computer Science marek@cs.uky.edu University of Kentucky marek@cs.engr.uky.edu Lexington, KY 40506 606-257-3496 (office) 606-257-3961 (Dept) http://www.cs.engr.uky.edu/~marek 606-323-1971 (FAX) From hempy at ket.org Thu Jan 6 05:30:08 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Upgraded DBI module (Win32) In-Reply-To: <200001051406.JAA23562@sidewinder.fetterprinting.com> Message-ID: <4.1.20000106062747.00b98490@mail.ket.org> At 09:07 AM 1/5/2000 -0400, you wrote: >There was some talk on the list last month about problems with DBI >on Win32. I just read that Activestate released an upgraded DBI >module last week. Dave - I know you've already found a >workaround, but you might want to download the new module and >see if your ODBC problems are now resolved. > >Janine Thanks. All is working well with Win32::ODBC, so I'll stick it out... I'm not in the beta testing business! ;-) On my next fresh project I'll probably give the updated DBI another shot, or perhaps Gregg will try it on one of his projects. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From rbowen at rcbowen.com Mon Jan 10 14:26:55 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Reminder Message-ID: <387A408F.D95F45F3@rcbowen.com> A reminder for those of you with short-term memory like mine: We'll be meeting tonight at KET at 6pm. Please bring money for Pizza, and all your questions about module programming, especially OO. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From janine.ladick at fetterprinting.com Tue Jan 11 12:39:39 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp Message-ID: <200001111938.OAA15652@sidewinder.fetterprinting.com> Hello, List! Have any of you used ActiveState's PerlApp? From the web site, I gather that PerlApp creates executables from Perl scripts so that you can run 'em on machines without Perl. This interests me; I'm working on a few utility scripts that use Tk to provide what I hope is a nice user interface, and I'd prefer to distribute .exe files to my users (um, all two of them) rather than commit myself to installing and maintaining Perl on their PCs. Does anyone care to share a success (or failure) story or know of ways other than PerlApp to create standalone Perl applications? Thanks, Janine From rbowen at rcbowen.com Tue Jan 11 13:51:43 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp References: <200001111938.OAA15652@sidewinder.fetterprinting.com> Message-ID: <387B89CF.FE436953@rcbowen.com> Janine Ladick wrote: > > Hello, List! > > Have any of you used ActiveState's PerlApp? From the web site, I > gather that PerlApp creates executables from Perl scripts so that > you can run 'em on machines without Perl. This interests me; I'm > working on a few utility scripts that use Tk to provide what I hope is > a nice user interface, and I'd prefer to distribute .exe files to my > users (um, all two of them) rather than commit myself to installing > and maintaining Perl on their PCs. > > Does anyone care to share a success (or failure) story or know of > ways other than PerlApp to create standalone Perl applications? The resulting exe is HUGE, but it seems to work just fine. It basically has the entire Perl runtime in it, as well as whatever modules you used. They had a free trial version for a while (not sure if they still have that) and you could use it 5 times, or something like that. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From janine.ladick at fetterprinting.com Tue Jan 11 12:57:12 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp In-Reply-To: <387B89CF.FE436953@rcbowen.com> Message-ID: <200001111956.OAA16089@sidewinder.fetterprinting.com> > > Does anyone care to share a success (or failure) story or know of > > ways other than PerlApp to create standalone Perl applications? > > The resulting exe is HUGE, but it seems to work just fine. It basically > has the entire Perl runtime in it, as well as whatever modules you used. > They had a free trial version for a while (not sure if they still have > that) and you could use it 5 times, or something like that. The trial last for 7 days, but they say you can continue downloading new keys until you've had enough fun for one lifetime and fork out the 95 bucks for a registered copy. I suspected the .exes would be big. :-) Did they run any slower than the original script? Janine From soward at uky.edu Tue Jan 11 14:08:42 2000 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp References: <200001111956.OAA16089@sidewinder.fetterprinting.com> Message-ID: <387B8DCA.35703AA3@uky.edu> Janine Ladick wrote: > > > > Does anyone care to share a success (or failure) story or know of > > > ways other than PerlApp to create standalone Perl applications? > > > > The resulting exe is HUGE, but it seems to work just fine. It basically > > has the entire Perl runtime in it, as well as whatever modules you used. > > They had a free trial version for a while (not sure if they still have > > that) and you could use it 5 times, or something like that. > > The trial last for 7 days, but they say you can continue downloading > new keys until you've had enough fun for one lifetime and fork out > the 95 bucks for a registered copy. > > I suspected the .exes would be big. :-) Did they run any slower > than the original script? > Well, they launched a lot slower, once started the actual run-time appeared approx equal. I found it had a few problems deciding what to bundle into the .exe especially when you used several add-on modules. A simple script using TK and the old Win32 module resulted in a ~5Meg .exe, -- John Soward Lead Systems Programmer, Technical Services, University of Kentucky p: 606.257.2900x298 e:soward@uky.edu w: http://neworder.cc.uky.edu/ From janine.ladick at fetterprinting.com Tue Jan 11 13:24:34 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp In-Reply-To: <387B8DCA.35703AA3@uky.edu> Message-ID: <200001112024.PAA17050@sidewinder.fetterprinting.com> > I found it had a few problems deciding what to > bundle into the .exe especially when you used several add-on modules. ActiveState tells you to put requires inside begin blocks to signal PerlApp that the required files belong in the .exe, like: BEGIN { require 'special.pl'; } Seems ridiculous to me, given the meaning of the word 'require' in both English and Perl semantics. Janine From soward at uky.edu Tue Jan 11 14:30:48 2000 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp References: <200001112024.PAA17050@sidewinder.fetterprinting.com> Message-ID: <387B92F8.E2B00F08@uky.edu> Janine Ladick wrote: > > > I found it had a few problems deciding what to > > bundle into the .exe especially when you used several add-on modules. > > ActiveState tells you to put requires inside begin blocks to signal > PerlApp that the required files belong in the .exe, like: > > BEGIN { require 'special.pl'; } > > Seems ridiculous to me, given the meaning of the word 'require' in > both English and Perl semantics. > Exactly the problem, because it didn't handle things like 'require TK.pl' if inside TK.pl there were further statements like 'require TKmenu.pl', but this was a version from perhap April or May of 1999 so perphaps they have perfected it since then. -- John Soward Lead Systems Programmer, Technical Services, University of Kentucky p: 606.257.2900x298 e:soward@uky.edu w: http://neworder.cc.uky.edu/ From janine.ladick at fetterprinting.com Tue Jan 11 13:35:31 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp In-Reply-To: <387B92F8.E2B00F08@uky.edu> Message-ID: <200001112034.PAA17725@sidewinder.fetterprinting.com> > Exactly the problem, because it didn't handle things like 'require > TK.pl' if inside TK.pl there were further statements like 'require > TKmenu.pl', but this was a version from perhap April or May of 1999 so > perphaps they have perfected it since then. I read in the PerlApp documentation that the Tk issue had been resolved. It mentioned Tk explicitly, though, so other nested requires would probably still have to be in begin blocks. From hempy at ket.org Tue Jan 11 14:33:42 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp In-Reply-To: <200001111938.OAA15652@sidewinder.fetterprinting.com> Message-ID: <4.1.20000111153112.03b21f00@mail.ket.org> There is also PerlEx. Same idea. PerlApp might even be the latest version of PerlEx for all I know. Seems like it was a few hundred bucks to register it. Never used it. The idea is a good one. I would not be real excited about signing up to maintain perl on user's machines when I could just send them a bloated executable instead. -dave At 02:39 PM 1/11/2000 -0400, you wrote: >Hello, List! > >Have any of you used ActiveState's PerlApp? From the web site, I >gather that PerlApp creates executables from Perl scripts so that >you can run 'em on machines without Perl. This interests me; I'm >working on a few utility scripts that use Tk to provide what I hope is >a nice user interface, and I'd prefer to distribute .exe files to my >users (um, all two of them) rather than commit myself to installing >and maintaining Perl on their PCs. > >Does anyone care to share a success (or failure) story or know of >ways other than PerlApp to create standalone Perl applications? > >Thanks, >Janine -- David Hempy Internet Database Administrator Kentucky Educational Television From janine.ladick at fetterprinting.com Tue Jan 11 13:45:32 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: ActiveState's PerlApp In-Reply-To: <4.1.20000111153112.03b21f00@mail.ket.org> References: <200001111938.OAA15652@sidewinder.fetterprinting.com> Message-ID: <200001112044.PAA18698@sidewinder.fetterprinting.com> > There is also PerlEx. Same idea. PerlApp might even be the latest version > of PerlEx for all I know. Seems like it was a few hundred bucks to > register it. Never used it. PerlEx is another offering from ActiveState, isn't it? I thought it just worked on NT web servers to speed up CGI processing (like mod_perl on Apache). Does it also build .exes? From janine.ladick at fetterprinting.com Tue Jan 11 15:15:36 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: DynamicSTATE's Perl2Exe In-Reply-To: <4.1.20000111153112.03b21f00@mail.ket.org> References: <200001111938.OAA15652@sidewinder.fetterprinting.com> Message-ID: <200001112214.RAA23885@sidewinder.fetterprinting.com> Hey...has anyone tried DynamicSTATE's Perl2Exe? I wonder if it works any better than PerlApp. Janine From gcasillo at ket.org Tue Jan 11 16:32:50 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: DynamicSTATE's Perl2Exe References: <200001111938.OAA15652@sidewinder.fetterprinting.com> <200001112214.RAA23885@sidewinder.fetterprinting.com> Message-ID: <387BAF92.154C08B2@ket.org> Now that you mention it, I have tried using Perl2Exe. It's been over a year since my last confession with Perl2Exe, but if memory serves me, it also produces sizeable executables (in the megabytes depending on what modules you use). However, performance was excellent. I was parsing large CSV files and producing umpteen HTML pages from the data. I don't remember using any modules, notably the DBD::CSV module. Gregg Janine Ladick wrote: > Hey...has anyone tried DynamicSTATE's Perl2Exe? I wonder if it > works any better than PerlApp. > > Janine From sungo at brocksplace.com Tue Jan 11 18:55:35 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: DynamicSTATE's Perl2Exe In-Reply-To: <387BAF92.154C08B2@ket.org> Message-ID: i've tried out perl2exe under windows. yes, bloated execs, but they do have a shareware version you can use. the downside is that every time you run an exec created with the shareware warning, it spews an ad for the full version out before actually doing anything useful. but overall, it seemed about as efficient as anything else for windows. --------------------- Matt Cashner sungo@earthling.net --------------------- "Humiliation: the harder you try, the dumber you look." From hempy at ket.org Tue Jan 11 19:02:51 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: DynamicSTATE's Perl2Exe In-Reply-To: References: <387BAF92.154C08B2@ket.org> Message-ID: <4.1.20000111200051.039f7c50@mail.ket.org> At 07:55 PM 1/11/2000 -0500, you wrote: >i've tried out perl2exe under windows. yes, bloated execs, but they do >have a shareware version you can use. the downside is that every time you >run an exec created with the shareware warning, it spews an ad for the >full version out before actually doing anything useful. but overall, it >seemed about as efficient as anything else for windows. > >--------------------- >Matt Cashner > sungo@earthling.net >--------------------- > >"Humiliation: the harder you try, the dumber you look." Don't quote me on this, but I think the unregistered PerlEx quietly paused a few seconds when executing your program...the idea is that would be useless for CGI or similar. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From hempy at ket.org Tue Jan 11 19:20:44 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Scope of $_ In-Reply-To: <4.1.20000111200051.039f7c50@mail.ket.org> References: <387BAF92.154C08B2@ket.org> Message-ID: <4.1.20000111200535.00a00ef0@mail.ket.org> Okay, I'm either confused or disappointed about the scope of $_ ... tell me which. In my program, scout.pl, I have @rtf_files which has a bunch of file names. I use $_ to loop through them something like this: > foreach (@rtf_files) { > > print "$_\n"; > <...snip some stuff that works on the filename in $_...> > > > my $start_val = $_; > > print "\$\_ has changed at AAA! \n" unless $_ eq $start_val; > $body = rtf2html::rtf2html ($rtf); > print "\$\_ has changed at BBB! \n" unless $_ eq $start_val; > > $rtf_url = $_; rtf2html() uses $_ internally to do some stuff. After it returns, $_ in scout.pl has the last value of rtf2html::$_ . The message "$_ has changed at BBB!" gets printed out. I'm really confused by this. I had assumed that $_ is scoped like my variables. It certainly doesn't appear that way to me now. In this example, the subroutine is in a different module with its own package, which is particularly disappointing. Heck, I expected subroutines within the same .pl file to have their own $_ ! All of a sudden I'm a bit nervous about using $_ through an entire subroutine, assuming that no deeper subroutines can/will affect it. Of course I can copy $_ to my variables, but that takes some of the magic away from things like: s/\n/

/g; So you tell me...am I confused or disappointed? I looked in Learning Perl and Programming Perl, but didn't find the answer. Is there something I can do to protect $_ ? I tried my ($_) but perl didn't like that. -dave ps. FYI, here is the start of the module I'm calling, rtf2html.pm: > >package rtf2html; > >use strict; >use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); > >require Exporter; > >@ISA = qw(Exporter AutoLoader); >@EXPORT = qw(); > >$VERSION = '0.4'; > >sub rtf2html { > $_ = shift; > my ($outfile) = @_; > my ($title, $hex, $tofile); > > s/\n//g; # Word wraps lines mid-word...glue it all into one line. > <...snip: Lots of other things that modify $_ and eventually return it...> -- David Hempy Internet Database Administrator Kentucky Educational Television From rbowen at rcbowen.com Tue Jan 11 19:42:42 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: DynamicSTATE's Perl2Exe References: <387BAF92.154C08B2@ket.org> <4.1.20000111200051.039f7c50@mail.ket.org> Message-ID: <387BDC12.A5207A00@rcbowen.com> The good news is that Perl 5.6 will have compiler support in it, so this won't be an issue any more. Of course, if you can't wait that long ... Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From aaron at iglou.com Tue Jan 11 21:05:07 2000 From: aaron at iglou.com (AARON B. DOSSETT) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Scope of $_ In-Reply-To: <4.1.20000111200535.00a00ef0@mail.ket.org> from "David Hempy" at Jan 11, 2000 08:20:44 PM Message-ID: > > So you tell me...am I confused or disappointed? I looked in Learning Perl > and Programming Perl, but didn't find the answer. Is there something I can > do to protect $_ ? I tried my ($_) but perl didn't like that. > You're disappointed, and rightly so. There's only one $_ and a change made to it anywhere is reflected everywhere else. The solution is to rely on $_ only in limited circumstances, i.e.: while () { next unless /foo/; ... } or to protect $_ when calling unknown subroutines, i.e.: {local $_ = undef; unknown_sub(); } This will restore the value of $_ once you exit the code-block. See item 3 of : http://www.perl.com/pub/1999/11/sins.html for more details. Hope that helps, Aaron From rbowen at rcbowen.com Tue Jan 11 21:14:03 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Scope of $_ References: Message-ID: <387BF17B.1AF720EA@rcbowen.com> "AARON B. DOSSETT" wrote: > > > > > So you tell me...am I confused or disappointed? I looked in Learning Perl > > and Programming Perl, but didn't find the answer. Is there something I can > > do to protect $_ ? I tried my ($_) but perl didn't like that. > > > > You're disappointed, and rightly so. There's only one $_ and a change made > to it anywhere is reflected everywhere else. But $main::_ is not the same variable as $rtf2html::_ is it? I know that using $_ all over the place can break things, but I figure that when you were in another name space, as in calling a function in another module, that you'd be (reasonably) safe. No? Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From fprice at mis.net Tue Jan 11 21:22:38 2000 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Scope of $_ In-Reply-To: <4.1.20000111200535.00a00ef0@mail.ket.org> Message-ID: On Tue, 11 Jan 2000, David Hempy wrote: # Okay, I'm either confused or disappointed about the scope of $_ ... tell me # which. [snip] # rtf2html() uses $_ internally to do some stuff. After it returns, $_ in # scout.pl has the last value of rtf2html::$_ . The message "$_ has changed # at BBB!" gets printed out. # # I'm really confused by this. I had assumed that $_ is scoped like my # variables. It certainly doesn't appear that way to me now. In this # example, the subroutine is in a different module with its own package, # which is particularly disappointing. Heck, I expected subroutines within # the same .pl file to have their own $_ ! Not sure about your own internal states, but I think you've illustrated a good point: don't depend upon $_ !!. On perl.com there was an article called the Seven Sins of Perl Revisited which mentioned this very thing. Far from $_ being lexically scoped, it and the other magical vars like $/, etc. are the only true globals in Perl since they are the same across namespaces. # All of a sudden I'm a bit nervous about using $_ through an entire # subroutine, assuming that no deeper subroutines can/will affect it. Of # course I can copy $_ to my variables, but that takes some of the magic away # from things like: # # s/\n/

/g; I usually explicitly name the loop var: foreach my $value (@values) # So you tell me...am I confused or disappointed? I looked in Learning Perl # and Programming Perl, but didn't find the answer. Is there something I can # do to protect $_ ? I tried my ($_) but perl didn't like that. Right, my $_ won't work. I think that in your module you could do local $_ to create your private copy though. -Frank. From fprice at mis.net Tue Jan 11 21:25:08 2000 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Scope of $_ In-Reply-To: <387BF17B.1AF720EA@rcbowen.com> Message-ID: On Tue, 11 Jan 2000, Rich Bowen wrote: #"AARON B. DOSSETT" wrote: #> #> You're disappointed, and rightly so. There's only one $_ and a change made #> to it anywhere is reflected everywhere else. # #But $main::_ is not the same variable as $rtf2html::_ is it? I know that #using $_ all over the place can break things, but I figure that when you #were in another name space, as in calling a function in another module, #that you'd be (reasonably) safe. No? Man, y'all are quick! For the magic Perl vars (the one which don't start with a letter :-) it doesn't matter what namespace you're in: they really are true globals. -Frank. ____ ____ Frank Price fprice@mis.net Linux: the choice of a GNU generation -|- Why not go mad? From bkuhn at ebb.org Tue Jan 11 22:15:07 2000 From: bkuhn at ebb.org (Bradley M. Kuhn) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Richard M. Stallman speaks in Cincinnati on 24 January 2000 at 7:00 PM Message-ID: <20000111231507.B563@ebb.org> This event may be of interest to Perl Mongers who live close to Cincinnati. I am involved with Cincinnati.pm and the Cincinnati GNU/Linux Users Group, so I am officially an intersect of those Venn diagrams, and thus am compelled to spread the word. :) The announcement follows: "The GNU/Linux System and the Free Software Movement" A Talk by Richard M. Stallman Monday 24 January 2000 7:00 PM Engineering Research Center (ERC) Building Auditorium (Room 427) The University of Cincinnati Cincinnati, OH, USA 45219 This event is open to the public. Sponsored by: The Cincinnati GNU/Linux Users Group and The University of Cincinnati You can find more information at the GNU events page: http://www.gnu.org/events.html or at the Cincinnati GNU/Linux Users Group page: http://www.cglug.org From hempy at ket.org Tue Jan 11 22:51:39 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Scope of $_ In-Reply-To: References: <4.1.20000111200535.00a00ef0@mail.ket.org> Message-ID: <4.1.20000111233813.03a71b00@mail.ket.org> At 10:05 PM 1/11/2000 -0500, you wrote: >> >> So you tell me...am I confused or disappointed? > >You're disappointed, and rightly so. Thanks for the reference. I read the Sins page with great interest. Now that I understand the problem, I'm going to apply a bit of both suggestions. I have changed my module from: >sub rtf2html { > $_ = shift; > my ($outfile) = @_; ...to: >sub rtf2html { > local $_ = shift; > my ($outfile) = @_; This has fixed the problem of the caller's $_ being stomped. Or more accurately, it restores the value of the only $_ after the sub block ends. I started to localize $_ around call to rtf2thml, but realized this really belongs in the module itself to be socially acceptable. I still plan on using $_ for tight little loops 'cause it's so darned nifty. But I will go ahead and use my variables any time I have to scroll to find end of the loop! ;-) Thanks for the help, all! -dave --------------------------------------------------------------------------- David Hempy -- USUA Region 6 Representative (KY-IN-MI-OH) ASC Trike BFI #BKY56 -- FAA Aviation Safety Counselor -- EAA #456510 -- www.davidhempy.com -- (c)2000,DBH Views expressed are not those of ASC, FAA or USUA unless explicitly stated. --------------------------------------------------------------------------- From janine.ladick at fetterprinting.com Wed Jan 12 07:05:03 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: DynamicSTATE's Perl2Exe In-Reply-To: <387BAF92.154C08B2@ket.org> Message-ID: <200001121404.JAA07293@sidewinder.fetterprinting.com> > Now that you mention it, I have tried using Perl2Exe. It's been over a > year since my last confession with Perl2Exe, but if memory serves me, it > also produces sizeable executables (in the megabytes depending on what > modules you use). However, performance was excellent. I was parsing > large CSV files and producing umpteen HTML pages from the data. I don't > remember using any modules, notably the DBD::CSV module. Did you use the Lite version or the...uh...Heavy (Pro) version? Pro supports an option for creating small executables and I wonder just how small they are in comparison to what Perl2Exe would otherwise produce. Janine From hempy at ket.org Thu Jan 13 13:57:59 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Many Monkeys: Question about quotes In-Reply-To: <200001121404.JAA07293@sidewinder.fetterprinting.com> References: <387BAF92.154C08B2@ket.org> Message-ID: <4.1.20000113144241.00c12460@mail.ket.org> I've got quotes coming out of my ears! I am constructing a SQL statement as such: $cmd = qq {update release set headline="$headline" where id="$id" }; This works fine and dandy, quoting the headline and id as such: update release set headline="The American Experience on KET looks at the life of Harry Houdini" where id="2000/02/AmExp.Houdini" Only problem is, I got a headline of: Mike Holloway ? "The South paw from Arkansas" - on next Jubilee on KET Thus, the word [The] appears as a bare word in my SQL statement, generating a SQL error. I expect there will be headlines with both double quotes and single quotes. Since this field is primarily destined to be html code, I wimped out by changing $headline first: $headline =~ s/\"/"/g; ## Escape quotes within the title. I'll need to un-do this later if I have any non-html outlets, but that's not a problem for this project. I would still like to find an answer to this for the future. I tried \ escaping the quotes in the headline, but the backslashes made it into the database, which is not what I want. I'm thinking this is more of a SQL question than a perl question at this point. Don't sweat it, but if anyone has any insight, I'd be happy to learn. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From fireston at lexmark.com Thu Jan 13 14:10:42 2000 From: fireston at lexmark.com (Mik Firestone) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Many Monkeys: Question about quotes In-Reply-To: <4.1.20000113144241.00c12460@mail.ket.org> Message-ID: <200001132010.PAA03651@interlock2.lexmark.com> If I have understood the issue correctly, you should be able to use the: $dbh->quote($string) to "correctly" backslash the string. Correctly here is defined as correct with respect to your database - different databases need different characters protected and this function is supposed to handle that. Mik PS - Erik Ackerman says Hi! On Thu, 13 Jan 2000, David Hempy wrote: > > I've got quotes coming out of my ears! I am constructing a SQL statement > as such: > > $cmd = qq {update release set headline="$headline" where id="$id" }; > > This works fine and dandy, quoting the headline and id as such: > > update release set headline="The American Experience on KET looks at the > life of Harry Houdini" where id="2000/02/AmExp.Houdini" > > Only problem is, I got a headline of: > > Mike Holloway — "The South paw from Arkansas" - on next Jubilee on KET > > Thus, the word [The] appears as a bare word in my SQL statement, generating > a SQL error. I expect there will be headlines with both double quotes and > single quotes. > > Since this field is primarily destined to be html code, I wimped out by > changing $headline first: > > $headline =~ s/\"/"/g; ## Escape quotes within the title. > > I'll need to un-do this later if I have any non-html outlets, but that's > not a problem for this project. I would still like to find an answer to > this for the future. I tried \ escaping the quotes in the headline, but > the backslashes made it into the database, which is not what I want. I'm > thinking this is more of a SQL question than a perl question at this point. > > Don't sweat it, but if anyone has any insight, I'd be happy to learn. > > -dave > > > > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television > > -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: My troops will receive special training so that they may shoot the tires of a moving vehicle. From oneiros at dcr.net Thu Jan 13 14:30:37 2000 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Many Monkeys: Question about quotes In-Reply-To: <200001132010.PAA03651@interlock2.lexmark.com> Message-ID: On Thu, 13 Jan 2000, Mik Firestone wrote: > If I have understood the issue correctly, you should be able to use the: > $dbh->quote($string) > to "correctly" backslash the string. Correctly here is defined as correct > with respect to your database - different databases need different characters > protected and this function is supposed to handle that. >From my vague recollection of the August meeting, when this was mentioned, (please, correct me if I'm wrong), this also places the corresponding quotes around the string, not just escaping the approprate strings, so you'd want to do something along the lines of : my $headline = $dbh->quote('The American Experience on KET looks at the life of Harry Houdini'); my $id = $dbh->quote('2000/02/AmExp.Houdini'); my $string = "update release set headline=$headline where id=$id;"; [I'm guessing that the original problem was that the database in question was expecting '' as the string qualifier, but the above should be more portable] > > $cmd = qq {update release set headline="$headline" where id="$id" }; > > > > This works fine and dandy, quoting the headline and id as such: > > > > update release set headline="The American Experience on KET looks at the > > life of Harry Houdini" where id="2000/02/AmExp.Houdini" > > > > Only problem is, I got a headline of: > > > > Mike Holloway — "The South paw from Arkansas" - on next Jubilee on KET ----- Joe Hourcle From hempy at ket.org Thu Jan 13 14:29:53 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Many Monkeys: Question about quotes In-Reply-To: <200001132010.PAA03651@interlock2.lexmark.com> References: <4.1.20000113144241.00c12460@mail.ket.org> Message-ID: <4.1.20000113151335.03abae40@mail.ket.org> At 03:10 PM 1/13/2000 -0500, you wrote: >If I have understood the issue correctly, you should be able to use the: > $dbh->quote($string) >to "correctly" backslash the string. Correctly here is defined as correct >with respect to your database - different databases need different characters >protected and this function is supposed to handle that. If I were using DBI, that is! ;-) Early in this project, I switched to Win32::ODBC as I couldn't get DBD::ODBC to work with my Visual Fox Pro database. I hope I don't regret it later on... :-( Anyway, about 7 seconds after I resolved the headline issue with " , I ran into the same problem with my html_body field. Here, I need real quotes to be real qoutes. That is, can't become For anyone else who runs into this, here is my solution. I think it is a clean one. Of course, if I were using DBI it would be a non-issue and even cleaner thanks to the quote function, but that's another story. (I suppose I *could* use DBI to build the quoted string before schlepping it over to Win32:ODBC, but that would be a little kinky) >From _Microsoft SQL Server Database Developer's Companion_ p. 64, >Character strings...must be enclosed in single quotation marks (')... >Although double quotations marks are allowed, single quotation marks are >preferred for compliance with ANSI standards. Okay... switch to single quotes. That's half the battle. Same page continues: >To specify other single quotation marks (or apostrophes) within a character >entity, use two consecutive single quotation marks, as shown: > > 'I don''t understand' > So, my code that was: $headline =~ s/\"/"/g; ## Escape quotes within the title. $cmd = qq {update release set headline="$headline" where id="$id" }; ...has become: $headline =~ s/'/''/g; ## Escape quotes within the title. $cmd = qq {update release set headline='$headline' where id='$id'}; I suppose I don't need qq{} at this point, but what the heck...can't hurt. BTW, I had a real hard time finding documentation on qq. Both the camel book and Learning Perl do not mention it, and online docs are spartan. In fact, I don't even recall what code I swiped originally that used qq...I sure didn't come up with it! > >Mik > >PS - Erik Ackerman says Hi! What is Erik up to? Ask him to drop me a line, okay? -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From hempy at ket.org Thu Jan 13 14:36:50 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Started LCC's perl course yesterday... In-Reply-To: <4.1.20000113144241.00c12460@mail.ket.org> References: <200001121404.JAA07293@sidewinder.fetterprinting.com> <387BAF92.154C08B2@ket.org> Message-ID: <4.1.20000113153028.03a34e20@mail.ket.org> Wayne Beech is the instructor, and will do an excellent job, I'm sure. This is a 150-level programming course, so I don't expect to be too stimulated by it. The first three days on the syllabus are devoted to discussing variables...oh, buy. The final topics on the syllabus are associative arrays and making modules, if I recall correctly. It would have been really cool to take the course before I actually needed to learn perl, but that's life. I am going to take the course, as I'm sure there will be some little things I'll pick up that I didn't learn in my self-taught approach. I would really like to see a Perl 2 course. Wayne said that is a common sentiment. I will be posting Perl Monger announcements at the class. The poster we've had for some of the meetings will fill the bill perfectly. Did you do those, Rich? I would expect several to show up. Most are perl newbies...some are programming newbies. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From tbarnett at fairway.stdio.com Thu Jan 13 17:53:09 2000 From: tbarnett at fairway.stdio.com (Tyler Barnett) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Started LCC's perl course yesterday... In-Reply-To: <4.1.20000113153028.03a34e20@mail.ket.org> Message-ID: Gee, I took classes from Wayne Beech many years ago. He is a super nice guy. Tell him hello for me :-) Tyler Barnett On Thu, 13 Jan 2000, David Hempy wrote: > > Wayne Beech is the instructor, and will do an excellent job, I'm sure. > This is a 150-level programming course, so I don't expect to be too > stimulated by it. The first three days on the syllabus are devoted to > discussing variables...oh, buy. The final topics on the syllabus are > associative arrays and making modules, if I recall correctly. > > It would have been really cool to take the course before I actually needed > to learn perl, but that's life. I am going to take the course, as I'm sure > there will be some little things I'll pick up that I didn't learn in my > self-taught approach. > > I would really like to see a Perl 2 course. Wayne said that is a common > sentiment. > > I will be posting Perl Monger announcements at the class. The poster we've > had for some of the meetings will fill the bill perfectly. Did you do > those, Rich? I would expect several to show up. Most are perl > newbies...some are programming newbies. > > -dave > > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television > From hempy at ket.org Thu Jan 13 17:51:20 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Off-topic: SQL question In-Reply-To: <4.1.20000113151335.03abae40@mail.ket.org> References: <200001132010.PAA03651@interlock2.lexmark.com> <4.1.20000113144241.00c12460@mail.ket.org> Message-ID: <4.1.20000113182726.03a51ed0@mail.ket.org> Okay, this has nothing to do with perl, but you guys are just so darned helpful... In my Visual FoxPro (VFP) table, I've got a field of type memo. A memo field is an unlimited length character field. I regularly store several kilobytes of data in each field from VFP. I have been unable to store more than 255 bytes from perl, via Win32::ODBC. I'm quite certain the problem is from VFP's ODBC driver, not in perl nor the ODBC module. This is the error I get: [219] [1] "[Microsoft][ODBC Visual FoxPro Driver]Command contains unrecognized phrase/keyword." at d:/edit-www/cgi-ket/scout.pl line 587. For the command: $cmd = qq {update release set rtf_bytes=$rtf_bytes, headline= '$headline', html_body='$html_body' where releaseid='$releaseid' }; This happens when $html_body has 256 characters, but not if it has 255 or less. Also of note, it gives the same error if there are any \n in the string, even for short strings. I've tried escaping them in different ways, but can ignore that problem in this case by (gasp) removing all \n in the string. I've tackled a two ten-pound SQL books looking for a way to specify the max length of a field, info on varchar fields, or documentation of a max string length, but I haven't found anything yet. If anyone has a quick answer, I'm all ears. Time to go work on something else for a while... -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From repett0 at sac.uky.edu Thu Jan 13 19:20:07 2000 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: UKLUG demo/meeting Message-ID: Next tuesday is going to be our first organized crime,..*cough* meeting. If you would like to attend.. Time: 7pm Location: Student Center(student organizations offices, in the corner with the old computer by WRFL radio station). Purpose of the meeting is to learn how to partition and install. However we will also be installing zipslack so people who are afraid or don't understand partitioning can install linux in about 3 minutes on a windows machine. This is the first in an evolving lecture series. Every week will be adding something new to this machine. Including perl,php,mysql...etc..etc..etc.. Hope to see you there. Ron Petty UKLUG treasurer ps. Forward this to all your families :) From hempy at ket.org Thu Jan 13 20:01:00 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: UKLUG demo/meeting In-Reply-To: Message-ID: <4.1.20000113205939.00bccf00@mail.ket.org> Sounds like fun. By "Next Tuesday", are you referring to January 18, 2000? Hate to show up a week late... 8-| -dave At 08:20 PM 1/13/2000 -0500, you wrote: > >Next tuesday is going to be our first organized crime,..*cough* meeting. >If you would like to attend.. > >Time: 7pm >Location: Student Center(student organizations offices, in the corner >with the old computer by WRFL radio station). -- David Hempy Internet Database Administrator Kentucky Educational Television From repett0 at sac.uky.edu Thu Jan 13 22:59:20 2000 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: UKLUG demo/meeting In-Reply-To: <4.1.20000113205939.00bccf00@mail.ket.org> Message-ID: Yes this coming tuesdayyyyy Ron On Thu, 13 Jan 2000, David Hempy wrote: > Sounds like fun. By "Next Tuesday", are you referring to January 18, 2000? > Hate to show up a week late... 8-| > > -dave > > > At 08:20 PM 1/13/2000 -0500, you wrote: > > > >Next tuesday is going to be our first organized crime,..*cough* meeting. > >If you would like to attend.. > > > >Time: 7pm > >Location: Student Center(student organizations offices, in the corner > >with the old computer by WRFL radio station). > > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television > From soward at uky.edu Fri Jan 14 12:17:53 2000 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Off-topic: SQL question References: <200001132010.PAA03651@interlock2.lexmark.com> <4.1.20000113144241.00c12460@mail.ket.org> <4.1.20000113182726.03a51ed0@mail.ket.org> Message-ID: <387F6851.10DDC17@uky.edu> David Hempy wrote: > > Okay, this has nothing to do with perl, but you guys are just so darned > helpful... > > In my Visual FoxPro (VFP) table, I've got a field of type memo. A memo > field is an unlimited length character field. I regularly store several > kilobytes of data in each field from VFP. > > I have been unable to store more than 255 bytes from perl, via Win32::ODBC. > I'm quite certain the problem is from VFP's ODBC driver, not in perl nor > the ODBC module. This is the error I get: > > [219] [1] "[Microsoft][ODBC Visual FoxPro Driver]Command contains > unrecognized phrase/keyword." at d:/edit-www/cgi-ket/scout.pl line 587. > > For the command: > > $cmd = qq {update release set rtf_bytes=$rtf_bytes, headline= > '$headline', html_body='$html_body' where releaseid='$releaseid' }; > > This happens when $html_body has 256 characters, but not if it has 255 or > less. Also of note, it gives the same error if there are any \n in the > string, even for short strings. I've tried escaping them in different > ways, but can ignore that problem in this case by (gasp) removing all \n in > the string. > > I've tackled a two ten-pound SQL books looking for a way to specify the max > length of a field, info on varchar fields, or documentation of a max string > length, but I haven't found anything yet. If anyone has a quick answer, > I'm all ears. > AFAIK, char fields are limited to 255, with, say, MySQL I would specify the field type as 'text' instead. But I don't know anything about FoxPro or it's ODBC driver... -- John Soward Lead Systems Programmer, Technical Services, University of Kentucky p: 606.257.2900x298 e:soward@uky.edu w: http://neworder.cc.uky.edu/ From rbowen at rcbowen.com Fri Jan 14 13:15:12 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: Off-topic: SQL question References: <200001132010.PAA03651@interlock2.lexmark.com> <4.1.20000113144241.00c12460@mail.ket.org> <4.1.20000113182726.03a51ed0@mail.ket.org> Message-ID: <387F75C0.F47382AB@rcbowen.com> David Hempy wrote: > > Okay, this has nothing to do with perl, but you guys are just so darned > helpful... > > In my Visual FoxPro (VFP) table, I've got a field of type memo. A memo > field is an unlimited length character field. I regularly store several > kilobytes of data in each field from VFP. > > I have been unable to store more than 255 bytes from perl, via Win32::ODBC. > I'm quite certain the problem is from VFP's ODBC driver, not in perl nor > the ODBC module. This is the error I get: > > [219] [1] "[Microsoft][ODBC Visual FoxPro Driver]Command contains > unrecognized phrase/keyword." at d:/edit-www/cgi-ket/scout.pl line 587. > > For the command: > > $cmd = qq {update release set rtf_bytes=$rtf_bytes, headline= > '$headline', html_body='$html_body' where releaseid='$releaseid' }; > > This happens when $html_body has 256 characters, but not if it has 255 or > less. Also of note, it gives the same error if there are any \n in the > string, even for short strings. I've tried escaping them in different > ways, but can ignore that problem in this case by (gasp) removing all \n in > the string. > > I've tackled a two ten-pound SQL books looking for a way to specify the max > length of a field, info on varchar fields, or documentation of a max string > length, but I haven't found anything yet. If anyone has a quick answer, > I'm all ears. If you're using DBI, you can do $dbh->{'LongReadLen'} = 6000; or similar, which sets the max on field length higher than it is by default. I remember seeing this problem when I first switched from Win32::ODBC to DBI, and the above made it go away. But I don't recall ever seeing this with Win32::ODBC. But I do recall, from a discussion on clpm that ensued when I asked this very question, that it had something to do with ODBC itself, and was not specific to Perl, DBI, Win32::ODBC, or the specific database. Perhaps there is some similar function on Win32::ODBC? I don't remember. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From gcasillo at ket.org Fri Jan 14 15:05:16 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:37 2004 Subject: LPM: CPAN Module Message-ID: <387F8F8C.E04138D3@ket.org> I thought this might be appropriate considering how we've discussed modules recently. For those familiar with Win32's Perl package manager (ppm), you may find this module worthwhile if you use Perl on a *nix box. It automates the module installation much like ppm does. Here's the top of the readme: NAME CPAN - query, download and build perl modules from CPAN sites SYNOPSIS Interactive mode: perl -MCPAN -e shell; Batch mode: use CPAN; autobundle, clean, install, make, recompile, test DESCRIPTION The CPAN module is designed to automate the make and install of perl modules and extensions. It includes some searching capabilities and knows how to use Net::FTP or LWP (or lynx or an external ftp client) to fetch the raw data from the net. Read more about it at http://www.perl.com/CPAN-local/modules/by-module/CPAN/ Gregg Casillo From rbowen at rcbowen.com Fri Jan 14 15:28:51 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: CPAN Module References: <387F8F8C.E04138D3@ket.org> Message-ID: <387F9513.2260E4F8@rcbowen.com> Gregg Casillo wrote: > > I thought this might be appropriate considering how we've discussed > modules recently. For those familiar with Win32's Perl package manager > (ppm), you may find this module worthwhile if you use Perl on a *nix > box. It automates the module installation much like ppm does. Here's the > top of the readme: > > NAME > CPAN - query, download and build perl modules from CPAN sites ... I just recently wrote the following: http://www.rcbowen.com/imho/perl/modules.html which talks about installing modules on Unix and NT, and covers CPAN.pm for those that have never used it. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From hempy at ket.org Wed Jan 19 01:20:32 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: File reading performance Message-ID: <4.1.20000119012919.00d52b10@mail.ket.org> I got impatient with the time required to read in a big (7 Mb) file into a scalar variable, so I did a little benchmarking on my code. (I'm exposing myself before my peers, so be gentle...) My code started out as: while () { $whole .= $_; } When I started this project, I was reading 7 Kb files, and didn't have a care in the world. (I'm sure the Perl wizards out there can see where this is going.) Obviously, that's a lot of string manipulation. I klutzed around with join and came up with the following. (Okay...I just admitted it...I've never used join before. There...it's out.) @content = ; $whole = join ("", @content); I figured it would probably be faster, with less string manipulations, but maybe not because of the array manipulations. Before I benchmarked the two, I assumed the file access would be the same for either, and that would dwarf any memory-based processing...thus making it irrelevant which approach I used. Wrong! The concatenation method took around 90 seconds over several trials. The join method clocked in at 5-6 seconds a pop. That's a *huge* difference! I am guessing that a 20-fold performance boost could only come from file access issues. I suspect the @content = actually reads the whole file in one read (or perhaps a few reads with a large buffer), where while() is issuing a separate read to the OS for each of the 40489 lines of the file. I'm also assuming file caching is not coming into play, as I repeated several trials in different orders with consistent results. Is there a "conventional" method to slurp an entire file into a string? It sure would be nice to get another 20-fold performance increase! (greedy, I know...) I also realize I'm doubling the amount of memory needed to hold my file in memory. I guess I could make @content a my variable within a small block. This would release it as soon as the block ended, right? ...later on... I actually need to get this file read in as a single line, with \n's removed. I compared: chomp @content; $whole = join ("", @content); with: $whole = join ("", @content); $whole =~ s/\n//g; With a resolution of one second, I could not determine if either is faster than the other. Given that either takes less than a second to handle 40489 lines, I guess it doesn't matter too much. I chose the chomp method in the end, just because it seems more hygienic. Any pros care to comment on any of my methods or assumptions? -dave ps. FWIW, below is my home-brew benchmarking code...nothing to brag about, I know. I tried running the two loops in the same program, but the latter of the two benefited from caching, so I had to split them up into two different programs. $fn = shift; $whole = ""; $start= time(); open FILE, $fn or die "Can't open $fn."; while () { $whole .= $_; } close FILE; print "length of file is ", length($whole), " bytes.\n"; print "Took " . (time - $start) . " seconds to read file appending to string. \n"; $fn = shift; $start= time(); open FILE, $fn or die "Can't open $fn."; @content = ; close FILE; $whole = join ("", @content); print scalar @content . " Lines\n";; print "length of file is ", length($whole), " bytes.\n"; print "Took " . (time - $start) . " seconds to read file into array and join. \n"; -- David Hempy Internet Database Administrator Kentucky Educational Television From hempy at ket.org Wed Jan 19 02:06:54 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: File reading performance In-Reply-To: <4.1.20000119012919.00d52b10@mail.ket.org> Message-ID: <4.1.20000119030401.00de5240@mail.ket.org> At 02:20 AM 1/19/2000 -0500, I wrote: > >I got impatient with the time required to read in a big (7 Mb) file into a >scalar variable, so I did a little benchmarking on my code. (I'm exposing >myself before my peers, so be gentle...) ... >When I started this project, I was reading 7 Kb files, and didn't have a >care in the world. (I'm sure the Perl wizards out there can see where this >is going.) ... I guess that wasn't very clear...at first, my input files were 7 Kb, and all was cool. It was when I started getting 7 Mb files that I became interested in reading more efficiently. All the numbers (90 seconds and 5 seconds) are on the 7 Mb files. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From fireston at lexmark.com Wed Jan 19 07:39:20 2000 From: fireston at lexmark.com (Mik Firestone) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: File reading performance In-Reply-To: <4.1.20000119012919.00d52b10@mail.ket.org> Message-ID: <200001191339.IAA18302@interlock2.lexmark.com> Yes, the speed improvement is primarily due to using the file I/O buffers better. However, we can squeeze a little more out of this, if you want. > @content = ; > $whole = join ("", @content); The first thing we can try is to reduce the number of memory copies you are making. Not only willl this speed up the code, but it will also reduce the memory foot print. The array @content seems to serve no further purpose in this code, so lets get rid of it. I would first try using the snippet: $whole = join( "", ); Since is being used in list context, perl will read in the entire file and we have avoided the @content. According to my benchmarking reading a 6 Mb file (230184 lines), the first method took 21 seconds for 10 interations and the second took 18 seconds for the same 10 iterations. Just for grins, I tried my favourite method which would be to undefine the input record separator. The code looks something like this: local $/ = undef; $whole = ; $/ is a perl magic variable ( which is why I protect it with a local ) that tells perl how to split records when reading a file. This defaults to \n, so the statement $line = will do what you expect. By undefining it, I tell perl there are no separators, so perl will read the entire file into a single scalar variable. My benchmarking ( code is attached at bottom for those interested ) indicated this was at least 3 times faster than the other two methods. Perl still has to be concerned with chopping the file correctly when using the @array = syntax. My last method relieves perl of that burden and we get the speed advantages. I am not sure this helps, but it is early morning and I haven't had any caffiene yet. Check the examples and I will clarify anything I haven't explained well. Mik use Benchmark; # # 17 - 18 seconds for 10 interations sub ByArray { my (@arr, $str); open TMP, "/tmp/foobar" or die "couldn't open test file\n"; @arr = ; $str = join("",@arr); $str =~ s/\n//g; } # 21 - 22 seconds for 10 interations sub ByAnonArray { my (@arr, $str); open TMP, "/tmp/foobar" or die "couldn't open test file\n"; $str = join("",); $str =~ s/\n//g; } # 6 - 7 seconds for 10 interations sub ByInputRecSep { my $str; local $/ = undef; open TMP, "/tmp/foobar" or die "couldn't open test file\n"; $str = ; $str =~ s/\n//g; } timethese( 10, { 'ByArray' => \&ByArray, 'ByAnonArray' => \&ByAnonArray, 'ByInputRec' => \&ByInputRecSep } ); -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: I will not include a self-destruct mechanism unless absolutely necessary. If it is necessary, it will not be a large red button labelled "Danger: Do Not Push". From llang at baywestpaper.com Wed Jan 19 07:38:50 2000 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: File reading performance Message-ID: Avoid the joining step altogether. Slurp it. undef $/; $whole=; (Explained in much more detail in the perlvar man page...) Loren Lang Phone: 606-734-0538 x326 Network Administrator Fax: 606-734-8210 Bay West Paper Corporation email: llang@baywestpaper.com "There is no greater burden than great potential." - Charles Schultz I got impatient with the time required to read in a big (7 Mb) file into a scalar variable, so I did a little benchmarking on my code. (I'm exposing myself before my peers, so be gentle...) My code started out as: while () { $whole .= $_; } When I started this project, I was reading 7 Kb files, and didn't have a care in the world. (I'm sure the Perl wizards out there can see where this is going.) Obviously, that's a lot of string manipulation. I klutzed around with join and came up with the following. (Okay...I just admitted it...I've never used join before. There...it's out.) @content = ; $whole = join ("", @content); I figured it would probably be faster, with less string manipulations, but maybe not because of the array manipulations. Before I benchmarked the two, I assumed the file access would be the same for either, and that would dwarf any memory-based processing...thus making it irrelevant which approach I used. Wrong! The concatenation method took around 90 seconds over several trials. The join method clocked in at 5-6 seconds a pop. That's a *huge* difference! I am guessing that a 20-fold performance boost could only come from file access issues. I suspect the @content = actually reads the whole file in one read (or perhaps a few reads with a large buffer), where while() is issuing a separate read to the OS for each of the 40489 lines of the file. I'm also assuming file caching is not coming into play, as I repeated several trials in different orders with consistent results. Is there a "conventional" method to slurp an entire file into a string? It sure would be nice to get another 20-fold performance increase! (greedy, I know...) I also realize I'm doubling the amount of memory needed to hold my file in memory. I guess I could make @content a my variable within a small block. This would release it as soon as the block ended, right? ...later on... I actually need to get this file read in as a single line, with \n's removed. I compared: chomp @content; $whole = join ("", @content); with: $whole = join ("", @content); $whole =~ s/\n//g; With a resolution of one second, I could not determine if either is faster than the other. Given that either takes less than a second to handle 40489 lines, I guess it doesn't matter too much. I chose the chomp method in the end, just because it seems more hygienic. Any pros care to comment on any of my methods or assumptions? -dave ps. FWIW, below is my home-brew benchmarking code...nothing to brag about, I know. I tried running the two loops in the same program, but the latter of the two benefited from caching, so I had to split them up into two different programs. $fn = shift; $whole = ""; $start= time(); open FILE, $fn or die "Can't open $fn."; while () { $whole .= $_; } close FILE; print "length of file is ", length($whole), " bytes.\n"; print "Took " . (time - $start) . " seconds to read file appending to string. \n"; $fn = shift; $start= time(); open FILE, $fn or die "Can't open $fn."; @content = ; close FILE; $whole = join ("", @content); print scalar @content . " Lines\n";; print "length of file is ", length($whole), " bytes.\n"; print "Took " . (time - $start) . " seconds to read file into array and join. \n"; -- David Hempy Internet Database Administrator Kentucky Educational Television From llang at baywestpaper.com Wed Jan 19 08:38:57 2000 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: File reading performance Message-ID: Well - not having worked much (read: at all) with benchmarking, I cut/pasted/messed with this code and kicked it off. Works great with a file of 4Mb, but a 6Mb file gives an "Out Of Memory!" error on the slurp (the other two work fine with that size). Can somebody shed some light on what the memory limitations are. I'm running ActiveState build 521 with 128 Meg Ram. Is it a DOS limitation? Loren Lang Phone: 606-734-0538 x326 Network Administrator Fax: 606-734-8210 Bay West Paper Corporation email: llang@baywestpaper.com "There is no greater burden than great potential." - Charles Schultz Mik Firestone m> cc: Sent by: Subject: Re: LPM: File reading performance owner-lexington-pm-l ist@pm.org 01/19/00 08:39 AM Please respond to lexington-pm-list Yes, the speed improvement is primarily due to using the file I/O buffers better. However, we can squeeze a little more out of this, if you want. > @content = ; > $whole = join ("", @content); The first thing we can try is to reduce the number of memory copies you are making. Not only willl this speed up the code, but it will also reduce the memory foot print. The array @content seems to serve no further purpose in this code, so lets get rid of it. I would first try using the snippet: $whole = join( "", ); Since is being used in list context, perl will read in the entire file and we have avoided the @content. According to my benchmarking reading a 6 Mb file (230184 lines), the first method took 21 seconds for 10 interations and the second took 18 seconds for the same 10 iterations. Just for grins, I tried my favourite method which would be to undefine the input record separator. The code looks something like this: local $/ = undef; $whole = ; $/ is a perl magic variable ( which is why I protect it with a local ) that tells perl how to split records when reading a file. This defaults to \n, so the statement $line = will do what you expect. By undefining it, I tell perl there are no separators, so perl will read the entire file into a single scalar variable. My benchmarking ( code is attached at bottom for those interested ) indicated this was at least 3 times faster than the other two methods. Perl still has to be concerned with chopping the file correctly when using the @array = syntax. My last method relieves perl of that burden and we get the speed advantages. I am not sure this helps, but it is early morning and I haven't had any caffiene yet. Check the examples and I will clarify anything I haven't explained well. Mik use Benchmark; # # 17 - 18 seconds for 10 interations sub ByArray { my (@arr, $str); open TMP, "/tmp/foobar" or die "couldn't open test file\n"; @arr = ; $str = join("",@arr); $str =~ s/\n//g; } # 21 - 22 seconds for 10 interations sub ByAnonArray { my (@arr, $str); open TMP, "/tmp/foobar" or die "couldn't open test file\n"; $str = join("",); $str =~ s/\n//g; } # 6 - 7 seconds for 10 interations sub ByInputRecSep { my $str; local $/ = undef; open TMP, "/tmp/foobar" or die "couldn't open test file\n"; $str = ; $str =~ s/\n//g; } timethese( 10, { 'ByArray' => \&ByArray, 'ByAnonArray' => \&ByAnonArray, 'ByInputRec' => \&ByInputRecSep } ); -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: I will not include a self-destruct mechanism unless absolutely necessary. If it is necessary, it will not be a large red button labelled "Danger: Do Not Push". From rbowen at rcbowen.com Wed Jan 19 08:58:52 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: File reading performance References: Message-ID: <3885D12C.CE178DDF@rcbowen.com> llang@baywestpaper.com wrote: > > Well - not having worked much (read: at all) with benchmarking, I > cut/pasted/messed with this code and kicked it off. Works great with a > file of 4Mb, but a 6Mb file gives an "Out Of Memory!" error on the slurp > (the other two work fine with that size). > > Can somebody shed some light on what the memory limitations are. I'm > running ActiveState build 521 with 128 Meg Ram. Is it a DOS limitation? Might be. Perl itself will let you slurp in a file up to the size of physical memory. Other languages (not that I know any other languages, but I've heard) have a hard limit on the size of file that you can slurp in. Perhaps somehow DOS gets in the way of what Perl is trying to do. Or perhaps stuff in a DOS shell runs in a protected memory space. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From sungo at brocksplace.com Fri Jan 21 14:58:20 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: passing array refs Message-ID: is there any way to pass an array ref transparently? ie foo(@array,$var); but by prototyping or something :) @array is actually passed in as a ref? thanks all :) --------------------- Matt Cashner sungo@earthling.net --------------------- "When people are free to do as they please, they usually imitate each other." From rbowen at rcbowen.com Fri Jan 21 15:04:07 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting Message-ID: <3888C9C7.1C4D033E@rcbowen.com> Someone pointed out to me last night that January is 2/3 over. Sheesh. Anyways, we need to start thinking about the February meeting. Any of you folks want to volunteer to talk about something? Someone expressed an interest in me expanding on my general dislike for CGI.pm, and the methods that I use as an alternative. Is that something that more than one person cared about? I'd be willing to talk about that, but don't want to bore all the folks that don't care about CGI. The techniques can be used elsewhere, but the examples would all be CGI stuff. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From ken.rietz at asbury.edu Fri Jan 21 16:23:04 2000 From: ken.rietz at asbury.edu (ken.rietz@asbury.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: passing array refs Message-ID: > is there any way to pass an array ref transparently? ie > > foo(@array,$var); > > but by prototyping or something :) @array is actually passed > in as a ref? > The mechanism you are using is not passing references. Trying to do something like @array = (1, 2, 3); $var = 4; foo(@array, $var); presumably calls a subroutine like sub foo { my @subarray = shift @_; my $subvar = shift @_; ..... } which won't work, since Perl flattens out the parameters of the function call into a single parameter array. @subarray in this call would end up as (1), the first element of @array, and $subvar would end up as 2, the second element. References are the way to go. It prevents having to copy the entire input array, so efficiency improves as well. Here's an example of the syntax: my @array = (1, 2, 3); my $var = 4; foo(\@array, \$var); # Using refs. Note the two extra \ sub foo { my $subarrayref = shift @_; my $subvarref = shift @_; my @subarray = @{$subarrayref}; # Braces optional my $subvar = ${$subvarref}; # Ditto print @subarray; # Prints 123 print $subvar; # Prints 4 } Note that references, even to arrays and hashes, are scalars, requiring the $ prefix notation. You convert from a reference by putting the appropriate prefix symbol in front, as in @subarray = @{$subarrayref}; -- Ken From rbowen at rcbowen.com Fri Jan 21 19:41:41 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: passing array refs References: Message-ID: <38890AD5.A028CAA@rcbowen.com> Matt Cashner wrote: > > is there any way to pass an array ref transparently? ie > > foo(@array,$var); > > but by prototyping or something :) @array is actually passed in as a ref? There's a good article on prototypes at http://www.perl.com/pub/language/misc/fmproto.html I don't use them much myself, having never been a C programmer, so I can't say much about how they work. Except that, if you are a C programmer, they don't work the way that you expect them to. It does seem that they do what you want them to do. Sort of. See http://www.perl.com/pub/language/misc/fmproto.html#Reference_Prototypes If you give your subroutine a prototpe of \@$, for example, and pass in an array and a scalar, it magically converts the array to an array ref on the way to the function. This is not exactly what you asked for, but sort of half way. The problem, of course, is that if you have a prototype of @$, how would perl know when the array was to stop and the scalar to start? So you end up with all your arguments in the array, and nothing in the scalary. Worse yet, imagine @$@, and try to figure out what goes in the scalar if I pass (1,2,3,4,5,6,7). Anyways, prototypes are sort of handy, but I've never actually used them myself, because I don't see that they simplify anything for me. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From sungo at brocksplace.com Fri Jan 21 23:58:18 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: passing array refs In-Reply-To: <38890AD5.A028CAA@rcbowen.com> Message-ID: On Fri, 21 Jan 2000, Rich Bowen wrote: > The problem, of course, is that if you have a prototype of @$, how would > perl know when the array was to stop and the scalar to start? So you end > up with all your arguments in the array, and nothing in the scalary. > Worse yet, imagine @$@, and try to figure out what goes in the scalar if > I pass (1,2,3,4,5,6,7). the way i'm reading Programming Perl (which might be wrong :) is that the prototype @$ actually expects an array ref as the first argument. so if you prototype sub foo (@$) { BLOCK } you invoke it by foo(\@array,$var); and sub foo (\@$) { BLOCK } would be invoked by foo(@array,$var); with the magical transformation of @array to a ref. now, if i can get that to actually work is another thing :) --------------------- Matt Cashner sungo@earthling.net --------------------- "If we dont take care of the customer, maybe they'll stop bugging us." From mandrews at bit0.com Sat Jan 22 00:23:04 2000 From: mandrews at bit0.com (Mike Andrews) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting In-Reply-To: <3888C9C7.1C4D033E@rcbowen.com> Message-ID: I think I'm one of the people that accidently brought up your dislike of CGI.pm in the first place. At the time I was looking for an alternative to cgi-lib.pl, which sucks badly in a number of ways. All I really wanted was an easy way to suck all the form variables into a hash... and CGI.pm was really overkill for just that. What I ended up finding was something called CGI_Lite.... use CGI_Lite; my $cgi = new CGI_Lite; my %formvars = $cgi->parse_form_data; and that pretty much does everything I need. The rest I do by hand by just printing raw HTML (and the Content-Type header). I don't even know what else CGI_Lite is capable of aside from that, but I could dig that up in time for the meeting I'm sure. :) Mike Andrews (MA12) * mandrews@dcr.net * http://www.bit0.com/ VP, sysadmin, & network guy, Digital Crescent Inc, Frankfort KY Internet services for Frankfort, Lawrenceburg, Owenton, Shelbyville "Don't sweat the petty things, and don't pet the sweaty things." On Fri, 21 Jan 2000, Rich Bowen wrote: > Someone pointed out to me last night that January is 2/3 over. Sheesh. > Anyways, we need to start thinking about the February meeting. Any of > you folks want to volunteer to talk about something? > > Someone expressed an interest in me expanding on my general dislike for > CGI.pm, and the methods that I use as an alternative. Is that something > that more than one person cared about? I'd be willing to talk about > that, but don't want to bore all the folks that don't care about CGI. > The techniques can be used elsewhere, but the examples would all be CGI > stuff. > > Rich > -- > http://www.ApacheUnleashed.com/ > Lexington Perl Mongers - http://lexington.pm.org/ > PGP Key - http://www.rcbowen.com/pgp.txt > From rbowen at rcbowen.com Sat Jan 22 08:55:01 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: Message-ID: <3889C4C5.F3D578F4@rcbowen.com> Mike Andrews wrote: > > I think I'm one of the people that accidently brought up your dislike of > CGI.pm in the first place. At the time I was looking for an alternative > to cgi-lib.pl, which sucks badly in a number of ways. All I really wanted > was an easy way to suck all the form variables into a hash... and CGI.pm > was really overkill for just that. > > What I ended up finding was something called CGI_Lite.... > > use CGI_Lite; > my $cgi = new CGI_Lite; > my %formvars = $cgi->parse_form_data; Yes, I use CGI_Lite as well. > and that pretty much does everything I need. The rest I do by hand by > just printing raw HTML (and the Content-Type header). I print all my HTML using Text::Template, since one of my main complaints with CGI.pm is that the 'customer' can't modify the output without getting into your Perl code. > I don't even know what else CGI_Lite is capable of aside from that, but I > could dig that up in time for the meeting I'm sure. :) It does other cool stuff like file upload and cookies, but that's about all. Hence the 'Lite' Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From janine.ladick at fetterprinting.com Mon Jan 24 08:13:13 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting In-Reply-To: References: <3888C9C7.1C4D033E@rcbowen.com> Message-ID: <200001241412.JAA24267@sidewinder.fetterprinting.com> > All I really wanted > was an easy way to suck all the form variables into a hash... and CGI.pm > was really overkill for just that. Have you tried parse_form.pl from The CGI/Perl Cookbook? All it does is parse form data into a hash - and if you're looking for a lean solution, it won't get much leaner than that. Janine ------- Janine Ladick Manager, Data Processing Fetter Printing Company 502-634-4771 x. 310 From gcasillo at ket.org Mon Jan 24 12:23:11 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: <3889C4C5.F3D578F4@rcbowen.com> Message-ID: <388C988E.8E17F9EC@ket.org> I sneaked (snuck?) a peek at the Text::Template over the weekend. Way cool. Very way cool. If I had known of this module's capabilities a few months back... I always frown upon bloating my Perl scripts with HTML code. I can't wait to happen on some free time to go back and modify my old scripts, mostly CGI stuff, to use Text::Template. Gregg From hempy at ket.org Mon Jan 24 12:21:18 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting In-Reply-To: <3888C9C7.1C4D033E@rcbowen.com> Message-ID: <4.1.20000124132010.03a54690@mail.ket.org> At 04:04 PM 1/21/2000 -0500, you wrote: >Someone pointed out to me last night that January is 2/3 over. Sheesh. >Anyways, we need to start thinking about the February meeting. Any of >you folks want to volunteer to talk about something? > >Someone expressed an interest in me expanding on my general dislike for >CGI.pm, and the methods that I use as an alternative. Is that something >that more than one person cared about? I'd be willing to talk about >that, but don't want to bore all the folks that don't care about CGI. >The techniques can be used elsewhere, but the examples would all be CGI >stuff. > >Rich I'm always game for CGI talk. I've started using CGI.pm since you spoke on it last time, so I'll be a little better grounded this time around. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From dpitts at mk.net Mon Jan 24 12:36:29 2000 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: <3889C4C5.F3D578F4@rcbowen.com> <388C988E.8E17F9EC@ket.org> Message-ID: <006701bf6699$ee49b2e0$7801a8c0@adverb.com> Gregg, Can you discuss some of this at the next meeting? I haven't had a chance to look at it yet. Thanks, David ----- Original Message ----- From: Gregg Casillo To: Sent: Monday, January 24, 2000 1:23 PM Subject: Re: LPM: Feb meeting > I sneaked (snuck?) a peek at the Text::Template over the weekend. Way > cool. Very way cool. If I had known of this module's capabilities a few > months back... I always frown upon bloating my Perl scripts with HTML > code. I can't wait to happen on some free time to go back and modify my > old scripts, mostly CGI stuff, to use Text::Template. > > Gregg > > > From pstackhouse at ket.org Mon Jan 24 13:21:55 2000 From: pstackhouse at ket.org (Paul Stackhouse) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: <3889C4C5.F3D578F4@rcbowen.com> <388C988E.8E17F9EC@ket.org> Message-ID: <388CA653.1653BA22@ket.org> I've been lurking in this list for several months, and finally have an administrivia morsel to contribute. Several of us here at KET are taking the Perl course offered at LCC. Today, as the instructor, Wayne ????, displayed a list of perl resources, http://lexington.pm.org was displayed. He asked if there were any Perlmongers in the class, I spoke up to say that the meetings were held at KET, but I didn't know the topic, and wasn't sure of the date. I referred everyone back to the website. Unfortunately, I just checked the page and it has still the data from January's meeting. If there is a flyer for the February meeting, I'll print and paste a few up over there. -paul -- Paul M. Stackhouse, Jr. Webmaster / Technology Manager Kentucky Educational Television Voice: 606.258.7135 600 Cooper Drive Fax: 606.258.7435 Lexington, KY 40502 Net: http://www.dl.ket.org From rbowen at rcbowen.com Mon Jan 24 15:03:15 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: <3889C4C5.F3D578F4@rcbowen.com> <388C988E.8E17F9EC@ket.org> <388CA653.1653BA22@ket.org> Message-ID: <388CBE13.ADC3F09A@rcbowen.com> Well, I was just about to update the web site, and realized that the Feb meeting is scheduled for the 14th. Those of us with Significant Others of one description to another know that this is a problem, and that we will need to reschedule it. Quick poll - is the 7th or the 21st preferable? Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From rbowen at rcbowen.com Mon Jan 24 15:09:34 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: <3889C4C5.F3D578F4@rcbowen.com> <388C988E.8E17F9EC@ket.org> <006701bf6699$ee49b2e0$7801a8c0@adverb.com> Message-ID: <388CBF8E.D9E22A2C@rcbowen.com> David Pitts wrote: > > Gregg, > Can you discuss some of this at the next meeting? I haven't had a chance to > look at it yet. This was what I was sort of volunteering to talk about. (Text::Template). Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From ken.rietz at asbury.edu Mon Jan 24 15:13:00 2000 From: ken.rietz at asbury.edu (ken.rietz@asbury.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting Message-ID: Rich -- The 21st is marginally preferable for me. Is there a problem with scheduling KET on either date? -- Ken > Well, I was just about to update the web site, and realized > that the Feb > meeting is scheduled for the 14th. Those of us with Significant Others > of one description to another know that this is a problem, and that we > will need to reschedule it. Quick poll - is the 7th or the 21st > preferable? > From llang at baywestpaper.com Mon Jan 24 15:21:36 2000 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting Message-ID: My for-what-it's-worth vote is for the 21st as I will be out of town on the 7th (and I actually want to try to make it to another meeting before my 75th birthday.) :-} Loren Lang Phone: 606-734-0538 x326 Network Administrator Fax: 606-734-8210 Bay West Paper Corporation email: llang@baywestpaper.com "There is no greater burden than great potential." - Charles Schultz Well, I was just about to update the web site, and realized that the Feb meeting is scheduled for the 14th. Those of us with Significant Others of one description to another know that this is a problem, and that we will need to reschedule it. Quick poll - is the 7th or the 21st preferable? Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From grdodson at lexmark.com Mon Jan 24 15:28:49 2000 From: grdodson at lexmark.com (Graydon Dodson) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Perl Celebrity Message-ID: <200001242128.QAA22922@interlock2.lexmark.com> While you are discussing moving the Feb. meeting you may want to take into account that Nat Torkington will be back in town teaching a perl class at Lexmark the week of the 28th. Knowing Nat he would be interested in, attending a meeting, sharing dinner and a brew, or both with Perl Mongers. Graydon Dodson From hempy at ket.org Mon Jan 24 15:46:10 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting In-Reply-To: <388CBE13.ADC3F09A@rcbowen.com> References: <3889C4C5.F3D578F4@rcbowen.com> <388C988E.8E17F9EC@ket.org> <388CA653.1653BA22@ket.org> Message-ID: <4.1.20000124164210.039c3730@mail.ket.org> At 04:03 PM 1/24/2000 -0500, you wrote: >Well, I was just about to update the web site, and realized that the Feb >meeting is scheduled for the 14th. Those of us with Significant Others >of one description to another know that this is a problem, and that we >will need to reschedule it. Quick poll - is the 7th or the 21st >preferable? Doesn't matter to me...my sweetie was looking forward to coming to the meeting on Valentine's Day anyway. Rescheduling the room at KET should be no problem at all, for any evening. Lacking a compelling reason to the contrary, I would second matching Nat's visit to Lexington and Loren's availability on the later date. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From gcasillo at ket.org Mon Jan 24 15:55:57 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting References: <3889C4C5.F3D578F4@rcbowen.com> <388C988E.8E17F9EC@ket.org> <006701bf6699$ee49b2e0$7801a8c0@adverb.com> <388CBF8E.D9E22A2C@rcbowen.com> Message-ID: <388CCA6D.ADEDA502@ket.org> By all means, Rich should speak about Text::Template. I'm still a neophyte to its ways, whereas Rich is a veteran. Gregg Rich Bowen wrote: > David Pitts wrote: > > > > Gregg, > > Can you discuss some of this at the next meeting? I haven't had a chance to > > look at it yet. > > This was what I was sort of volunteering to talk about. > (Text::Template). > > Rich > -- > http://www.ApacheUnleashed.com/ > Lexington Perl Mongers - http://lexington.pm.org/ > PGP Key - http://www.rcbowen.com/pgp.txt From gcasillo at ket.org Mon Jan 24 15:57:53 2000 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Perl Celebrity References: <200001242128.QAA22922@interlock2.lexmark.com> Message-ID: <388CCAE1.2323C4C6@ket.org> 21st or 28th would be my preference. Gregg Casillo Graydon Dodson wrote: > While you are discussing moving the Feb. meeting you may want to take into > account that Nat Torkington will be back in town teaching a perl class at > Lexmark the week of the 28th. Knowing Nat he would be interested in, > attending a meeting, sharing dinner and a brew, or both with Perl Mongers. > > Graydon Dodson From rbowen at rcbowen.com Mon Jan 24 16:06:51 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: February Message-ID: <388CCCFB.D6B39819@rcbowen.com> OK, we'll tentatively say that the meeting will be on the 21st, and put that up on the web site. If anyone objects to this, we can move it later. Perhaps we can arrange to have dinner with Nat while he's here, like we did before. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From janine.ladick at fetterprinting.com Mon Jan 24 16:47:36 2000 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Feb meeting In-Reply-To: <4.1.20000124164210.039c3730@mail.ket.org> References: <388CBE13.ADC3F09A@rcbowen.com> Message-ID: <200001242246.RAA18523@sidewinder.fetterprinting.com> > Doesn't matter to me...my sweetie was looking forward to coming to the > meeting on Valentine's Day anyway. :-P - Janine From hempy at ket.org Tue Jan 25 14:13:41 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Module question Message-ID: <4.1.20000124153506.039b8d80@mail.ket.org> I've got three or four .pl programs for our Press Room application that have some subroutines duplicated in each. I'd like to pull them out into a single module. These routines are not the kind of global routines that will be accessed by other programs installed on the system...they only relate to this handful of programs related for the Press Room. As such, I don't really want to save the .pm file over in perl/site/lib, far from the only code that actually uses it. I tried saving it alongside the .pl programs in my cgi-bin directory use-ing it from there. Works from the command line, but I get a server error via CGI. I suspect this is some kind of PATH problem. Any insight? Can I specify a relative path to a module? -dave ps. As an aside...when I get a Server Error, I expect I've got a syntax error (and hence no Content-type), so I just run `perl -c myprog.pl` from the command line and fix the problem. Today was the first time I've gotten a Server Error in the browser, but none from the command line. I can run the whole program w/o errors at the console. Is this a PATH issue? Any idea how I can actually see the error? -- David Hempy Internet Database Administrator Kentucky Educational Television From sungo at brocksplace.com Tue Jan 25 14:23:22 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Module question In-Reply-To: <4.1.20000124153506.039b8d80@mail.ket.org> Message-ID: On Tue, 25 Jan 2000, David Hempy wrote: > As such, I don't really want to save the .pm file over in perl/site/lib, > far from the only code that actually uses it. I tried saving it alongside > the .pl programs in my cgi-bin directory use-ing it from there. Works from > the command line, but I get a server error via CGI. I suspect this is some > kind of PATH problem. you can do a use lib './'; > > ps. As an aside...when I get a Server Error, I expect I've got a syntax > error (and hence no Content-type), so I just run `perl -c myprog.pl` from > the command line and fix the problem. Today was the first time I've gotten > a Server Error in the browser, but none from the command line. I can run > the whole program w/o errors at the console. Is this a PATH issue? Any > idea how I can actually see the error? print the content before even getting into the script via BEGIN { print "Content-type:text/html\n\n"; } then have your script print the error. also, your server's error logs should contain the error as well, at least they do with apache. not sure about ms products... --------------------- Matt Cashner sungo@earthling.net --------------------- "When people are free to do as they please, they usually imitate each other." From oneiros at dcr.net Tue Jan 25 15:01:23 2000 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Module question In-Reply-To: <4.1.20000124153506.039b8d80@mail.ket.org> Message-ID: On Tue, 25 Jan 2000, David Hempy wrote: > ps. As an aside...when I get a Server Error, I expect I've got a syntax > error (and hence no Content-type), so I just run `perl -c myprog.pl` from > the command line and fix the problem. Today was the first time I've gotten > a Server Error in the browser, but none from the command line. I can run > the whole program w/o errors at the console. Is this a PATH issue? Any > idea how I can actually see the error? For seeing errors, the program cgiwrap comes in handy, as it has a 'debug' mode which lets you see just what it's outputting. (it's actually a security program, as it runs the scripts with the permissions of the user, and checks to make sure that no scripts are group/world writable, etc.) you can find it at : http://www.unixtools.org/cgiwrap/ ----- Joe Hourcle From hempy at ket.org Tue Jan 25 16:44:28 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Module question In-Reply-To: References: <4.1.20000124153506.039b8d80@mail.ket.org> Message-ID: <4.1.20000125173904.03ca52f0@mail.ket.org> At 03:23 PM 1/25/2000 -0500, you wrote: > >you can do a >use lib './'; Thanks for the tip, Matt. This still had problems when run as CGI, but told me know what I was looking for. My final solution comes from the Cookbook, Chapter 12.7. Keeping Your Own Module Directory: >...suppose you have a program called /wherever/spectre/myprog that needs to >look in >/wherever/spectre for its modules, but you don't want to hardcode that path. > >use FindBin; >use lib $FindBin::Bin; Thus, my code to include pressroom.pm in the same directory ends up looking like: use FindBin; use lib $FindBin::Bin; use pressroom; #page footers and other common subs. My thanks go out to the group's collective knowledge again! -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From rbowen at rcbowen.com Tue Jan 25 20:57:38 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Module question References: <4.1.20000124153506.039b8d80@mail.ket.org> <4.1.20000125173904.03ca52f0@mail.ket.org> Message-ID: <388E62A2.A36CE940@rcbowen.com> David Hempy wrote: > > At 03:23 PM 1/25/2000 -0500, you wrote: > > > >you can do a > >use lib './'; > > Thanks for the tip, Matt. This still had problems when run as CGI, but > told me know what I was looking for. > > My final solution comes from the Cookbook, Chapter 12.7. Keeping Your Own > Module Directory: > > >...suppose you have a program called /wherever/spectre/myprog that needs to > >look in > >/wherever/spectre for its modules, but you don't want to hardcode that path. > > > >use FindBin; > >use lib $FindBin::Bin; > > Thus, my code to include pressroom.pm in the same directory ends up looking > like: > > use FindBin; > use lib $FindBin::Bin; > use pressroom; #page footers and other common subs. Or, if you want to do it the really ugly way: BEGIN{($_=$0)=~s![\\/][^\\/]+$!!;push@INC,$_} Isn't that fun! That is, take the path of the currently executing program, and then remove a slash, followed by some stuff that's not a slash, off the end of it. And push that onto @INC. I suppose you really want to unshift it onto @INC, but it does not matter a whole lot. See http://www.rcbowen.com/imho/perl_cwd_iis.html which came out of a thread on the hwg-servers mailing list. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From booberry at io.com Wed Jan 26 10:09:01 2000 From: booberry at io.com (0x29A [B.Vandgrift]) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Regexps for email. Message-ID: I'm working on a script which goes through a link library I have and throws down mad links. I'm having a problem with my email nonsense. ideally, I'd like this bit of the program to take something like: -- here is an email address:booberry@io.com -- and turn it into: -- here is an email address:booberry@io.com -- I am using the following rexexp: $inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/$1<\/a>/g; The problem is, it continues matching on the line. Hence, I get three nested requests. Cool, but not useful. How can I tell the regexp engine not to attempt a match on the text that it just inserted? Suggestions, comments, etc? They'd all be greatly appreciated. Thanks -- Ben Vandgrift http://www.io.com/~booberry ________________________________________________________________________ "I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has inteded for us to forego their use." --Galileo From hempy at ket.org Wed Jan 26 10:52:56 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Regexps for email. In-Reply-To: Message-ID: <4.1.20000126114956.039d1570@mail.ket.org> At 10:09 AM 1/26/2000 -0600, Ben Vandgrift wrote: >I am using the following rexexp: >$inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/$1<\/a>/g; > >The problem is, it continues matching on the line. Hence, I get three >nested requests. Cool, but not useful. How can I tell the regexp engine >not to attempt a match on the text that it just inserted? I'm not a regex guru by any means, but I don't think that it reprocesses the substituted text with the /g modifier. When I run this: >$inline = "Mail me at hempy\@ket.org. Thanks!"; >print "Before: $inline\n"; >$inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/$1<\/a>/g; >print "After: $inline\n"; I get this: >Before: Mail me at hempy@ket.org. Thanks! >After: Mail me at hempy@ket.org. Thanks! Any chance you are processing the string twice? It might be fruitful to print the string before and after your regex. Or you could even use the debugger, but that's for sissies and smart people, of which I am neither. ;-) -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From sungo at brocksplace.com Wed Jan 26 13:23:20 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: dbms Message-ID: i'm working on a project that involves perl meshing with a database (flatfile, four/five fields). we're using postgresql right now as that was what was here when we started. i'm trying to escape the grasp of postgres because this project really doesnt call for it. the problem is this: i've tried dbm and mldbm but they are very machine specific. two machines with the same versions of perl and the necessary modules could not read each others dbms. any thoughts on alternative solid perl db/dbm systems? --------------------- Matt Cashner sungo@earthling.net --------------------- "Hard work often pays off after time, but laziness always pays off now." From ken.rietz at asbury.edu Wed Jan 26 13:32:21 2000 From: ken.rietz at asbury.edu (ken.rietz@asbury.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: dbms Message-ID: > i'm working on a project that involves perl meshing with a database > (flatfile, four/five fields). we're using postgresql right > now as that was > what was here when we started. i'm trying to escape the grasp > of postgres > because this project really doesnt call for it. the problem > is this: i've > tried dbm and mldbm but they are very machine specific. two > machines with > the same versions of perl and the necessary modules could not > read each > others dbms. any thoughts on alternative solid perl db/dbm systems? 1. I can understand wanting to get out of postgresql, but what do you mean by "this project really doesn't call for it"? Do you want less than a flatfile, four/five fields database? How about just writing a file with hashes and reading back from it? 2. If you want more machine and database independence, look carefully at the DBI module, with appropriately-used DBD's to handle the dependent parts. (I thought you were already doing that, so this puzzles me.) You should be able to read out of one database and write straight to another. My suggestion (I'm sure seconded by Rich) would be MySQL for just about any DB work you need. -- Ken From sungo at brocksplace.com Wed Jan 26 13:41:30 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: dbms In-Reply-To: Message-ID: On Wed, 26 Jan 2000 ken.rietz@asbury.edu wrote: > 1. I can understand wanting to get out of postgresql, but what do > you mean by "this project really doesn't call for it"? Do you want > less than a flatfile, four/five fields database? How about just writing > a file with hashes and reading back from it? > 2. If you want more machine and database independence, look carefully > at the DBI module, with appropriately-used DBD's to handle the dependent > parts. (I thought you were already doing that, so this puzzles me.) You > should be able to read out of one database and write straight to another. > My suggestion (I'm sure seconded by Rich) would be MySQL for just about > any DB work you need. we're trying to see if we can get out of using a non-perl database but mainatain machine independence. we are currently using DBI to interface with pgsql which is nifty and fine. yes, if i had my way about it, we'd be using mysql. but our database programmer thinks otherwise. (she may be leaving us shortly.) anyway... is there some strange reason DBMs are so machine dependent? can this be overcome? --------------------- Matt Cashner sungo@earthling.net --------------------- "It's always darkest just before it goes pitch black." From rbowen at rcbowen.com Wed Jan 26 13:42:12 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: dbms References: Message-ID: <388F4E14.8F8BE9A2@rcbowen.com> > 1. I can understand wanting to get out of postgresql, but what do > you mean by "this project really doesn't call for it"? Do you want > less than a flatfile, four/five fields database? How about just writing > a file with hashes and reading back from it? > > 2. If you want more machine and database independence, look carefully > at the DBI module, with appropriately-used DBD's to handle the dependent > parts. (I thought you were already doing that, so this puzzles me.) You > should be able to read out of one database and write straight to another. > My suggestion (I'm sure seconded by Rich) would be MySQL for just about > any DB work you need. Using DBI and DBD::CSV is also a cool way to go, as it gives you all the benefits of DBI (Ok, not all of them, but a lot of them) as well as all the advantages of using a flat file. Might be a really good thing to look into. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From ken.rietz at asbury.edu Wed Jan 26 13:42:24 2000 From: ken.rietz at asbury.edu (ken.rietz@asbury.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: Regexps for email. Message-ID: > I'm working on a script which goes through a link library I have and > throws down mad links. I'm having a problem with my email nonsense. > > ideally, I'd like this bit of the program to take something like: > -- > here is an email address:booberry@io.com > -- > and turn it into: > -- > here is an email address: href="mailto:booberry@io.com">booberry@io.com > -- > > I am using the following rexexp: > $inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/ href=\"mailto:$1\">$1<\/a>/g; > > The problem is, it continues matching on the line. Hence, I get three > nested requests. Cool, but not useful. How can I tell the > regexp engine > not to attempt a match on the text that it just inserted? > I'm with Dave -- not a regex expert and confused about why you are having a problem. The regex you give works for me. Well, almost. My e-mail is ken.rietz@asbury.edu, which fails to find the full username. I'd recommend changing the substitution to $inline =~ s/\b([\w.]+\@\w+(\.\w+)*\.\w+)\b/$1<\/a>/g; (added three characters), so that addresses like mine could be formatted correctly. -- Ken Rietz From rbowen at rcbowen.com Wed Jan 26 13:51:55 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: dbms References: Message-ID: <388F505B.52622D1E@rcbowen.com> ... > we're trying to see if we can get out of using a non-perl database but > mainatain machine independence. we are currently using DBI to interface > with pgsql which is nifty and fine. yes, if i had my way about it, we'd be > using mysql. but our database programmer thinks otherwise. (she may be > leaving us shortly.) anyway... is there some strange reason DBMs are so > machine dependent? can this be overcome? DBMs are machine dependent because the DBM libraries appear to be implemented about 12 different ways, and build differently depending on your machine architecture. I'm not aware of any way that this can be overcome, but then, I gave up in frustration on DBMs early on in my experimentation, because I could not find a good way to have them run on Win32. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From booberry at io.com Wed Jan 26 14:05:17 2000 From: booberry at io.com (0x29A [B.Vandgrift]) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: RE: Regexps for email (and digression) In-Reply-To: Message-ID: On Wed, 26 Jan 2000 ken.rietz@asbury.edu wrote: =>I'm with Dave -- not a regex expert and confused about why you are =>having a problem. The regex you give works for me. Well, almost. =>My e-mail is ken.rietz@asbury.edu, which fails to find the full =>username. I'd recommend changing the substitution to => =>$inline =~ s/\b([\w.]+\@\w+(\.\w+)*\.\w+)\b/href=\"mailto:$1\">$1<\/a>/g; Actually, I ended up using [\w.-_]. I couldn't think of any other symbols I've seen on a regular basis. The problem was when the regexp was being called (once for every key pair I was looping over, in fact), and was fixed readily once my brain kicked in, and I got some lunch. For reference, I used this line: $inline =~ s{\b([.-_\w]+\@\w+(\.\w+)*?\.\w+)} {$1}igox; It actually works quite well. Thanks to all who responded. -- Ben Vandgrift http://www.io.com/~booberry ________________________________________________________________________ "I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has inteded for us to forego their use." --Galileo From mandrews at bit0.com Wed Jan 26 18:29:18 2000 From: mandrews at bit0.com (Mike Andrews) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Regexps for email. In-Reply-To: Message-ID: Not that this really answers the question, but I'm a little wary of using mailto: URL's *anywhere* anymore. The instant you put an email address on a web page as-is is the same instant you get added to a pile of spammer's lists. Most of them use web-crawling bots to harvest addresses. We've got an amusing Apache mod_rewrite + Perl script combo that defeats most of them here... Just something to think about. http://www.turnstep.com/Spambot/avoidance.html has some interesting suggestions for getting around it -- keeping the email address out of the HTML source but still have the page look and work the same. Javascript, creative use of tables, putting the address into a .gif, and so on... Mike Andrews (MA12) * mandrews@dcr.net * http://www.bit0.com/ VP, sysadmin, & network guy, Digital Crescent Inc, Frankfort KY Internet services for Frankfort, Lawrenceburg, Owenton, Shelbyville "Don't sweat the petty things, and don't pet the sweaty things." On Wed, 26 Jan 2000, 0x29A [B.Vandgrift] wrote: > > I'm working on a script which goes through a link library I have and > throws down mad links. I'm having a problem with my email nonsense. > > ideally, I'd like this bit of the program to take something like: > -- > here is an email address:booberry@io.com > -- > and turn it into: > -- > here is an email address: href="mailto:booberry@io.com">booberry@io.com > -- > > I am using the following rexexp: > $inline =~ s/\b(\w+\@\w+(\.\w+)*\.\w+)\b/$1<\/a>/g; > > The problem is, it continues matching on the line. Hence, I get three > nested requests. Cool, but not useful. How can I tell the regexp engine > not to attempt a match on the text that it just inserted? > > Suggestions, comments, etc? They'd all be greatly appreciated. > > Thanks > > > -- > Ben Vandgrift http://www.io.com/~booberry > ________________________________________________________________________ > "I do not feel obliged to believe that the same God who has endowed us > with sense, reason, and intellect has inteded for us to forego their > use." --Galileo > From oneiros at dcr.net Wed Jan 26 20:40:05 2000 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Regexps for email. In-Reply-To: Message-ID: On Wed, 26 Jan 2000, Mike Andrews wrote: > Not that this really answers the question, but I'm a little wary of using > mailto: URL's *anywhere* anymore. The instant you put an email address on > a web page as-is is the same instant you get added to a pile of spammer's > lists. Most of them use web-crawling bots to harvest addresses. We've > got an amusing Apache mod_rewrite + Perl script combo that defeats most of > them here... > > Just something to think about. > > http://www.turnstep.com/Spambot/avoidance.html has some interesting > suggestions for getting around it -- keeping the email address out of the > HTML source but still have the page look and work the same. Javascript, > creative use of tables, putting the address into a .gif, and so on... One interesting approach I've seen is URI encoding e-mail addresses, as web browsers will decode it, but it won't (unless they get smarter) match the patterns for an e-mail address. Eg: oneiros@dcr.net won't match if it's encoded as: oneiros@dcr.net (after all, if the spammers can send us crap that's URI encoded to make it harder to track down, we might as well do the same to them) ----- Joe Hourcle From dpitts at mk.net Thu Jan 27 06:52:54 2000 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Strategic Planning Meeting for PCS Message-ID: <015201bf68c5$6e155100$7801a8c0@adverb.com> Skipped content of type multipart/alternative-------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/lexington-pm/attachments/20000127/d25fed3b/frontp1.htm From dpitts at mk.net Thu Jan 27 06:58:39 2000 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Please Ignore... with apologies Message-ID: <016701bf68c6$3b3055e0$7801a8c0@adverb.com> All, an e-mail that was sent to one of the members of LPM was unfortunately sent to all members of LPM. For this I greatly apologize and ask that you delete the message. If you have any quesitons or concerns, please feel free to contact me. Thanks, David David Pitts Christian, Author, Consultant, Instructor, Speaker, and Systems Administrator www.dpitts.com dpitts@mk.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/lexington-pm/attachments/20000127/7dbd7d92/attachment.htm From hempy at ket.org Thu Jan 27 13:09:02 2000 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Regexps for email. In-Reply-To: References: Message-ID: <4.1.20000127140435.03a8d7b0@mail.ket.org> At 07:29 PM 1/26/2000 -0500, you wrote: >Not that this really answers the question, but I'm a little wary of using >mailto: URL's *anywhere* anymore. The instant you put an email address on >a web page as-is is the same instant you get added to a pile of spammer's >lists. Most of them use web-crawling bots to harvest addresses. We've >got an amusing Apache mod_rewrite + Perl script combo that defeats most of >them here... > >Just something to think about. Good point, Mike. On our site (www.dl.ket.org), we make generous use of a web form for accepting correspondence. The CGI program that is the action of the form then generates an email from our server. Our goal was to provide reliable communications to us, with contact information to write back to the user. Because our students use shared computers, a mailto: generally will not give us the author's email. Furthermore, we ran into problems of them not being able to reliably send email in the first place. (The latter is less of a problem these days.) Keeping our addresses private was not a goal, but perhaps a pleasant side effect. Our links actually do include the email addresses in plain text, but this could be garbled or better yet, come from a table in the CGI program. Food for thought, -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From repett0 at sac.uky.edu Thu Jan 27 20:59:07 2000 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: acm meeting and future of cs/ee at uk Message-ID: If you are a student and interested in the following 1) Computer Science 2) Electrical Engineering 3) Technology in general(Linux, Perl, etc...) I would urge you coming to the next acm meeting (all majors can attend not just cs and ee). Some issues are what are the classes teaching and what could change,.. to see about the new computer engineering degree. Also for cs only, voting for grad and ungrad reps on the faculty board. This is a must go to meeting for all undergrad and grad.. This is going to have direct impacts on the structure of technology and theory at UK. Please come. If you have any questions email me, or call 252-7173(home). I'll email where the meeting is this weekend.. right now it is the Mineral Science building (across from chem phys) in room 110 at 4pm. Skip class.. this is a very urgent meeting and we need a majority turn out. Thanks Ronald Petty ACM (one of 2 undergrads at the meeting) Treasurer UKLUG Whanta be PERL user.... From sungo at brocksplace.com Fri Jan 28 12:19:01 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: modules with activstate sans ppm Message-ID: is there a way to install modules into activestate that arent specifically distributed from activestate. aka go to cpan, dl some module and install it like normal. i've got the gnu ports of gcc and make and all that but they're barfing on the makefile. cygwin's make has the same problem. any thoughts? thanks all. --------------------- Matt Cashner sungo@earthling.net --------------------- "In the battle between you and the world, bet on the world." From rbowen at rcbowen.com Fri Jan 28 12:30:54 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: modules with activstate sans ppm References: Message-ID: <3891E05E.E279C753@rcbowen.com> Matt Cashner wrote: > > is there a way to install modules into activestate that arent specifically > distributed from activestate. aka go to cpan, dl some module and install > it like normal. i've got the gnu ports of gcc and make and all that but > they're barfing on the makefile. cygwin's make has the same problem. any > thoughts? thanks all. There's an article on this in the latest Perl Journal. I've not read it yet, and it's not on the TPJ.com web site yet. But, you're in luck, they sent me two copies, and I could send/give/loan you one of the copies. There's also a web site out there somewhere, but I've not been able to find it again. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From sungo at brocksplace.com Fri Jan 28 12:36:17 2000 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: modules with activstate sans ppm In-Reply-To: <3891E05E.E279C753@rcbowen.com> Message-ID: On Fri, 28 Jan 2000, Rich Bowen wrote: > There's an article on this in the latest Perl Journal. I've not read it > yet, and it's not on the TPJ.com web site yet. But, you're in luck, they > sent me two copies, and I could send/give/loan you one of the copies. > There's also a web site out there somewhere, but I've not been able to > find it again. i've got a subscription, thanks though. :) i just need to check my mailbox more often :) --------------------- Matt Cashner sungo@earthling.net --------------------- "It's always darkest just before it goes pitch black." From repett0 at sac.uky.edu Sun Jan 30 16:02:21 2000 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: ACM -- come to me Message-ID: OK maybe I can send the right message out this time. ACM meeting #2 time 4pm, this tuesday location MMRB (mining mineral building across from chem phys) room 110 voting for undergrad and grad reps on the faculty boards. Also many issues (very important issues for you own future) will be discussed and voted on. Email me and I can go into more detail. This is for the future of the CS department and your own technical and theoritcal and job knowledge and future. All majors welcome and reuired.. please come and make a difference. It starts with you. Ron ps. If you are a ta. please inform your classes. From repett0 at sac.uky.edu Mon Jan 31 09:31:19 2000 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: acm meeting cancelled Message-ID: sorry to be spamming, but the meeting for tomorrow has been cancelled. If you would like more info I can tell you personally whats going on. Also the meeting will be next week. But to make up for this. THere is a cs department meeting today that is going over masters projects and research and also the future of the deptmant at Monday, January 31 4:00p.m. 327 McVey Hall Ron From rbowen at rcbowen.com Mon Jan 31 09:58:53 2000 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:05:38 2004 Subject: LPM: Job Posting Message-ID: <3895B13D.C8B1B88@rcbowen.com> Some folks have indicated that they don't mind the occasional Job Posting coming to the list alias. I'll always title these "Job Posting", so you can set your filters accordingly if you don't want to see these. If you have strong objections to receiving these, perhaps we can discuss it at the next PM meeting. -------- Original Message -------- Subject: Job Posting Date: Mon, 31 Jan 2000 10:02:31 -0600 From: Bobbi Short To: "'rcbowen@rcbowen.com'" Hello. I understand you are responsible for the Lexington area Perl Monger group. We have several opportunities available in the Indianapolis are for contract to hire mod_perl architects. If possible, can you please send out word on these opportunities? Here is a brief description of the opportunities: Tech-Pro, Inc. is a computer consulting services company with offices in Indianapolis, Indiana; Minneapolis, Minnesota; Denver, Colorado; and Phoenix, Arizona. We provide experienced computer professionals on a contract basis. Our consulting staff consists of salaried, hourly and independent contractors. We have immediate Perl opportunities available in the Indianapolis area for a very large, well known corporation. These positions involve heavy Perl scripting and require experience with mod_perl. These are contract to perm positions. We would like to speak with you further regarding these opportunities. Please contact either Bobbi Short or David Martin at (317) 577-4840 / 4841. If you know of someone else with these skills who may also be interested, please pass this information along to them. Thanks for responding. We are looking forward to speaking with you. Rich, please let me know if you are able to help me out with this request. Thanks a bunch! Bobbi Short Tech-Pro, Inc. 8041 Knue Road Indianapolis, IN 46250 Main: (317) 577-4840 Fax: (317) 845-0389 Toll Free: (877) 874-5627 Office locations in Indianapolis, Denver, the Twin Cities, and Phoenix email:bobbi.short@tech-pro.com www.tech-pro.com Tech-Pro, Inc. is member of the National Association of Computer Consulting Businesses (NACCB).