From rbowen at rcbowen.com Mon Dec 6 14:06:29 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: Perl one-liners Message-ID: <384C1745.33EDD27A@rcbowen.com> Hi, fellow Mongers. I'm in need of some small assistance. I opened my big mouth, and suggested that it would be nice if there was a place on CPAN where one could find Perl one-liners (not just JAPHs, but actual useful stuff) and explanations thereof. Well, to make a long story short, as often happens in the Perl community, a suggestion like that was swiftly converted in to volunteering, and I'm the new proprieter of the official Perl One-liner Repository. I was hoping that the Lexington Perl Mongers might be able to contribute something to this effort in some small ways. 1) Clever Acronym: Yes, everything in Perl needs a clever acronym. I thought of POLAR (Perl One Liner ARchive), or CPOLE (Comprehensive Perl One Liner ... um ... not sure what the E stands for). 2) Collecting good examples, and documenting them. Yes, I know, you probably have about as much free time as I do. What I am looking for is one-liners that are edifying and genuinely useful. Like "perl -MCPAN -e shell" and "perl -pi.bak -e 's/\r$//' dos_file" for example - things that do things that average users actually need to do. As well as more esoteric things like Abigail's sigs (she's given blanket permission to use any of her sigs) and Randal's JAPHs. 3) Organizing and formatting. This needs to be reasonably laid out, and might need to get put into mysql so that it can be displayed in a variety of formats as needed. Any other suggestions are welcome. The current URL for this is http://history.perl.org/oneliners and it will eventually be at http://oneliners.perl.org/ Elaine Ashton did not think that it belonged on CPAN, so, at least for now, it will be on Elaine's box. (This is the same machine that hosts our web site, I think.) Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From repett0 at sac.uky.edu Mon Dec 6 14:17:02 1999 From: repett0 at sac.uky.edu (repett0@sac.uky.edu) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: web junkies In-Reply-To: <384C1745.33EDD27A@rcbowen.com> Message-ID: This is Ron over at UKLUH(linux users group). Me and some friends and associates are making a new web site. However, for the sake of privacy I don't want to get into details. You will not be paid.. but me and the other 5 people working on this believe it has enough potential.. there is some things lacking like we need a perl monger to work with us. If you are interested in more info I'll call you.. no email. Sorry for the secrecy but the site is going up on christmas and we don't want anything leaking before hand. If you want to call me I'll be at this number till 340pm today. If you call and leave me a number I'll call you back. 252-7173 Ron Petty From ken.rietz at asbury.edu Mon Dec 6 17:20:45 1999 From: ken.rietz at asbury.edu (Rietz, Ken) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: RE: Perl one-liners Message-ID: > > > Hi, fellow Mongers. I'm in need of some small assistance. > > I opened my big mouth, and suggested that it would be nice if > there was > a place on CPAN where one could find Perl one-liners (not just JAPHs, > but actual useful stuff) and explanations thereof. Well, to > make a long > story short, as often happens in the Perl community, a suggestion like > that was swiftly converted in to volunteering, and I'm the new > proprieter of the official Perl One-liner Repository. > > I was hoping that the Lexington Perl Mongers might be able to > contribute > something to this effort in some small ways. > > 1) Clever Acronym: Yes, everything in Perl needs a clever acronym. I > thought of POLAR (Perl One Liner ARchive), or CPOLE > (Comprehensive Perl > One Liner ... um ... not sure what the E stands for). Another candidate: POLECAT (Perl One-Liner Eclectic CATalog) > > 2) Collecting good examples, and documenting them. Yes, I know, you > probably have about as much free time as I do. What I am > looking for is > one-liners that are edifying and genuinely useful. Like "perl > -MCPAN -e > shell" and "perl -pi.bak -e 's/\r$//' dos_file" for example - things > that do things that average users actually need to do. As well as more > esoteric things like Abigail's sigs (she's given blanket permission to > use any of her sigs) and Randal's JAPHs. There have been a bunch in The Perl Journal over the years. I presume those are already accounted for. > > 3) Organizing and formatting. This needs to be reasonably > laid out, and > might need to get put into mysql so that it can be displayed in a > variety of formats as needed. Let me think about various categories and get back to you. Obvious ones: Sigs Filters System administration -- Ken From fprice at mis.net Mon Dec 6 19:19:34 1999 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: RE: Perl one-liners In-Reply-To: Message-ID: On Mon, 6 Dec 1999, Rietz, Ken wrote: #> 1) Clever Acronym: Yes, everything in Perl needs a clever acronym. I #> thought of POLAR (Perl One Liner ARchive), or CPOLE #> (Comprehensive Perl #> One Liner ... um ... not sure what the E stands for). # #Another candidate: POLECAT (Perl One-Liner Eclectic CATalog) Oh my! I like it :-) #> 3) Organizing and formatting. This needs to be reasonably #> laid out, and #> might need to get put into mysql so that it can be displayed in a #> variety of formats as needed. How 'bout using XML or some other SGML variant? -Frank. ____ ____ Frank Price fprice@mis.net Linux: the choice of a GNU generation -|- Why not go mad? From rbowen at rcbowen.com Mon Dec 6 19:54:56 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: RE: Perl one-liners References: Message-ID: <384C68F0.51AEC72B@rcbowen.com> "Rietz, Ken" wrote: > ... > Another candidate: POLECAT (Perl One-Liner Eclectic CATalog) Hmm. I think I like that one! > There have been a bunch in The Perl Journal over the years. I presume > those are already accounted for. Jon Orwant (the Editor of TPJ) said that those would be fine to put in there. And the good thing about those is that most of them already have explanations with them. I'll probably need to contact the authors of each, for good form. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From info at inexchange.net Tue Dec 7 19:50:16 1999 From: info at inexchange.net (Info Desk) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: Special Webhosting and Dedicated Server Offer Message-ID: <19991208015016585.BYOU130@infomail.inexchange.net@outbox.infowatch.net> If you wish to be excluded from any future mailings, reply with "remove" in the subject header. ------------------------------------------------------------ http://www.inexchange.net Internet Exchange would like to introduce our Special Hosting and Dedicated Server Plans * Budget Plans from $14.95 Mo. * E-commerce Plans from $49.95 Mo. * Dedicated Server Plan from $99.00 Mo. (Ask about YOUR FREE Server!) * Sign up for 6 months, and we'll WAIVE the setup fee * Sign up for 10 months, and we'll WAIVE the setup fee and give you 2 FREE months * Sign up for 12 months, and we'll give you a FULL FREE 2nd year of hosting * UNLIMITED E-mail, E-mail forwarding, auto responders and vacation reply * FREE registration of your domain with over 950 search engines * Multiple, Redundant, High-Speed connections to the web * INTERNATIONAL Hosting * Access to your account anytime from your own browser * Full Microsoft Front Page support * Unlimited FTP updates * Personal CGI directory for your own scripts (or use ours) * Comprehensive statistics program shows you everything * Domain name registration (www.yourname.com) * Friendly customer support * Additional plans also available If for any reason you are not satisfied with InfoWatch's service after 30 days, we will transfer you back to your original host and pay any transfer fees. http://www.inexchange.net info@inexchange.net From rbowen at rcbowen.com Wed Dec 8 09:22:23 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: Special Webhosting and Dedicated Server Offer References: <19991208015016585.BYOU130@infomail.inexchange.net@outbox.infowatch.net> Message-ID: <384E77AF.D50D7E38@rcbowen.com> Sorry about this. I'm looking into how to close the list - so that only subscribers can post to the list. Any MajorDomo users out there tell me how to do this? Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From Tony_Payne at databeam.com Wed Dec 8 09:25:13 1999 From: Tony_Payne at databeam.com (Tony_Payne@databeam.com) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: Special Webhosting and Dedicated Server Offer Message-ID: <85256841.0054B060.00@lexsmtp01.databeam.com> it will be in the config file for the list, and should be straight forward.. Tony Please respond to lexington-pm-list@happyfunball.pm.org To: lexington-pm-list@happyfunball.pm.org cc: (bcc: Tony Payne/LEX/Lotus) Subject: Re: LPM: Special Webhosting and Dedicated Server Offer Sorry about this. I'm looking into how to close the list - so that only subscribers can post to the list. Any MajorDomo users out there tell me how to do this? 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 Dec 8 10:03:10 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: Special Webhosting and Dedicated Server Offer References: <85256841.0054B060.00@lexsmtp01.databeam.com> Message-ID: <384E813E.BD4315BE@rcbowen.com> I guess I should have been more specific. All configuration for the LPM list is via MajorCool, since we don't actually have direct access to the machine where the list resides. I can't find anything in the UI that refers to this. I suppose could just email Elaine and ask her to do it, but I was hoping I would not have to bother her. 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 Wed Dec 8 16:44:29 1999 From: grdodson at lexmark.com (Graydon Dodson) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: Special Webhosting and Dedicated Server Offer Message-ID: <199912082244.RAA01265@interlock2.lexmark.com> The following is a section from my system's majordomo config files. Looks like this is what you have to set in your .config file to get what you want to work. My guess is set "restrict_post" to the filename of the file that holds all the subscribed users. I have never tried this, we don't use "resend" here so it would not work in my shop, but I believe this list does use "resend". Graydon Dodson ------ majordomo *.config file ------ ... # restrict_post [restrict_post] (undef) # If defined, only addresses listed in these files (colon or space # separated) can post to the mailing list. By default, these files # are relative to the lists directory. These files are also checked # when get_access, index_access, info_access, intro_access, # which_access, or who_access is set to 'list'. This is less useful # than it seems it should be since there is no way to create these # files if you do not have access to the machine running resend. # This mechanism will be replaced in a future version of # majordomo/resend. restrict_post = ... -------------------------------------- ----- Begin Included Message ----- >From owner-lexington-pm-list%happyfunball.pm.org@interlock.lexmark.com Wed Dec 8 11:03 EST 1999 X-Authentication-Warning: happyfunball.pm.org: mjordomo set sender to owner-lexington-pm-list@pm.org using -f Date: Wed, 08 Dec 1999 11:03:10 -0500 From: Rich Bowen X-Accept-Language: en To: lexington-pm-list%happyfunball.pm.org@interlock.lexmark.com Subject: Re: LPM: Special Webhosting and Dedicated Server Offer I guess I should have been more specific. All configuration for the LPM list is via MajorCool, since we don't actually have direct access to the machine where the list resides. I can't find anything in the UI that refers to this. I suppose could just email Elaine and ask her to do it, but I was hoping I would not have to bother her. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt ----- End Included Message ----- From hempy at ket.org Fri Dec 10 12:51:25 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:28 2004 Subject: LPM: December meeting this Monday In-Reply-To: <3832DA74.58F5AAD6@rcbowen.com> References: Message-ID: <4.1.19991210135010.031b6510@mail.ket.org> Heads up for this Monday's meeting. Looking ahead, I've got the room reserved: Monday, Dec 13th 6pm - 8pm. Monday, Jan 10th 6pm - 8pm. Monday, Feb 14th 6pm - 8pm. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From hempy at ket.org Fri Dec 10 14:23:18 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: <4.1.19991210135010.031b6510@mail.ket.org> References: <3832DA74.58F5AAD6@rcbowen.com> Message-ID: <4.1.19991210151700.04230780@mail.ket.org> Okay, I want to print the size of an image, so I write: print "Size: $width x $height.\n"; ...but I'd rather not have the spaces around the "x". Of course, the following does not work: print "Size: $widthx$height.\n"; So I ended up doing this: print "Size: $width" . "x$height.\n"; Which is fine and dandy, but requires seven extra keystrokes (including shifts). My goal in my professional life is to reduce the total number of keystrokes my fingers must endure. Is there some "end of identifier" operator or other perl magic that might fill the bill? Lazily yours, -dave ;-) -- David Hempy Internet Database Administrator Kentucky Educational Television From aaron at iglou.com Fri Dec 10 14:42:41 1999 From: aaron at iglou.com (AARON B. DOSSETT) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: <4.1.19991210151700.04230780@mail.ket.org> from "David Hempy" at Dec 10, 99 03:23:18 pm Message-ID: A non-text attachment was scrubbed... Name: not available Type: text Size: 650 bytes Desc: not available Url : http://mail.pm.org/archives/lexington-pm/attachments/19991210/4eff173f/attachment.bat From sml at zfx.com Fri Dec 10 14:33:06 1999 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question References: <3832DA74.58F5AAD6@rcbowen.com> <4.1.19991210151700.04230780@mail.ket.org> Message-ID: <38516382.63DE@zfx.com> David Hempy wrote: > ...but I'd rather not have the spaces around the "x". Of course, the > following does not work: > > print "Size: $widthx$height.\n"; > > So I ended up doing this: > > print "Size: $width" . "x$height.\n"; > > Which is fine and dandy, but requires seven extra keystrokes (including > shifts). My goal in my professional life is to reduce the total number of > keystrokes my fingers must endure. Is there some "end of identifier" > operator or other perl magic that might fill the bill? you're in luck, but it'll require two extra characters (and four keystrokes): print "Size: ${width}x$height.\n"; i'm tempted to try to explain the general rule here (something like "braces following a variable identifier character mean treat what's inside the braces as either a reference or a variable name"), but i'm not exactly sure if that's exactly correct. anyway, it works. -- Steve Lane From rbowen at rcbowen.com Fri Dec 10 14:45:07 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question References: <3832DA74.58F5AAD6@rcbowen.com> <4.1.19991210151700.04230780@mail.ket.org> Message-ID: <38516653.1606837C@rcbowen.com> David Hempy wrote: > > Okay, I want to print the size of an image, so I write: > > print "Size: $width x $height.\n"; > > ...but I'd rather not have the spaces around the "x". Of course, the > following does not work: > > print "Size: $widthx$height.\n"; > > So I ended up doing this: > > print "Size: $width" . "x$height.\n"; > > Which is fine and dandy, but requires seven extra keystrokes (including > shifts). My goal in my professional life is to reduce the total number of > keystrokes my fingers must endure. Is there some "end of identifier" > operator or other perl magic that might fill the bill? > > Lazily yours, > -dave ;-) I tried the following: perl -e '$foo = "one"; $bar="two"; print "${foo}X${bar}\n";' oneXtwo It reduces your total character count, but if you are counting shift, it increases your key strokes. One could also do: perl -e '$foo = "one"; $bar="two"; print "${foo}X$bar\n";' oneXtwo Which does in fact reduce keystrokes, but looks a little less symmetric. 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 Fri Dec 10 14:57:07 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: <4.1.19991210151700.04230780@mail.ket.org> References: <4.1.19991210135010.031b6510@mail.ket.org> <3832DA74.58F5AAD6@rcbowen.com> Message-ID: <4.1.19991210155407.042095b0@mail.ket.org> At 03:23 PM 12/10/1999 -0500, I wrote: >My goal in my professional life... At 03:33 PM 12/10/1999 -0500, Steve Lane wrote: At 03:42 PM 12/10/1999 -0500, AARON B. DOSSETT wrote: At 03:45 PM 12/10/1999 -0500, Rich Bowen wrote: ...and within 20 minutes I've got three answers that all agree and are correct! You guys are good! And you check your email too often. ;-) Thanks, -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From fireston at lexmark.com Fri Dec 10 14:58:29 1999 From: fireston at lexmark.com (Mik Firestone) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: <38516653.1606837C@rcbowen.com> Message-ID: <199912102058.PAA04227@interlock2.lexmark.com> If we are counting keystrokes, this is roughly equivalent but it doesn't destroy the symmetry as much: print "Size: $width\x78$height.\n"; I somehow don't think either symmetry nor keystrokes is enough to forgive this ugliness, though. :) On Fri, 10 Dec 1999, Rich Bowen wrote: > David Hempy wrote: > > > > Okay, I want to print the size of an image, so I write: > > > > print "Size: $width x $height.\n"; > > > > ...but I'd rather not have the spaces around the "x". Of course, the > > following does not work: > > > > print "Size: $widthx$height.\n"; > > > > So I ended up doing this: > > > > print "Size: $width" . "x$height.\n"; > > > > Which is fine and dandy, but requires seven extra keystrokes (including > > shifts). My goal in my professional life is to reduce the total number of > > keystrokes my fingers must endure. Is there some "end of identifier" > > operator or other perl magic that might fill the bill? > > > > Lazily yours, > > -dave ;-) > > I tried the following: > > perl -e '$foo = "one"; $bar="two"; print "${foo}X${bar}\n";' > oneXtwo > > It reduces your total character count, but if you are counting shift, it > increases your key strokes. > > One could also do: > > perl -e '$foo = "one"; $bar="two"; print "${foo}X$bar\n";' > oneXtwo > > Which does in fact reduce keystrokes, but looks a little less symmetric. > > Rich > -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: I will not waste time making my enemy's death look like an accident: I'm not accountable to anyone and my other enemies wouldn't believe it. From oneiros at dcr.net Fri Dec 10 15:12:22 1999 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: <38516382.63DE@zfx.com> Message-ID: On Fri, 10 Dec 1999, Steve Lane wrote: > print "Size: ${width}x$height.\n"; > > i'm tempted to try to explain the general rule here > (something like "braces following a variable identifier > character mean treat what's inside the braces as either > a reference or a variable name"), but i'm not exactly > sure if that's exactly correct. anyway, it works. >From my understanding of it, you're basically just specifying braces, as they're generally implied to be from the identifier ($@%*&), to the wherever it could be (greedy matching) Braces are also useful for setting wierd precidence, as I think the following should all give the contents of $width: $width ${width} $foo = 'width'; ${$foo} ${&foo}; sub foo { return 'width'; } and as for shortening keystrokes, that's what single letter variable names are for: print "Size: ${w}x$h\n"; So what if it creates annoying to maintain code, right? I mean, a few keystokes here, so what if it results in hours of work later, when you're trying to remember what the variables are? -Joe From soward at uky.edu Fri Dec 10 15:32:49 1999 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question References: <3832DA74.58F5AAD6@rcbowen.com> <4.1.19991210151700.04230780@mail.ket.org> Message-ID: <38517181.7621EAF7@uky.edu> David Hempy wrote: > > Okay, I want to print the size of an image, so I write: > > print "Size: $width x $height.\n"; > > ...but I'd rather not have the spaces around the "x". Of course, the > following does not work: > > print "Size: $widthx$height.\n"; > > So I ended up doing this: > > print "Size: $width" . "x$height.\n"; > > Which is fine and dandy, but requires seven extra keystrokes (including > shifts). My goal in my professional life is to reduce the total number of > keystrokes my fingers must endure. Is there some "end of identifier" > operator or other perl magic that might fill the bill? > Well, since readability obviously isn't an issue, just change the variable names to w and h and you've save 9 characters before you even get started. OTOH, you could use printf and wind up with a slightly easier to read, but still 7 character longer than desired, line of code. printf "Size: %dx%d.\n",$height,$width; -- 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 mandrews at bit0.com Sat Dec 11 00:08:36 1999 From: mandrews at bit0.com (Mike Andrews) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: <38517181.7621EAF7@uky.edu> Message-ID: OK, following in the spirit of "There's More Than One Way To Do It", and because it's late and I'm feeling silly: my @array = ($width, "x", $height); print join ("", @array) . "\n"; OK, not the most efficient way, but it's mostly readable. :-) 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, 10 Dec 1999, John Soward wrote: > David Hempy wrote: > > > > Okay, I want to print the size of an image, so I write: > > > > print "Size: $width x $height.\n"; > > > > ...but I'd rather not have the spaces around the "x". Of course, the > > following does not work: > > > > print "Size: $widthx$height.\n"; > > > > So I ended up doing this: > > > > print "Size: $width" . "x$height.\n"; > > > > Which is fine and dandy, but requires seven extra keystrokes (including > > shifts). My goal in my professional life is to reduce the total number of > > keystrokes my fingers must endure. Is there some "end of identifier" > > operator or other perl magic that might fill the bill? > > > Well, since readability obviously isn't an issue, just change the > variable names to w and h and you've save 9 characters before you even > get started. OTOH, you could use printf and wind up with a slightly > easier to read, but still 7 character longer than desired, line of code. > > printf "Size: %dx%d.\n",$height,$width; > -- > 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 fprice at mis.net Sat Dec 11 10:39:00 1999 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Silly string question In-Reply-To: Message-ID: On Fri, 10 Dec 1999, Joe Hourcle wrote: # On Fri, 10 Dec 1999, Steve Lane wrote: # # > i'm tempted to try to explain the general rule here # > (something like "braces following a variable identifier # > character mean treat what's inside the braces as either # > a reference or a variable name"), but i'm not exactly # > sure if that's exactly correct. anyway, it works. # # >From my understanding of it, you're basically just specifying braces, as # they're generally implied to be from the identifier ($@%*&), to the # wherever it could be (greedy matching) # # Braces are also useful for setting wierd precidence, as I think the # following should all give the contents of $width: # # $width # # ${width} # # $foo = 'width'; ${$foo} # # ${&foo}; sub foo { return 'width'; } These last two will only work if you don't have 'use strict' turned on, or haven't selectively turned it off for symbolic references with "no strict 'refs'". -Frank. ____ ____ Frank Price fprice@mis.net Linux: the choice of a GNU generation -|- Why not go mad? From booberry at io.com Tue Dec 14 11:06:40 1999 From: booberry at io.com (0x29A [B.Vandgrift]) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regex question -- In-Reply-To: <384E77AF.D50D7E38@rcbowen.com> Message-ID: This one's a little beyond my ken. I'd appreciate some help. I need to replace something like: "one","two","three","four,five","six" with "one";"two";"three";"four,five";"six" What's the move? Thanks. -- Ben Vandgrift http://www.io.com/~booberry ________________________________________________________________________ "Never attribute to malice that which can be adequately explained by stupidity." --Robert Heinlein, Logic of Empire From soward at uky.edu Tue Dec 14 11:30:56 1999 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regex question -- References: Message-ID: <38567ED0.DCA387FD@uky.edu> "0x29A [B.Vandgrift]" wrote: > > This one's a little beyond my ken. I'd appreciate some help. > > I need to replace something like: > > "one","two","three","four,five","six" > > with > > "one";"two";"three";"four,five";"six" > > What's the move? > rather than fight with a regex set, I'd use the Text::CSV module as such: #!/usr/bin/perl #Use cool CSV module from CPAN require Text::CSV; #instantiate new CSV parser object $csv = Text::CSV->new; while ($line=<>) { $column = ''; $newline= ''; if ($csv->parse($line)) { @field = $csv->fields; $x=0; for $column (@field) { print $column; $x++; if ($x > $#field) { print "\n"; } else { print ";"; } } } } of course you could also accomplish the same in much fewer code-lines using various other perl techniques, I chose an explicit while and if set of contructs for simplicity of the illustration. -- 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 hempy at ket.org Tue Dec 14 11:39:27 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regex question -- In-Reply-To: References: <384E77AF.D50D7E38@rcbowen.com> Message-ID: <4.1.19991214123338.0315e760@mail.ket.org> At 11:06 AM 12/14/1999 -0600, you wrote: >I need to replace something like: > >"one","two","three","four,five","six" > >with > >"one";"two";"three";"four,five";"six" I'm new at this, so I'll jump in early. That way, the pros can correct me or show me up after the fact. ;-) This should work, if you know the input is going to be well behaved: s/","/";"/g; (I don't think you have to escape the quotes, but I haven't actually tested it.) If ever got "one",",","two" you'd be in trouble. (I think) I'm eager to see a more robust solution. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From gcasillo at ket.org Tue Dec 14 12:10:18 1999 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Using sleep() Message-ID: <38568809.85FF1889@ket.org> I have a script I want to run every 30 minutes or so. On a *nix box, I'd add a line to my crontab to do this. No problem, except I'm working with an NT box. From my limited knowledge of NT, there is no equivalent of cron native to NT. To make a long story shorter, I tried Wincron and another DOS cron utility with no success. Is there anything wrong with doing the following: while (sleep 1800) { ... yaddy-yaddy-yaddah ... } Does the sleep() routine have a lot of overhead or use a lot of CPU cycles? Any better ideas? Thanks, Gregg Casillo gcasillo@ket.org From rbowen at rcbowen.com Tue Dec 14 12:38:18 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Using sleep() References: <38568809.85FF1889@ket.org> Message-ID: <38568E9A.DCAB6FBD@rcbowen.com> Gregg Casillo wrote: > > I have a script I want to run every 30 minutes or so. On a *nix box, I'd > add a line to my crontab to do this. No problem, except I'm working with > an NT box. From my limited knowledge of NT, there is no equivalent of > cron native to NT. To make a long story shorter, I tried Wincron and > another DOS cron utility with no success. > > Is there anything wrong with doing the following: > > while (sleep 1800) { > ... > yaddy-yaddy-yaddah > ... > } > > Does the sleep() routine have a lot of overhead or use a lot of CPU > cycles? Any better ideas? sleep() appears to have very low CPU overhead. However, if you want a real solution, try crond from AINTX (http://maxx.mc.net/~jlh/nttools.htm) It's a real cron daemon, with a real crontab file. I think that it will be more what you are used to, and you don't have to mess with restarting the program if it gets interrupted, and other annoyances of while(1) programs. 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 Dec 14 12:00:00 1999 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regex question -- In-Reply-To: <4.1.19991214123338.0315e760@mail.ket.org> References: Message-ID: <199912141858.NAA23588@sidewinder.fetterprinting.com> Why not use split and join instead of regular expressions? You could check for double quotes at the beginning/end of each piece returned by split to ensure that your join goes the way you want. Or maybe just split on ", and join on "; - I think that might do it. Janine Date sent: Tue, 14 Dec 1999 12:39:27 -0500 To: lexington-pm-list@happyfunball.pm.org From: David Hempy Subject: Re: LPM: regex question -- Send reply to: lexington-pm-list@happyfunball.pm.org > At 11:06 AM 12/14/1999 -0600, you wrote: > >I need to replace something like: > > > >"one","two","three","four,five","six" > > > >with > > > >"one";"two";"three";"four,five";"six" > > I'm new at this, so I'll jump in early. That way, the pros can correct me > or show me up after the fact. ;-) > > This should work, if you know the input is going to be well behaved: > > s/","/";"/g; > > (I don't think you have to escape the quotes, but I haven't actually tested > it.) > If ever got "one",",","two" you'd be in trouble. (I think) > > I'm eager to see a more robust solution. > > -dave > > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television > From hempy at ket.org Tue Dec 14 13:38:48 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Using sleep() In-Reply-To: <38568809.85FF1889@ket.org> Message-ID: <4.1.19991214143454.039bd960@mail.ket.org> At 01:10 PM 12/14/1999 -0500, you wrote: >I have a script I want to run every 30 minutes or so. One way to hack this functionality into NT is to use the SOON command. It basically says, "Run some command in X seconds". It is essentially an interface to AT. You can end your program with a SOON command to run it again in a little while. As long as the chain runs unbroken, you're in luck. This of course is a problem if your program doesn't complete or any number of other issues. I'm frankly not a fan of this approach. >Does the sleep() routine have a lot of overhead or use a lot of CPU >cycles? Any better ideas? Sleep is quite lean on the CPU. If your program sits on a big pile of memory, this could be an issue, even with paging. -d -- David Hempy Internet Database Administrator Kentucky Educational Television From rbowen at rcbowen.com Tue Dec 14 15:55:54 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Thanks, Frank Message-ID: <3856BCEA.90857D7B@rcbowen.com> First of all, many thanks to Frank for his great talk. Secondly, is anyone willing to do next month's meeting? Perhaps something on Using Perl After The Y2K Apocalypse? :-0 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 Dec 15 07:59:20 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: MakeMaker and version numbers Message-ID: <38579EB8.8E36B2B7@rcbowen.com> On Monday, someone asked what the limitations were on the version numbers used when setting $VERSION in a module. I was tinkering with that this morning, and observed the following. When I set $VERSION to $VERSION = 0.001.001.03; the file that was generated by 'make dist' was testing-0.00113.tar.gz So it appears that after the first decimal point, all others just get dropped by some rule or another. I'm sure that this is specified in the documentation for ExtUtils::MakeMaker, and it would have been easier to just look there, but I was messing with it anyway, so I thought I'd try that. 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 Dec 15 09:06:07 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: MakeMaker and version numbers References: <38579EB8.8E36B2B7@rcbowen.com> Message-ID: <3857AE5F.EA8DFAA4@rcbowen.com> Rich Bowen wrote: > > On Monday, someone asked what the limitations were on the version > numbers used when setting $VERSION in a module. I was tinkering with > that this morning, and observed the following. When I set $VERSION to > > $VERSION = 0.001.001.03; > > the file that was generated by 'make dist' was > > testing-0.00113.tar.gz And, my second observation is that if $VERSION is a string, rather than a bareword, that this works. I hate it when I send out dumb things in email. Obviously, the line of code above: $VERSION = 0.001.001.03; is not particularly valid, since 0.001.001.03 is not a number or a valid expression of any kind. Perl converts it to a number in the best way that it can figure out. So 0.001.001.03 becomes 0.00113 $VERSION = '0.001.001.03'; would have been just fine. As would $VERSION = 'this_is_my_way_cool_version_number'; Rich 'RTFM' Bowen -- 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 Dec 15 08:15:46 1999 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files Message-ID: <199912151514.KAA17163@sidewinder.fetterprinting.com> Hello, List! Does anyone have a smooth way of sorting large text files? (By "large" I mean "in excess of 1GB" and by "text files" I mean "flat ASCII database files.") Here's the task: I have a text database of a million or so records. Each record is about 1300 bytes long. I need to change record format from fixed-field to delimited, sort the records in country name order, then output in 10,000 record pieces to sequentially numbered text files. I already have routines to change format and output the file in pieces; it's the sorting part that has me wondering. Any suggestions are much appreciated. Thanks! Janine (aka "Louisville Girl") From rbowen at rcbowen.com Wed Dec 15 09:30:01 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files References: <199912151514.KAA17163@sidewinder.fetterprinting.com> Message-ID: <3857B3F9.254C3622@rcbowen.com> Janine Ladick wrote: > > Hello, List! > > Does anyone have a smooth way of sorting large text files? (By > "large" I mean "in excess of 1GB" and by "text files" I mean "flat > ASCII database files.") Step 1: Get 2GB of RAM Step 2: Read the file into an array and call sort() on it. Step 3: Go read a good book OK, all kidding aside ... Uri Guttman and Larry Rosler presented a paper at the Perl Conference about sorting. There is nothing in that paper about huge text files, but they might have some insight into this. I know that there are sorts that don't require that you have the whole data set in memory at a time I suspect that they are slower than (insert favorite slow thing) but I guess that sorting a gig of data is going to be slow no matter what. I think that my first step would be to run through the data file and insert each entry into a real database, and then select it back out of the database in sorted order. My suspicion is that that would be the most efficient thing to do, even if you don't use the datase for storing the data. A million records is not very many, when talking about a real database, but it's a boatload when you're just trying to deal with text files. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From oneiros at dcr.net Wed Dec 15 09:50:42 1999 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files In-Reply-To: <3857B3F9.254C3622@rcbowen.com> Message-ID: On Wed, 15 Dec 1999, Rich Bowen wrote: > Janine Ladick wrote: > > > > Hello, List! > > > > Does anyone have a smooth way of sorting large text files? (By > > "large" I mean "in excess of 1GB" and by "text files" I mean "flat > > ASCII database files.") > > Step 1: Get 2GB of RAM > Step 2: Read the file into an array and call sort() on it. > Step 3: Go read a good book > > OK, all kidding aside ... > > Uri Guttman and Larry Rosler presented a paper at the Perl Conference > about sorting. There is nothing in that paper about huge text files, but > they might have some insight into this. > > I know that there are sorts that don't require that you have the whole > data set in memory at a time I suspect that they are slower than (insert > favorite slow thing) but I guess that sorting a gig of data is going to > be slow no matter what. > > I think that my first step would be to run through the data file and > insert each entry into a real database, and then select it back out of > the database in sorted order. My suspicion is that that would be the > most efficient thing to do, even if you don't use the datase for storing > the data. A million records is not very many, when talking about a real > database, but it's a boatload when you're just trying to deal with text > files. Well, I've never done this before, but it would seem to me, that if you're only sorting my country, and no other field, then you only need enough memory to keep two copies of the list of countries in memory at once... if i had more time, I'd write up the code, but here's the procedures I would try: make a list of all of the countries in the file sort the list of countries for each country in the list copy the matching items from the input to output file Of course, this will require (size of file)x2 in drive space, but HD space is cheaper than memory these days. -Joe From llang at baywestpaper.com Wed Dec 15 09:55:41 1999 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files Message-ID: This may be the most horribly inefficient way to do it, but if I were faced with a huge file, a small-ish PC and a time crunch to get it sorted, I'd probably do this in lieu of having the time to research a really good way: (No laughing, please - or at least keep it to yourselves :-} -- comments on improvement, however, are welcome) 1. Parse through the file and create an array of country names, keeping only the unique ones. 2. Sort that array. 3. For each element of that array, parse the file again and pull out the records that match that country name. Like I said, it's inefficient, but (for me, anyway) it'd get it done faster than putting together a really elegant solution. 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 (the soon-to-be-retired) Hello, List! Does anyone have a smooth way of sorting large text files? (By "large" I mean "in excess of 1GB" and by "text files" I mean "flat ASCII database files.") Here's the task: I have a text database of a million or so records. Each record is about 1300 bytes long. I need to change record format from fixed-field to delimited, sort the records in country name order, then output in 10,000 record pieces to sequentially numbered text files. I already have routines to change format and output the file in pieces; it's the sorting part that has me wondering. Any suggestions are much appreciated. Thanks! Janine (aka "Louisville Girl") From soward at uky.edu Wed Dec 15 10:14:18 1999 From: soward at uky.edu (John Soward) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files References: <199912151514.KAA17163@sidewinder.fetterprinting.com> Message-ID: <3857BE5A.F0AF7791@uky.edu> Janine Ladick wrote: > > Hello, List! > > Does anyone have a smooth way of sorting large text files? (By > "large" I mean "in excess of 1GB" and by "text files" I mean "flat > ASCII database files.") > > Here's the task: I have a text database of a million or so records. > Each record is about 1300 bytes long. I need to change record > format from fixed-field to delimited, sort the records in country name > order, then output in 10,000 record pieces to sequentially numbered > text files. I already have routines to change format and output the > file in pieces; it's the sorting part that has me wondering. > There are lots of ways, several of which have been addresses. If this is a UNIX or other system where you have access to GNU sort from the command line, once you've made the jump from fixed to delimited, you can use GNU sort and it _should_ handle the file size reverting to a file-based sort. Alternatively you could attempt one of the 'bucket' type approaches mentioned, breaking the task down by the 'country' field. You could build an array of line numbers which match each country and sort from there, etc... Rich's suggestion of inserting into a database might be the most efficient overall though, since a mis-step in the coding of another approach might cause you to have to make several run-throughs and manually check for accuracy. MySQL should be able to handle a single table of this size and return the results ordered by country easily. Barring all that I do have some machines here with several Gig of RAM... -- 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 aaron at iglou.com Wed Dec 15 10:17:11 1999 From: aaron at iglou.com (AARON B. DOSSETT) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files In-Reply-To: from "llang@baywestpaper.com" at Dec 15, 99 10:55:41 am Message-ID: A non-text attachment was scrubbed... Name: not available Type: text Size: 1231 bytes Desc: not available Url : http://mail.pm.org/archives/lexington-pm/attachments/19991215/25e39047/attachment.bat From janine.ladick at fetterprinting.com Wed Dec 15 09:18:21 1999 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files In-Reply-To: <3857BE5A.F0AF7791@uky.edu> Message-ID: <199912151617.LAA21255@sidewinder.fetterprinting.com> > There are lots of ways, several of which have been addresses. If this > is a UNIX or other system where you have access to GNU sort from the > command line, once you've made the jump from fixed to delimited, you can > use GNU sort and it _should_ handle the file size reverting to a > file-based sort. I'm a *nix idiot. Don't know a thing about it except the user name and password to get to our Solaris systems so that I can FTP data to our laser printers. Are there GNU-like things for Win32? Janine From fireston at lexmark.com Wed Dec 15 10:27:02 1999 From: fireston at lexmark.com (Mik Firestone) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Sorting Big Files In-Reply-To: Message-ID: <199912151627.LAA24495@interlock2.lexmark.com> How about doing it this way: 1. Scan the file once, creating a hash keyed by the byte offset of the record in the file and the values would be the country code. 2. Sort the hash first by country code and then location in the file. 3. Use seeks to access each record in sorted order - it will come out by country code, and the secondary sort should make reading faster as you will not have to backtrack through the file. In quick code fashion, it would look something like this: %index = (); open FILE, "file"; $/ = \1300; # Works for perl 5.005 or better while ( $rec = ) { if ( $rec =~ /some clever regex to extract and save the (country_code)/ ) { $index{ tell( ) } = $1; } else { $index{ tell( ) } = 'zzzz'; # Force these to be last } } unless ( seek(FILE,0,0) ) { die "Couldn't rewind the file"; } for $idx ( sort { $index{$a} cmp $index{$b} || $a <=> $b } keys %index ) { unless ( seek( FILE,$idx,0 ) ) { die "Couldn't seek to position $idx"; } $record = ; # do whatever to record and then print it out } Note: when I set the input record seperator ( $/ = \1300 ), I am telling the read operator to read 1300 bytes. This is a new feature of perl 5.005. If you are running earlier versions of perl, you will need to use sysread instead. This code is *untested* and is offered as is, I am not responsible if it causes global warming or anything else, blah blah blah blah blah. HTH, Mik -- Mik Firestone fireston@lexmark.com When I become an Evil Overlord: My Legions of Terror will be trained in basic marksmanship. Any who cannot learn to hit a man-sized target at 10 meters will be used for target practice. From ken.rietz at asbury.edu Wed Dec 15 11:55:15 1999 From: ken.rietz at asbury.edu (Rietz, Ken) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: RE: Sorting Big Files Message-ID: > Hello, List! > > Does anyone have a smooth way of sorting large text files? (By > "large" I mean "in excess of 1GB" and by "text files" I mean "flat > ASCII database files.") > > Here's the task: I have a text database of a million or so records. > Each record is about 1300 bytes long. I need to change record > format from fixed-field to delimited, sort the records in > country name > order, then output in 10,000 record pieces to sequentially numbered > text files. I already have routines to change format and output the > file in pieces; it's the sorting part that has me wondering. > > Any suggestions are much appreciated. Here's my suggestion, similar to many others, but guaranteed to be linear time: 1. Read each record, and append it (or some key to the record) to a file whose name is the name of the country. (Create the file if it doesn't exist already and that sort of jazz.) 2. Sort the filenames. 3. Print out your records from the filename-ordered files. As long as you don't require any order within countries, this is about as easy as anything I could come up with. Even if you do, you can operate within a country by applying the same operation to each file. From llang at baywestpaper.com Wed Dec 15 12:38:25 1999 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: RE: Sorting Big Files Message-ID: Hey, that's not half bad. You're not as... (Never mind - I keep forgetting that you have easy access to most of the dirt on me. :-} ) -- 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 Here's my suggestion, similar to many others, but guaranteed to be linear time: 1. Read each record, and append it (or some key to the record) to a file whose name is the name of the country. (Create the file if it doesn't exist already and that sort of jazz.) 2. Sort the filenames. 3. Print out your records from the filename-ordered files. As long as you don't require any order within countries, this is about as easy as anything I could come up with. Even if you do, you can operate within a country by applying the same operation to each file. From hempy at ket.org Wed Dec 15 14:10:07 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Changing drives in Windows? In-Reply-To: Message-ID: <4.1.19991215150323.03c74a30@mail.ket.org> Okay, surely this is a no-brainer, but I'm stumped. Let's say I run a perl program while in C:\. It needs to access some files on different drives. I tried: chdir "D:\db"; This did not change the program's cd to D:. I assume it acts like cd from the command line, which changes D:'s cd, but leaves you on C: . (or where ever you are.) No mention of it did I find in _Learning Perl on Win32 Systems_ nor on Active State's installed perl docs. `PPM search Win32` yielded nothing useful. Experiments like: `d:`; proved fruitless. I suspect if this line did work, it was only during the shell and reverted back when the program resumed. I guess I could give absolute references to all my file accesses, but that's a drag. Any suggestions? -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From Richard.Walker at west-server.com Wed Dec 15 15:07:25 1999 From: Richard.Walker at west-server.com (Richard Walker) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Changing drives in Windows? References: <4.1.19991215150323.03c74a30@mail.ket.org> Message-ID: <3858030D.98C16D08@west-server.com> David Hempy wrote: > > Okay, surely this is a no-brainer, but I'm stumped. Let's say I run a perl > program while in C:\. It needs to access some files on different drives. > I tried: > > chdir "D:\db"; try chdir "d:\\db"; > > This did not change the program's cd to D:. I assume it acts like cd from > the command line, which changes D:'s cd, but leaves you on C: . (or where > ever you are.) > > No mention of it did I find in _Learning Perl on Win32 Systems_ nor on > Active State's installed perl docs. `PPM search Win32` yielded nothing > useful. Experiments like: > > `d:`; > > proved fruitless. I suspect if this line did work, it was only during the > shell and reverted back when the program resumed. > > I guess I could give absolute references to all my file accesses, but > that's a drag. > > Any suggestions? > -dave > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television From llang at baywestpaper.com Wed Dec 15 15:05:47 1999 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Changing drives in Windows? Message-ID: I tend to stick with absolute file references for just about everything. Use one or more variables to store the path and you only have to change it/them in one place if the file in question ever needs to relocate. This doesn't answer your original question, but it does circumvent it. 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 David Hempy To: lexington-pm-list@happyfunball.pm.org Sent by: cc: owner-lexington-pm-l Subject: LPM: Changing drives in Windows? ist@pm.org 12/15/99 03:10 PM Please respond to lexington-pm-list Okay, surely this is a no-brainer, but I'm stumped. Let's say I run a perl program while in C:\. It needs to access some files on different drives. I tried: chdir "D:\db"; This did not change the program's cd to D:. I assume it acts like cd from the command line, which changes D:'s cd, but leaves you on C: . (or where ever you are.) No mention of it did I find in _Learning Perl on Win32 Systems_ nor on Active State's installed perl docs. `PPM search Win32` yielded nothing useful. Experiments like: `d:`; proved fruitless. I suspect if this line did work, it was only during the shell and reverted back when the program resumed. I guess I could give absolute references to all my file accesses, but that's a drag. Any suggestions? -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From hempy at ket.org Wed Dec 15 15:25:14 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Changing drives in Windows? In-Reply-To: <3858030D.98C16D08@west-server.com> References: <4.1.19991215150323.03c74a30@mail.ket.org> Message-ID: <4.1.19991215162335.03c99110@mail.ket.org> At 04:07 PM 12/15/1999 -0500, you wrote: >David Hempy wrote: >> I tried: >> >> chdir "D:\db"; > >try >chdir "d:\\db"; Hey...whaddya know? You think they'd mention that in the chdir docs, huh? ;-) Thanks for pointing out my blunder so politely, -dave (paying attention now) hempy -- David Hempy Internet Database Administrator Kentucky Educational Television From fprice at mis.net Wed Dec 15 17:57:43 1999 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: MakeMaker and version numbers In-Reply-To: <3857AE5F.EA8DFAA4@rcbowen.com> Message-ID: On Wed, 15 Dec 1999, Rich Bowen wrote: #> On Monday, someone asked what the limitations were on the version #> numbers used when setting $VERSION in a module. I was tinkering with #> that this morning, and observed the following. When I set $VERSION to Here's what I was trying vainly to remember at the meeting. The perlmodlib documentation says this: To be fully compatible with the Exporter and MakeMaker modules you should store your module's version number in a non-my package variable called $VERSION. This should be a floating point number with at least two digits after the decimal (i.e., hundredths, e.g, $VERSION = "0.01"). Don't use a "1.3.2" style version. See Exporter.pm in Perl5.001m or later for details. Although your $VERSION='string' is neat, my guess is that other things will break. For instance, 'use Mymod 1.3' might not be predictable if you used a string in the module :-) -Frank. From rbowen at rcbowen.com Wed Dec 15 22:05:34 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: MakeMaker Message-ID: <3858650E.D89E02E1@rcbowen.com> By the way, I've been playing with MakeMaker today and last night. I've discovered that it is also a really handy way to build distributions of files - not necessarily Perl modules, just files. all you have to have is a MANIFEST that lists everything, and a Makefile.PL that gives the NAME and where to get the VERSION_FROM, and when you make dist, it builds a nice tar.gz file with the version number in the name. It's enormously handy. Now I have no more excuses for putting off sending intermediate releases to customers. "Well, I would, but I don't have time to build a tar file for you of all the stuff ..." As long as you keep MANIFEST up to date, you can just do 'perl Makefile.PL' and 'make dist' and you have a release in about 20 seconds. I've started using it to make nightly "builds" so that I can always go back to a previous day's version. It also makes it really important to keep a good Changes file. MANIFEST looks like: ----BEGIN FILE--------------- MANIFEST CHANGES foo.pl bar.html baz.cgi gromitz.c docs/lalala.doc -----END FILE---------------- And Makefile.PL looks like: -----BEGIN FILE------------- use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'name_of_project', 'VERSION_FROM' => 'foo.pl', # Contains $VERSION somewhere ); ------END FILE--------------- Then, when you want to make a distribution, you just type: rm Makefile perl Makefile.PL make dist And, viola, you have a file called name_of_project-version.tar.gz, containing whatever files were listed in MANIFEST. 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 Dec 20 19:11:01 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: DBD-ODBC on Win32? In-Reply-To: References: Message-ID: <4.1.19991220194200.03963320@mail.ket.org> Hi, all! I am accessing a Visual FoxPro database from a perl script with the DBD-ODBC DBI module. All was going well, accessing and updating info from my tables, ...until the errors started. I'm not going to bog you all down with a complicated description of what happens, but rather ask if anyone has any experience using the DBD-ODBC module with DBI on Win32? There are several modules that claim to be ODBC for Win32 specifically. My next step is to try some of these instead and see if they work any better, but thought I would tap into the collective's experience first. I would really like to stick with DBI, but don't really *have* to. I suspect I'm doing something wrong in my program, but wouldn't be surprised if NT or VFP's ODBC driver does something fishy that messes with a non-Win32 ODBC perl module. Any advice or pointers to good references? -dave ps. I don't want to turn this into a "Fix my problem" whinery, but for the morbidly curious, some of the poop follows. I can post the program if anyone has a driving need to get their hands dirty. I am now consistently getting "Error: Runtime exception" for some records during a fetchrow_array(). Other records succeed on this part, but fail later in the same subroutine on a prepare(). Other records get through the whole thing successfully. Occasionally, I get Dr.Watson imposing himself on the command window. At one point, I got the following error, but haven't been able to recreate it lately...it might have been from a now extinct bug in my code: DBD::ODBC::db do failed: [Microsoft][ODBC Visual FoxPro Driver]Syntax error. (SQL-37000)(DBD: st_prepare/SQLPrepare err=-1) at scout.pl line 151. The data is virtually identical and entirely program generated. I am quite certain it is not a data problem. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From rbowen at rcbowen.com Mon Dec 20 20:14:01 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: DBD-ODBC on Win32? References: <4.1.19991220194200.03963320@mail.ket.org> Message-ID: <385EE269.820D7919@rcbowen.com> I've done quite a lot of DBD::ODBC stuff, and have never seen a Dr Watson crash before. Seems to be that if you're getting that sort of crash, you've found a bug in either DBD::ODBC or in the ODBC drivers. It's rather uncommon for Perl code to cause an actual crash. Can you narrow things down to one statement that consistently fails? DBD::ODBC is Win32 specific, I think. At least if you get it from ActiveState, one would think that it is safe. I've used it on Win32 under MS SQL server and Access, mainly. I've never used it on anything non-Win32. I've also used Win32::ODBC, but switched in order to be more portable. Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From shelda at ibm.net Mon Dec 20 22:07:21 1999 From: shelda at ibm.net (Wesley) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: DBD-ODBC on Win32? References: <4.1.19991220194200.03963320@mail.ket.org> <385EE269.820D7919@rcbowen.com> Message-ID: <385EFCF9.B56E8000@ibm.net> Rich Bowen wrote: > > I've done quite a lot of DBD::ODBC stuff, and have never seen a Dr > Watson crash before. Seems to be that if you're getting that sort of > crash, you've found a bug in either DBD::ODBC or in the ODBC drivers. > It's rather uncommon for Perl code to cause an actual crash. With that in mind, possible fixes might include getting the latest DBD::ODBC if you haven't already, updating or switching your ODBC drivers, playing with the DSN settings if you're using a DSN, playing with the parameters to DBI's connect method, or even with the ODBC registry settings. Also, lots of perl stuff seems to work better under NT than '95, so you might try it from NT if you're not already. -- Wes shelda@ibm.net -- THIS SPACE INTENTIONALLY LEFT BLANK -- From sungo at brocksplace.com Tue Dec 21 01:01:05 1999 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regexp question In-Reply-To: <385EFCF9.B56E8000@ibm.net> Message-ID: all righty then. what i'm trying to do is to determine if the words "is" and "are" are one of the first five words in a sentence. the code i'm using now looks like this: (yes, its ugly and newbie-ish) my ($stu_foo,$stu_blah,@stu_search,@stu_refs,$stu_term); $stu_term = $orig_Y; @stu_search = ('is','are'); $theMsg =~ /(\w*)\s*(\w*)\s*(\w*)\s*(\w*)\s*(\w*).*?/; @stu_refs = ($1,$2,$3,$4,$5); foreach $stu_blah (@stu_refs) { foreach $stu_foo (@stu_search) { if ($stu_blah =~ /\b$stu_foo\b/ or $stu_blah =~ /\b$stu_term\b/) { $theMsg = " $who: $theMsg"; goto OUT; } } } OUT: anyway, is there a better way to do this? this seems awfully hackish to me... thanks for your help all... --------------------- Matt Cashner sungo@earthling.net --------------------- "In the battle between you and the world, bet on the world." From llang at baywestpaper.com Tue Dec 21 07:26:47 1999 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regexp question Message-ID: The following works for what you're trying to do, but it assumes (maybe wrongly) that the words in your sentence are only separated by single spaces. I guess you could remove multiple spaces easily enough before running it through. #====================================== $sent="This is a test of the first five words."; @s=split(/ /,$sent); pop(@s) while (@s>5); if (join(" ",@s) =~ /\bis|are\b/) { print "Do stuff here..."; } #====================================== 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 all righty then. what i'm trying to do is to determine if the words "is" and "are" are one of the first five words in a sentence. the code i'm using now looks like this: (yes, its ugly and newbie-ish) my ($stu_foo,$stu_blah,@stu_search,@stu_refs,$stu_term); $stu_term = $orig_Y; @stu_search = ('is','are'); $theMsg =~ /(\w*)\s*(\w*)\s*(\w*)\s*(\w*)\s*(\w*).*?/; @stu_refs = ($1,$2,$3,$4,$5); foreach $stu_blah (@stu_refs) { foreach $stu_foo (@stu_search) { if ($stu_blah =~ /\b$stu_foo\b/ or $stu_blah =~ /\b$stu_term\b/) { $theMsg = " $who: $theMsg"; goto OUT; } } } OUT: anyway, is there a better way to do this? this seems awfully hackish to me... thanks for your help all... --------------------- Matt Cashner sungo@earthling.net --------------------- "In the battle between you and the world, bet on the world." From rbowen at rcbowen.com Tue Dec 21 07:33:27 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regexp question References: Message-ID: <385F81A7.9C439597@rcbowen.com> Matt Cashner wrote: > > all righty then. what i'm trying to do is to determine if the words > "is" and "are" are one of the first five words in a sentence. the code > i'm using now looks like this: (yes, its ugly and newbie-ish) This looks fun! > my ($stu_foo,$stu_blah,@stu_search,@stu_refs,$stu_term); > $stu_term = $orig_Y; > @stu_search = ('is','are'); > $theMsg =~ /(\w*)\s*(\w*)\s*(\w*)\s*(\w*)\s*(\w*).*?/; > @stu_refs = ($1,$2,$3,$4,$5); > foreach $stu_blah (@stu_refs) { > foreach $stu_foo (@stu_search) { > if ($stu_blah =~ /\b$stu_foo\b/ or $stu_blah =~ /\b$stu_term\b/) { > $theMsg = " $who: $theMsg"; > goto OUT; > } > } > } > OUT: > > anyway, is there a better way to do this? this seems awfully hackish to > me... thanks for your help all... My suggestion would be some variation on ... @stu_search = qw(is are); %words = map {$_=>1} (split (/\s+/, $theMsg, 5); for (@stu_search) { $match=1 if $words{$_} } 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 Dec 21 07:57:28 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regexp question References: Message-ID: <385F8748.2D36D757@rcbowen.com> llang@baywestpaper.com wrote: > > The following works for what you're trying to do, but it assumes (maybe > wrongly) that the words in your sentence are only separated by single > spaces. I guess you could remove multiple spaces easily enough before > running it through. > > #====================================== > $sent="This is a test of the first five words."; > @s=split(/ /,$sent); > pop(@s) while (@s>5); Could potentially take a VERY long time. What if $sent is the complete works of Shakespeare? Better to unshift for (1..5), I would think. Or join @s[0..4] > if (join(" ",@s) =~ /\bis|are\b/) { > print "Do stuff here..."; > } Hmm. So combining yours and mine ... if ( join " " (split (/\s+/, $sent, 5) ) ) =~ /\bis|are\b) { print "Do stuff here ... "; } :-) Rich -- http://www.ApacheUnleashed.com/ Lexington Perl Mongers - http://lexington.pm.org/ PGP Key - http://www.rcbowen.com/pgp.txt From llang at baywestpaper.com Tue Dec 21 08:54:06 1999 From: llang at baywestpaper.com (llang@baywestpaper.com) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regexp question Message-ID: llang@baywestpaper.com wrote: > #====================================== > $sent="This is a test of the first five words."; > @s=split(/ /,$sent); > pop(@s) while (@s>5); Could potentially take a VERY long time. What if $sent is the complete works of Shakespeare? Better to unshift for (1..5), I would think. Or join @s[0..4] > if (join(" ",@s) =~ /\bis|are\b/) { > print "Do stuff here..."; > } Hmm. So combining yours and mine ... if ( join " " (split (/\s+/, $sent, 5) ) ) =~ /\bis|are\b) { print "Do stuff here ... "; } :-) I've been playing with the numeric as the third argument to split because I've never seen it before. My book has no mention of it. (Guess I need a bigger book ;-) ) $sent="This is a test of the first five words."; @s=split(/ /,$sent,5); foreach (@s) {print;print"\n";} yields This is a test of the first five words. The fifth element has everything from that point on. (Might be a Win32-ism versus other platforms, but I can't see why...) So it should be pretty quick to change it to 6 and pop the last one off, no matter what the size of $sent. Or am I shootin' blanks? Loren From rbowen at rcbowen.com Tue Dec 21 09:35:24 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: regexp question References: Message-ID: <385F9E3C.A8C76DC5@rcbowen.com> llang@baywestpaper.com wrote: > ... > I've been playing with the numeric as the third argument to split because > I've never seen it before. My book has no mention of it. (Guess I need a > bigger book ;-) ) > > $sent="This is a test of the first five words."; > @s=split(/ /,$sent,5); > foreach (@s) {print;print"\n";} > > yields > > This > is > a > test > of the first five words. > > The fifth element has everything from that point on. (Might be a Win32-ism > versus other platforms, but I can't see why...) > So it should be pretty quick to change it to 6 and pop the last one off, no > matter what the size of $sent. Or am I shootin' blanks? Bah. That's what I get for not testing code before I send it out. No, that's right. It should be changed to 6. The argument basically means 'split it into this many pieces'. 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 Dec 21 13:07:55 1999 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Encryption Question Message-ID: <199912212006.PAA24348@sidewinder.fetterprinting.com> Does anyone know of a way to disguise a number so that it can be easily (as in, by eye) undisguised? Here's the scenario: My client assigns membership numbers to each of their customers. These numbers are unique. They can also be used to obtain account information on the web, so they are "secret special" numbers. When I send junk mail to these poor hopeless victims, I need to put some kind of unique record identifier in the mailing address. As the junk mail travels through the postal system, if the mailing address corresponds to one in the USPS National Change of Address database then I'll receive a data file containing my unique identifier + the new address for the unsuccessful escapee. Then I append the membership number to the file and send it back to my client so they can update their database. If the membership number wasn't so damned special, I could just use it and be done. Unfortunately it *is* so damned special, so I'm looking for a way to encode it. I don't want to use too fancy a conversion scheme, just something that can easily be decoded from memory (as in no complicated rules to remember). The membership number is 6-12 digits long. I was thinking of zero- padding in the front to make each one exactly 12 digits, reversing the string, then adding 3 to each digit and mod-ing by 10. (For example, that converts 1234567890 to 321098765433.) It does the trick, but it's graceless. My sense of aesthetics cries out for a more elegant solution. Any ideas? Thanks in advance for your suggestions! Janine "I work with junk mail. This gives me an excuse to go postal." From oneiros at dcr.net Tue Dec 21 14:47:18 1999 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Encryption Question In-Reply-To: <199912212006.PAA24348@sidewinder.fetterprinting.com> Message-ID: On Tue, 21 Dec 1999, Janine Ladick wrote: > Does anyone know of a way to disguise a number so that it can be > easily (as in, by eye) undisguised? Here's the scenario: What qualifies as 'by eye undisquised'? If you're looking for something that people can do in their head, your system works. You can also do more obnoxious patterns, such as shifting all odd numbers up 4, all even numbers down 4, so that: 0123456789 becomes 6587092143 (naturally, with anything passing 0/10 re-entering at the other side.) You can also use the 'code wheel' approach, where you assign every number any unique arbitrary number, which you can handle quite easily by keping the 'code wheel', as some random array. eg. @values = ( 2,7,0,1,4,3,8,6,9,5 ); (you'll of course want to build either a hash or an array from that for looking everything up for decoding, as there's no equivalent of 'member()' from C in Perl that I know of.) If you need something that doesn't have to be so easy to decode in one's head, you can also place the number into some other base, and manipulate it. So it's a short code, you can use base 35, using alpha-numeric, but omitting O, so people don't have a problem with 0/O confusion, i.e: (0..9,A..N,P..Z) Depending on the font, you might also want to beware of G/6 and 1/I confusion. (You can also be lazy, and just use hexidecimal, if you wish) ----- Joe Hourcle From janine.ladick at fetterprinting.com Tue Dec 21 13:50:23 1999 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Encryption Question In-Reply-To: References: <199912212006.PAA24348@sidewinder.fetterprinting.com> Message-ID: <199912212049.PAA27050@sidewinder.fetterprinting.com> > What qualifies as 'by eye undisquised'? A customer service representative can decode it without calling me on the phone or sending me an email! Janine P.S. Thanks for the suggestions. :-) From fprice at mis.net Tue Dec 21 18:05:18 1999 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Encryption Question In-Reply-To: <199912212049.PAA27050@sidewinder.fetterprinting.com> Message-ID: On Tue, 21 Dec 1999, Janine Ladick wrote: # > What qualifies as 'by eye undisquised'? # # A customer service representative can decode it without calling me # on the phone or sending me an email! Do you really need a CSR to be able to do it by "hand"? This seems fraught with peril :-) If you had a secure web server, and the CSRs had web access, then you could have a script which would encrypt this special ID. You start with the special ID, encrypt it, add to mailing label. If it comes back, you send to CSR. CSR gets enters encrypted number into secure web form which returns special ID. A problem with this is that it requires an algorithm that can go from plaintext -> ciphertext -> plaintext, so you can't use something like the Unix crypt method. But maybe that's not such a big deal... -Frank. ____ ____ Frank Price fprice@mis.net Linux: the choice of a GNU generation -|- Why not go mad? From janine.ladick at fetterprinting.com Wed Dec 22 08:15:18 1999 From: janine.ladick at fetterprinting.com (Janine Ladick) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Encryption Question In-Reply-To: References: <199912212049.PAA27050@sidewinder.fetterprinting.com> Message-ID: <199912221514.KAA15090@sidewinder.fetterprinting.com> > Do you really need a CSR to be able to do it by "hand"? This seems > fraught with peril :-) Isn't not an SSN or anything like that...just a frequent flyer account number. :-) By hand is not as perilous as one might think. > If you had a secure web server, and the CSRs had web access, then you > could have a script which would encrypt this special ID. You start with the > special ID, encrypt it, add to mailing label. If it comes back, you > send to CSR. CSR gets enters encrypted number into secure web form > which returns special ID. That would be cool, but things are so tight around here I can't even get to my email from outside the building - and I'm management, for crying out loud! I do like the idea of a conversion program. If Beth (the CSR) needed to research on more than a few mailers then decoding by hand would be cumbersome. Hmm...sounds like a holiday project to me. Thanks! Janine From hempy at ket.org Wed Dec 22 13:30:16 1999 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: My first Panic! In-Reply-To: <4.1.19991220194200.03963320@mail.ket.org> References: Message-ID: <4.1.19991222142448.0363f9b0@mail.ket.org> Got my first panic error today, which _Programming_Perl_ describes as "An internal error (panic) that you should never see..." Got it during sth->execute(): D:\src>testdbd.pl images.txt 199911/images/blank.gif: 1x1 - 43 || 1x1 - 695 ... update_database 199911/images/blank.gif... 1x1 (43) -- th: 1x1 (695)... New record (update failed)...try insert: $dbh->prepare("select max(imageid) from image") $id_sth->execute()... panic: DBI active kids (1) > kids (0) at D:\src\testdbd.pl line 44, <> chunk 1. D:\src> Cool, huh? ;-) I've stripped down my program to nothing but my update_database() which is straight out of the DBI sample programs...still getting any of four or five serious runtime errors, depending on which way the wind is blowing. Today I'm going to replace the DBI code with Win32:ODBC. I'll let you know if it behaves any differently. At this point, I have a hunch it is the VFP ODBC driver...but I'll hold off any judgement. -dave -- David Hempy Internet Database Administrator Kentucky Educational Television From fprice at mis.net Wed Dec 22 17:09:14 1999 From: fprice at mis.net (Frank Price) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: Encryption Question In-Reply-To: <199912221514.KAA15090@sidewinder.fetterprinting.com> Message-ID: On Wed, 22 Dec 1999, Janine Ladick wrote: # > Do you really need a CSR to be able to do it by "hand"? This seems # > fraught with peril :-) # # Isn't not an SSN or anything like that...just a frequent flyer account # number. :-) By hand is not as perilous as one might think. The peril I had in mind was that no matter how easy, people will forget the algorithm; and once you've settled on one, it'll be tough to change b/c you have to push it out to everyone. If a goal is to avoid support calls, trying to automate it seems pretty necessary. # > If you had a secure web server, and the CSRs had web access, then you # > could have a script which would encrypt this special ID. You start with the # > special ID, encrypt it, add to mailing label. If it comes back, you # > send to CSR. CSR gets enters encrypted number into secure web form # > which returns special ID. # # That would be cool, but things are so tight around here I can't even # get to my email from outside the building - and I'm management, for # crying out loud! # # I do like the idea of a conversion program. If Beth (the CSR) # needed to research on more than a few mailers then decoding by # hand would be cumbersome. Hmm...sounds like a holiday project to # me. Thanks! And now that I think of it, you can use any algorithm you like as long as it generates a unique string for each unique ID. Probably the easiest way is to generate the string and then put it as the key in a hash, with the value as the ID. Then your decoder just prints the value of the hash given the key. Somewhere around here I have the equivalent of the unix passwd encrypter written in Perl. If you're interested I'll try to dig it up... -Frank. From sungo at brocksplace.com Wed Dec 29 21:40:11 1999 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: NCurses, perl, and win32 In-Reply-To: Message-ID: someone asked last pm about a console interface for perl that would also be win32 complaint. was looking at some win32 ports of gnu stuff and found that a) ncurses is planned to have a win32 port soon. b) gnu's djpp comes with a ncurses-like environment that you might be able to use. i know there's a perl module to make ncurses stuff a lot easier but for the djpp environment you'd have to do it by hand which might be nasty i'm not sure. anyway, thought whoever asked about it (forgive my terrible memory :) might be able to use the info. --------------------- Matt Cashner sungo@earthling.net --------------------- "If we dont take care of the customer, maybe they'll stop bugging us." From mandrews at bit0.com Thu Dec 30 12:15:30 1999 From: mandrews at bit0.com (Mike Andrews) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: NCurses, perl, and win32 In-Reply-To: Message-ID: That'd be me. Good to know, thanks... 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 Wed, 29 Dec 1999, Matt Cashner wrote: > someone asked last pm about a console interface for perl that would also > be win32 complaint. was looking at some win32 ports of gnu stuff and found > that a) ncurses is planned to have a win32 port soon. b) gnu's djpp comes > with a ncurses-like environment that you might be able to use. i know > there's a perl module to make ncurses stuff a lot easier but for the djpp > environment you'd have to do it by hand which might be nasty i'm not sure. > > anyway, thought whoever asked about it (forgive my terrible memory > :) might be able to use the info. > > --------------------- > Matt Cashner > sungo@earthling.net > --------------------- > > "If we dont take care of the customer, maybe they'll stop bugging us." > From rbowen at rcbowen.com Fri Dec 31 14:34:42 1999 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: January meeting Message-ID: <386D1362.EC66197@rcbowen.com> Anyone want to talk about something at the next PM meeting? We've mentioned a number of times that it would be nice to have a list of subjects that people would like to hear about. I think that every time that it comes up, I forget to write down anything that gets said. So, if we can possibly have the diuscussion one more time, I'll put the results up on the web site. Some of the things that have been mentined are: OO programming Complex data structures GUIs in Perl (TK, Win32GUI, whatever) XS/SWIG Anything else? 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 Dec 31 17:43:34 1999 From: sungo at brocksplace.com (Matt Cashner) Date: Thu Aug 5 00:06:29 2004 Subject: LPM: January meeting In-Reply-To: <386D1362.EC66197@rcbowen.com> Message-ID: On Fri, 31 Dec 1999, Rich Bowen wrote: > Anyone want to talk about something at the next PM meeting? > > Some of the things that have been mentined are: > > OO programming > Complex data structures > GUIs in Perl (TK, Win32GUI, whatever) > XS/SWIG > i'd love to hear someone talk on OOP or complex data structures. also, i'd also love to hear about the famous Text::Template way of avoiding CGI.pm in lots of gory detail. :) my 2 cents... --------------------- Matt Cashner sungo@earthling.net --------------------- "Never underestimate the power of stupid people in large groups."