From rbowen at rcbowen.com Mon Mar 5 10:25:14 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: This month's meeting Message-ID: <3AA3BDEA.A1FC9549@rcbowen.com> OK, first of all, the meeting is NOT tonight. Every time I send out this reminder, I get a rash of panicked email messages from people that think I'm announcing the meeting for that day. I'm actually not sure where, when, or if, the meeting is going to be this month. If someone wants to suggest a good location, I think that for the most part everyone is sold on the idea of lunchtime on a Friday, but we just don't have anything definite. Anyone know what Shoney's policy is about their "private" room? Anyone had a chance to call the Chamber of Commerce? -- Rich Bowen Come see me at Apachecon! -- http://www.apachecon.com/ From janine at emazing.com Mon Mar 5 12:27:23 2001 From: janine at emazing.com (Janine) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: DBIx::Recordset Message-ID: Has anyone used DBIx::Recordset? If so, what did you think about it? Just wondering, Janine From sungo at qx.net Mon Mar 5 12:44:27 2001 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: DBIx::Recordset In-Reply-To: Message-ID: On Mon, 5 Mar 2001, Janine wrote: > Has anyone used DBIx::Recordset? If so, what did you think about it? no but i'm quite enamored with DBD::RAM these days :) m. From pstackhouse at ket.org Mon Mar 5 13:30:20 2001 From: pstackhouse at ket.org (Paul Stackhouse) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: This month's meeting References: <3AA3BDEA.A1FC9549@rcbowen.com> Message-ID: <3AA3E94C.D3AF0E06@ket.org> The Shoney's on Nicholasville road is notoriously known for double (and even triple) booking their back room. There is no charge for its use; however. -paul Rich Bowen wrote: > > OK, first of all, the meeting is NOT tonight. Every time I send out this > reminder, I get a rash of panicked email messages from people that think > I'm announcing the meeting for that day. > > I'm actually not sure where, when, or if, the meeting is going to be > this month. If someone wants to suggest a good location, I think that > for the most part everyone is sold on the idea of lunchtime on a Friday, > but we just don't have anything definite. > > Anyone know what Shoney's policy is about their "private" room? Anyone > had a chance to call the Chamber of Commerce? > > -- > Rich Bowen > Come see me at Apachecon! -- http://www.apachecon.com/ -- Paul Stackhouse Webmaster Kentucky Educational TV Voice: 859-258-7135 600 Cooper Drive Fax: 859-258-7399 Lexington, KY 40502 http://www.ket.org From hempy at ket.org Wed Mar 7 15:53:31 2001 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Perl DVD Descrambler in 7 lines Message-ID: <5.0.0.25.0.20010307165226.01ff7cf0@mail.ket.org> Descramble That DVD in 7 Lines by Declan McCullagh 9:00 a.m. Mar. 7, 2001 PST CAMBRIDGE, Mass. -- Descrambling DVDs just got even easier, thanks to a pair of MIT programmers. Using only seven lines of Perl code, Keith Winstein and Marc Horowitz have created the shortest-yet method to remove the thin layer of encryption that is designed to prevent people -- including Linux users -- from watching DVDs without proper authorization. Full story: http://wired.com/news/culture/0,1284,42259,00.html -- David Hempy Internet Database Administrator Kentucky Educational Television - Distance Learning Division -- (859)258-7164 -- (800)333-9764 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/lexington-pm/attachments/20010307/3fe4e24f/attachment.htm From janine at emazing.com Tue Mar 13 12:00:45 2001 From: janine at emazing.com (Janine) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Meeting? Message-ID: Was there a meeting last night? If so, how'd it go? Janine From rbowen at rcbowen.com Wed Mar 14 06:01:22 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: [Fwd: damian conway OO perl class in boston] Message-ID: <3AAF5D92.43F4D7B8@rcbowen.com> FYI -------- Original Message -------- Subject: damian conway OO perl class in boston Date: Wed, 14 Mar 2001 00:42:52 -0500 From: Uri Guttman Reply-To: Uri Guttman To: groups@lists.panix.com please forward this to your pm group if you think they will be interested. damian conway is interested in teaching his advanced object oriented class in boston in early july. a description of the class is at: http://www.csse.monash.edu.au/~damian/Courses/AdvancedOO the basic information is that it will be offered on tue/wed july 10-11, 2001. it will be taught at the cambridge marriott which is on the red line (kendall sq). and easily reached by car. continental breakfast and buffet lunch will be included on both days. also a complete set of course notes will be handed out. the price will be around $999 per person. the class size will probably be around 30, so you can expect to have plenty of high quality interaction with the damian. i mentioned this at the pm meeting tonight and several people expressed interest and told me to post more info on it. none of this information is concrete yet. i am producing the class with damian and we want to see enough interest before we make solid committments. so email me if you or anyone else you know would be interested in this. it is a great opportunity to learn OO perl from the master himself. thanx, uri -- Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books The Best Search Engine on the Net ---------- http://www.northernlight.com **Majordomo list services provided by PANIX ** **To Unsubscribe, send "unsubscribe groups" to majordomo@lists.pm.org** From rbowen at rcbowen.com Wed Mar 14 08:37:28 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: This month's meeting? Message-ID: <3AAF8228.DAB36E57@rcbowen.com> Since we missed the usual time for PM meetings, and really have not identified a time and place for our meeting, I was wondering if anyone had any thoughts on having a meeting this month. It would be a shame to let it just drift past. But I've been rather swamped of late. If someone would be willing to take the reins on this and make something happen, I'd be much obliged. -- Rich Bowen Come see me at Apachecon! -- http://www.apachecon.com/ From wsheldahl at qx.net Wed Mar 14 22:58:03 2001 From: wsheldahl at qx.net (Wesley Sheldahl) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: using CPAN behind a firewall In-Reply-To: <3AAF8228.DAB36E57@rcbowen.com>; from rbowen@rcbowen.com on Wed, Mar 14, 2001 at 09:37:28 -0500 References: <3AAF8228.DAB36E57@rcbowen.com> Message-ID: <20010314235803.A8978@fred.qx.net> I just started a contract at Lexmark, and am having trouble getting `perl -MCPAN -e shell` to work from behind their firewall. IE and Netscape work as long as they're pointed to the proxy server, but setting my "http_proxy" and "ftp_proxy" environment variables to the same name, or equiv. IP address, doesn't seem to help CPAN find any of its servers. Any ideas? Anyone know of of a CPAN mirror behind the firewall? (Of course I can use a browser to download modules over the web one at a time and install manually, but that seems last-resortish now...) TIA, -- Wes Sheldahl wsheldahl@qx.net From sungo at qx.net Thu Mar 15 17:41:30 2001 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: using CPAN behind a firewall In-Reply-To: <20010314235803.A8978@fred.qx.net> Message-ID: On Wed, 14 Mar 2001, Wesley Sheldahl wrote: > I just started a contract at Lexmark, and am having trouble getting `perl > -MCPAN -e shell` to work from behind their firewall. IE and Netscape work > as long as they're pointed to the proxy server, but setting my "http_proxy" > and "ftp_proxy" environment variables to the same name, or equiv. IP > address, doesn't seem to help CPAN find any of its servers. Any ideas? > Anyone know of of a CPAN mirror behind the firewall? (Of course I can use > a browser to download modules over the web one at a time and install > manually, but that seems last-resortish now...) tis probably having passive ftp problems OR your ftp proxy is actually doing ftp-over-http (iow, giving your client http as a result of an ftp transaction because it assumes you're a browser [asbury has this problem]). first problem can be solved by telling LWP and Net::FTP that you want passive ftp used. iirc, export PASSIVE_FTP = 1 will do that for you. second problem cant really be fixed. but you can try and find an http accessible cpan mirror (if you cant find one, we can expose ours to the world via http; let me know). my .02$US m. From rbowen at rcbowen.com Thu Mar 15 20:55:02 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: using CPAN behind a firewall References: <3AAF8228.DAB36E57@rcbowen.com> <20010314235803.A8978@fred.qx.net> Message-ID: <3AB18086.C0B83F6E@rcbowen.com> Wesley Sheldahl wrote: > > I just started a contract at Lexmark, and am having trouble getting `perl > -MCPAN -e shell` to work from behind their firewall. IE and Netscape work > as long as they're pointed to the proxy server, but setting my "http_proxy" > and "ftp_proxy" environment variables to the same name, or equiv. IP > address, doesn't seem to help CPAN find any of its servers. Any ideas? > Anyone know of of a CPAN mirror behind the firewall? (Of course I can use > a browser to download modules over the web one at a time and install > manually, but that seems last-resortish now...) My first recommendation would be to set up your own CPAN mirror on your desktop machine. You're running Linux on a machine there, right? CPAN is just over 700MB right now, and if you're a little more selective - leave off the ports directory, for example - can be a lot smaller. Then you have speed and uninhibited access. Although I would be a little suprised if noone else in Lexmark has already done that. Just idle speculation, of course ... -- Rich Bowen Come see me at Apachecon! -- http://www.apachecon.com/ From repett0 at sweb.uky.edu Mon Mar 19 13:12:03 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips Message-ID: anyone have a script to show how to get a visitor ip for netscape and ie? I can't seem to get one for both to work... ron From gcasillo at ket.org Mon Mar 19 13:23:36 2001 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips References: Message-ID: <3AB65CB8.6000904@ket.org> This simple CGI script should do the trick: #!/usr/bin/perl print "Content-type: text/html\n\n"; print "Your IP Address = $ENV{REMOTE_HOST}"; __END__ Gregg Casillo Web Programmer, KET Ronald Edward Petty wrote: > anyone have a script to show how to get a visitor ip for netscape and ie? > I can't seem to get one for both to work... > ron > > > From repett0 at sweb.uky.edu Mon Mar 19 13:38:20 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips In-Reply-To: <3AB65CB8.6000904@ket.org> Message-ID: Any reason why there would be no ip shown? I get Your IP Address = and that is all ron On Mon, 19 Mar 2001, Gregg Casillo wrote: > This simple CGI script should do the trick: > > #!/usr/bin/perl > > print "Content-type: text/html\n\n"; > print "Your IP Address = $ENV{REMOTE_HOST}"; > __END__ > > > Gregg Casillo > Web Programmer, KET > > > Ronald Edward Petty wrote: > > > anyone have a script to show how to get a visitor ip for netscape and ie? > > I can't seem to get one for both to work... > > ron > > > > > > > > From dpitts at mk.net Mon Mar 19 13:38:44 2001 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Re: getting ips References: Message-ID: <00aa01c0b0ac$3656de20$7801a8c0@adverb.com> Your remote (client) ip is passed as an environment variable called REMOTE_ADDR as in the following script: ================================= #!/usr/bin/perl print "Content-Type: Text/HTML\n\n"; print "The remote address is: $ENV{REMOTE_ADDR}"; ================================== To get a list of all your environment variables, try this: ================================== #!/usr/bin/perl print "Content-Type: Text/HTML\n\n"; foreach (sort keys %ENV) { print "$_ has value $ENV{$_}
\n"; } ================================== Thanks, David Pitts http://www.dpitts.com ----- Original Message ----- From: "Ronald Edward Petty" To: Sent: Monday, March 19, 2001 2:12 PM Subject: LPM: getting ips > > anyone have a script to show how to get a visitor ip for netscape and ie? > I can't seem to get one for both to work... > ron > > From dpitts at mk.net Mon Mar 19 13:40:48 2001 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips References: Message-ID: <00b001c0b0ac$7fffade0$7801a8c0@adverb.com> That environment variable is passed as a part of the CGI, if you are running the script from command line you will not get the IP. Thanks, David Pitts http://www.dpitts.com ----- Original Message ----- From: "Ronald Edward Petty" To: Sent: Monday, March 19, 2001 2:38 PM Subject: Re: LPM: getting ips > > Any reason why there would be no ip shown? I get Your IP Address = > > and that is all > ron > > On Mon, 19 Mar 2001, Gregg Casillo wrote: > > > This simple CGI script should do the trick: > > > > #!/usr/bin/perl > > > > print "Content-type: text/html\n\n"; > > print "Your IP Address = $ENV{REMOTE_HOST}"; > > __END__ > > > > > > Gregg Casillo > > Web Programmer, KET > > > > > > Ronald Edward Petty wrote: > > > > > anyone have a script to show how to get a visitor ip for netscape and ie? > > > I can't seem to get one for both to work... > > > ron > > > > > > > > > > > > > > > From sungo at qx.net Mon Mar 19 13:48:06 2001 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips In-Reply-To: Message-ID: On Mon, 19 Mar 2001, Ronald Edward Petty wrote: > anyone have a script to show how to get a visitor ip for netscape and ie? > I can't seem to get one for both to work... *blank stare* From repett0 at sweb.uky.edu Mon Mar 19 13:44:02 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips In-Reply-To: <00b001c0b0ac$7fffade0$7801a8c0@adverb.com> Message-ID: I was running it in a cgi bin... hum On Mon, 19 Mar 2001, David Pitts wrote: > > That environment variable is passed as a part of the CGI, if you are running > the script from command line you will not get the IP. > > Thanks, > > David Pitts > http://www.dpitts.com > > ----- Original Message ----- > From: "Ronald Edward Petty" > To: > Sent: Monday, March 19, 2001 2:38 PM > Subject: Re: LPM: getting ips > > > > > > Any reason why there would be no ip shown? I get Your IP Address = > > > > and that is all > > ron > > > > On Mon, 19 Mar 2001, Gregg Casillo wrote: > > > > > This simple CGI script should do the trick: > > > > > > #!/usr/bin/perl > > > > > > print "Content-type: text/html\n\n"; > > > print "Your IP Address = $ENV{REMOTE_HOST}"; > > > __END__ > > > > > > > > > Gregg Casillo > > > Web Programmer, KET > > > > > > > > > Ronald Edward Petty wrote: > > > > > > > anyone have a script to show how to get a visitor ip for netscape and > ie? > > > > I can't seem to get one for both to work... > > > > ron > > > > > > > > > > > > > > > > > > > > > > > > > From repett0 at sweb.uky.edu Mon Mar 19 13:44:38 2001 From: repett0 at sweb.uky.edu (Ronald Edward Petty) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips In-Reply-To: Message-ID: > *blank stare* Dont make me drop kick you :) Sorry I program...just not in perl...P:) ron From sml at zfx.com Mon Mar 19 14:22:17 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips References: <3AB65CB8.6000904@ket.org> Message-ID: <3AB66A79.9B7B0F8C@zfx.com> depending on the webserver, you may need $ENV{REMOTE_ADDR} instead. best to dump out all of %ENV and pick what you want. Gregg Casillo wrote: > > This simple CGI script should do the trick: > > #!/usr/bin/perl > > print "Content-type: text/html\n\n"; > print "Your IP Address = $ENV{REMOTE_HOST}"; -- Steve Lane From sungo at qx.net Mon Mar 19 14:28:09 2001 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: getting ips In-Reply-To: Message-ID: On Mon, 19 Mar 2001, Ronald Edward Petty wrote: > > *blank stare* > Dont make me drop kick you :) Sorry I program...just not in perl...P:) your sentence didnt make english sense to me, no matter what your programming background. *shrug* m. From gcasillo at ket.org Mon Mar 19 16:20:34 2001 From: gcasillo at ket.org (Gregg Casillo) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: From today's ddate... References: Message-ID: <3AB68632.7030409@ket.org> Today is Pungenday, the 5th day of Discord in the YOLD 3167 Celebrate Mojoday Cool. That's the first time I've ever seen a "Celebrate..." string from running ddate. So...Happy Mojoday everybody! I'll pour myself another cup of coffee now. Sorry. Gregg From dpitts at mk.net Tue Mar 20 08:38:09 2001 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: security problems with formmail.pl Message-ID: <01af01c0b14b$62a025a0$7801a8c0@adverb.com> All, As part of a security list, I received the following concerning Matt Wright's formmail.pl program. Obviously, you want to make sure you are not using formmail.pl, but also, that you are not doing the same thing yourself. ================================================ Formmail.pl Can Be Used As An Open Mail Relay ------------------------------------------------------------------------ SUMMARY The CGI program Formmail.pl lacks adequate security checks and allows spammers to send anonymous e-mail using vulnerable host as mail relays. This vulnerability has already been exploit by spammers in many installations of Formmail.pl. DETAILS Matt Wright's formmail.pl program does a "security check" on the HTTP_REFERER server variable. The security check is usually used to verify that information submitted from a form came from a proper or designated domain. This is usually done to prevent someone from creating a local, malicious form to submit to a script. This can be easily bypassed by passing a raw HTTP request, and faking the HTTP Referrer. This script also allows you to set the recipient's email address in the form. These two factors allow a malicious user to use the formmail.pl program two distribute their email (SPAM). Exploit: A URL such as the following: http://www.example.com/cgi-bin/FormMail.pl? recipient=email@address-to-spam.com&message= Proof%20that%20FormMail.pl%20can%20be%20used%20to%20send%20anonymous%20spam. Will send an anonymous e-mail if the installed FormMail.pl is vulnerable. Workaround: 1. Remove your formmail.pl script until the author provides a fix. or: 2. Hard code the recipient's email address in the formmail.pl program. Do not rely on the address submitted by the user. ADDITIONAL INFORMATION The information has been provided by Michael Palamar. =========================================================== Thanks, David Pitts http://www.dpitts.com From rbowen at rcbowen.com Tue Mar 20 09:13:50 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: security problems with formmail.pl References: <01af01c0b14b$62a025a0$7801a8c0@adverb.com> Message-ID: <3AB773AE.5D0E41D9@rcbowen.com> David Pitts wrote: > > All, > As part of a security list, I received the following concerning Matt > Wright's formmail.pl program. Obviously, you want to make sure you are not > using formmail.pl, but also, that you are not doing the same thing yourself. On CPAN, in the Scripts area, you'll find mailform.pl, which is a replacement for this sort of functionality. It used Mail::Sendmail to send the messages, so it is platform independant. It uses Text::Template to format the email message itself. And it used CGI_Lite for the CGI functionality, whereas formmail does it in the CGI code, and does not do taint checking on stuff. However, it should not be thought that this gets around most of the real security concerns with using a email form in the first place. "Security" by HTTP_REFERER (or any other browser-set ENV variable) is just plain silly, and shows very little understanding of HTTP. "Security" by hidden form variables is just plain silly, and shows very little understanding of HTML, browsers, and web users. "Security" by the advanced technique called "hoping nobody notices" combined with the more advanced technique called "oh, our users would never do that" is just plain silly, and shows insufficient paranoia, and a lack of understanding of the script kiddie mentality. If you put a email form on your web site, people are going to abuse it. Same with guestbooks, discussion forums, and whatever else you care to put on your web site that allows users to participate in creating your content. It's all part of the game. -- Rich Bowen Come see me at Apachecon! -- http://www.apachecon.com/ From sungo at qx.net Tue Mar 20 08:50:28 2001 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: security problems with formmail.pl In-Reply-To: <01af01c0b14b$62a025a0$7801a8c0@adverb.com> Message-ID: On Tue, 20 Mar 2001, David Pitts wrote: > All, > As part of a security list, I received the following concerning Matt > Wright's formmail.pl program. Obviously, you want to make sure you are not > using formmail.pl, but also, that you are not doing the same thing yourself. actually this hole and many others like it have been known for eons in Matt Wright's code. Wright even knows about them, admits them, and refuses to fix them. the real question is: why are you (general you, not anyone in specific) still using Matt Wright's b0rk3n perl4 code? -------- Matt Cashner Web Applications Developer The Creative Group (http://www.cre8tivegroup.com) eek@eekeek.org | Codito, ergo sum From oneiros at dcr.net Tue Mar 20 14:37:27 2001 From: oneiros at dcr.net (Joe Hourcle) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: security problems with formmail.pl In-Reply-To: Message-ID: On Tue, 20 Mar 2001, Matt Cashner wrote: > On Tue, 20 Mar 2001, David Pitts wrote: > > > All, > > As part of a security list, I received the following concerning Matt > > Wright's formmail.pl program. Obviously, you want to make sure you are not > > using formmail.pl, but also, that you are not doing the same thing yourself. > > actually this hole and many others like it have been known for eons in Matt > Wright's code. Wright even knows about them, admits them, and refuses to > fix them. the real question is: why are you (general you, not anyone in > specific) still using Matt Wright's b0rk3n perl4 code? For those not familiar with Matt Wright, he's the one responsible for the infamous 'wwwboard'. [Which coincidentally was the only place I ever saw year 19100.] Interestingly enough, the readme contains the present version information: ############################################################################## # WWWBoard Version 2.0 ALPHA 2.1 # # Copyright 1996 Matt Wright mattw@worldwidemart.com # # Created 10/21/95 Last Modified 11/25/95 # # Security Patches/Bug Fixes: January 07, 2000 # # Scripts Archive at: http://www.worldwidemart.com/scripts/ # ############################################################################## [Hmm...written well before perl5, and the only modification listed was right after y2k...and it's released as _alpha_ code] -Joe From sml at zfx.com Mon Mar 26 09:54:29 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: list combination generator module? Message-ID: <3ABF6635.56F25712@zfx.com> hi, i need a method to generate set/list combinations (i don't know if that's the correct term), like all possible 13-card hands from a 52-card deck. i know about List::Permutor, but i don't think it's appropriate for this problem without modification. does anyone know of a module that can iterate through set/list combinations? -- Steve Lane From hempy at ket.org Wed Mar 28 16:40:58 2001 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Blessed Message-ID: <5.0.0.25.0.20010328173906.0385c798@mail.ket.org> Does "blessed" have one syllable or two? -dave -- David Hempy Internet Database Administrator Kentucky Educational Television - Distance Learning Division -- (859)258-7164 -- (800)333-9764 From janine at emazing.com Wed Mar 28 18:53:55 2001 From: janine at emazing.com (Janine) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: RE: Blessed In-Reply-To: <5.0.0.25.0.20010328173906.0385c798@mail.ket.org> Message-ID: Yes. Janine > -----Original Message----- > From: owner-lexington-pm-list@pm.org > [mailto:owner-lexington-pm-list@pm.org]On Behalf Of David Hempy > Sent: Wednesday, March 28, 2001 5:41 PM > To: Perl Geeks > Subject: LPM: Blessed > > > > Does "blessed" have one syllable or two? > > > -dave > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television - Distance Learning Division > -- (859)258-7164 -- (800)333-9764 > > > From hempy at ket.org Wed Mar 28 21:58:12 2001 From: hempy at ket.org (David Hempy) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? Message-ID: <5.0.0.25.0.20010328224345.01eca7c0@mail.ket.org> I'm delving into using some object oriented approaches in a perl program for the first time. Finding some really neat tricks. It seems that all instance variables (aka class attributes) are key/value pairs in an anonymous hash. This makes it really easy to tote along from function to function all the variables you might possibly need. Also really easy to create new instance variables on the fly...something that should make a C++ programmer absolutely giddy. (or make them shudder...) Anyway, one hitch I've run into is losing the "strict" checking of my variable names. If I spend a bunch of work incrementing $count and then try to print $coutn, perl will fuss at me at compile time. ("use strict" starts every program I write) However, the laid-back approach of hash lookups will happily let me print a useless $this->{coutn} after incrementing $this->{count} a few thousand times. Tracking down typos like that can be a real pain. (And a shuddering C programmer now beams...) Is this just the nature of the beast? Are there other ways to handle instance variables in a class? I fully expect to find the answer ten seconds after I send this message, so wish me luck. -dave ps. I've ordered the OOP book that several in the group have promoted...hope to have this program done before it gets here. -- David Hempy Internet Database Administrator Kentucky Educational Television - Distance Learning Division -- (859)258-7164 -- (800)333-9764 From dpitts at mk.net Wed Mar 28 22:45:16 2001 From: dpitts at mk.net (David Pitts) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Re: Blessed References: <5.0.0.25.0.20010328173906.0385c798@mail.ket.org> Message-ID: <02ce01c0b80b$0d48cdc0$7801a8c0@adverb.com> Blessed is actually two differed words. The distinguishment of the word is found in how it is sounded out as it is spelled the same. First word - Blessed (one syllable) - past tense of bless. (Okay, technically, it is the inflected form of bless, but nobody really cares and I hate the fact that I learned and remember that from college.) example: The Father blessed the congregation. Seconed word - Blessed (two syllables) - adj. held in reference - venerated or hollowed. example: Blessed be the Name of the Lord. The blessed trinity.... The blessed sacrament... The blessed saints... The blessed moose... Thanks, David Pitts http://www.dpitts.com ----- Original Message ----- From: "David Hempy" To: "Perl Geeks" Sent: Wednesday, March 28, 2001 5:40 PM Subject: LPM: Blessed > > Does "blessed" have one syllable or two? > > > -dave > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television - Distance Learning Division > -- (859)258-7164 -- (800)333-9764 > > > From wsheldahl at qx.net Wed Mar 28 23:29:54 2001 From: wsheldahl at qx.net (Wesley Sheldahl) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Blessed In-Reply-To: <5.0.0.25.0.20010328173906.0385c798@mail.ket.org>; from hempy@ket.org on Wed, Mar 28, 2001 at 17:40:58 -0500 References: <5.0.0.25.0.20010328173906.0385c798@mail.ket.org> Message-ID: <20010329002954.E20380@fred.qx.net> I think I've seen the one-syllable version written "bless'd" to make sure no one said two syllables. Then there's also "blest". On 2001.03.28 17:40 David Hempy wrote: > > Does "blessed" have one syllable or two? > > > -dave > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television - Distance Learning Division > -- (859)258-7164 -- (800)333-9764 > > > -- Wes Sheldahl wsheldahl@qx.net From wsheldahl at qx.net Wed Mar 28 23:38:43 2001 From: wsheldahl at qx.net (Wesley Sheldahl) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? In-Reply-To: <5.0.0.25.0.20010328224345.01eca7c0@mail.ket.org>; from hempy@ket.org on Wed, Mar 28, 2001 at 22:58:12 -0500 References: <5.0.0.25.0.20010328224345.01eca7c0@mail.ket.org> Message-ID: <20010329003843.G20380@fred.qx.net> One solution is to use accessor methods to access all your class attributes, and don't allow yourself to access them directly from outside the class. To help with this, name all the instance variables with a leading underscore, so you have $_count. To get its value, print $this->count(), which looks something like sub count { return $_count } The method can do other validation, handle increments, and so forth too. Now calling a non-existent method should cause a speedy and traceable error. AUTOLOAD can make more interesting things happen. Read the Conway OOP book, it spends a fair amount of time on several different approaches to this problem. On 2001.03.28 22:58 David Hempy wrote: > > However, the laid-back approach of hash lookups will happily let me print > a > useless $this->{coutn} after incrementing $this->{count} a few thousand > times. Tracking down typos like that can be a real pain. (And a > shuddering C programmer now beams...) > > Is this just the nature of the beast? Are there other ways to handle > instance variables in a class? I fully expect to find the answer ten > seconds after I send this message, so wish me luck. > > -dave > > > ps. I've ordered the OOP book that several in the group have > promoted...hope to have this program done before it gets here. > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television - Distance Learning Division > -- (859)258-7164 -- (800)333-9764 > > > -- Wes Sheldahl wsheldahl@qx.net From sml at zfx.com Thu Mar 29 07:56:58 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? References: <5.0.0.25.0.20010328224345.01eca7c0@mail.ket.org> <20010329003843.G20380@fred.qx.net> Message-ID: <3AC33F2A.CDFDF3F@zfx.com> here's how i currently do it: my @ATTRS = qw(id name address city state zip); sub AUTOLOAD { use vars qw($AUTOLOAD); no strict 'refs'; my $attr = (split /::/, $AUTOLOAD)[-1]; die "method '$attr' is not AUTOLOADable for object '$_[0]'." unless grep $attr eq $_, @ATTRS; *$AUTOLOAD = sub { my $object = shift; $object->{$attr} = shift if @_; return $object->{$attr}; }; goto &$AUTOLOAD; } this doesn't prevent access through hash subscripts outside of AUTOLOAD, but you could do this with a tie(). agreed on the Conway book! if you're at all interested in this sort of thing, Conway's book is -must- reading. -- Steve Wesley Sheldahl wrote: > > One solution is to use accessor methods to access all your class > attributes, and don't allow yourself to access them directly from outside > the class. To help with this, name all the instance variables with a > leading underscore, so you have $_count. To get its value, print > $this->count(), which looks something like > > sub count { return $_count } > > The method can do other validation, handle increments, and so forth too. > Now calling a non-existent method should cause a speedy and traceable > error. AUTOLOAD can make more interesting things happen. Read the Conway > OOP book, it spends a fair amount of time on several different approaches > to this problem. > > On 2001.03.28 22:58 David Hempy wrote: > > > > > However, the laid-back approach of hash lookups will happily let me print > > a > > useless $this->{coutn} after incrementing $this->{count} a few thousand > > times. Tracking down typos like that can be a real pain. (And a > > shuddering C programmer now beams...) > > > > Is this just the nature of the beast? Are there other ways to handle > > instance variables in a class? I fully expect to find the answer ten > > seconds after I send this message, so wish me luck. > > > > -dave > > > > > > ps. I've ordered the OOP book that several in the group have > > promoted...hope to have this program done before it gets here. > > > > -- > > David Hempy > > Internet Database Administrator > > Kentucky Educational Television - Distance Learning Division > > -- (859)258-7164 -- (800)333-9764 > > > > > > > -- > Wes Sheldahl > wsheldahl@qx.net -- Steve Lane From rbowen at rcbowen.com Thu Mar 29 08:35:46 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? Message-ID: <3AC34842.EC923567@rcbowen.com> Resend - nonmember submission -------- Original Message -------- From: Matt Cashner To: Perl Geeks Subject: Re: LPM: Strict variable checking in classes? On Wed, 28 Mar 2001, David Hempy wrote: > However, the laid-back approach of hash lookups will happily let me print a > useless $this->{coutn} after incrementing $this->{count} a few thousand > times. Tracking down typos like that can be a real pain. (And a > shuddering C programmer now beams...) use vars qw($AUTOLOAD); sub AUTOLOAD { my $self = shift; my ($method, $return); ($method = $AUTOLOAD) = ~s/.*:://; if($self->{$method}) { if(@_) { $self->{$method} = shift; } return $self->{$method}; } else { warn "there is no $method attribute of this object, bingo."; return undef; } } provided i typed that in correctly, that should work for you. if you need an explanation of anything just ask :) and blessed has one syllable in my vernacular :) -------- Matt Cashner Web Applications Developer The Creative Group (http://www.cre8tivegroup.com) eek@eekeek.org | Codito, ergo sum From rbowen at rcbowen.com Thu Mar 29 08:36:37 2001 From: rbowen at rcbowen.com (Rich Bowen) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: RE: Strict variable checking in classes? Message-ID: <3AC34875.D470143F@rcbowen.com> Resend: Non member submission -------- Original Message -------- From: "Braun, Thomas " Subject: RE: Strict variable checking in classes? Date: Wed, 28 Mar 2001 23:23:57 -0500 One trick would be to create accessor methods, and use those. For example: sub count { return $_[0]->{count}; } Trying mymodule->coutn will return an error saying something to the effect of "can't locate method coutn via package mymodule", and you only have to spell it right in the subroutine :-) You can also do nifty things like the following to set and/or return the value (in places where this is desirable) sub count ( my $self = shift; $self->{count} = shift if (scalar(@_)) return $self->{count}; ) Anyone else have better ideas? Tom ps. I'm the giddy C++ programmer, not the shuddering one > -----Original Message----- > From: owner-lexington-pm-list@pm.org > [mailto:owner-lexington-pm-list@pm.org]On Behalf Of David Hempy > Sent: Wednesday, March 28, 2001 10:58 PM > To: Perl Geeks > Subject: LPM: Strict variable checking in classes? > > > > I'm delving into using some object oriented approaches in a > perl program > for the first time. Finding some really neat tricks. > > It seems that all instance variables (aka class attributes) > are key/value > pairs in an anonymous hash. This makes it really easy to > tote along from > function to function all the variables you might possibly need. Also > really easy to create new instance variables on the > fly...something that > should make a C++ programmer absolutely giddy. (or make them > shudder...) > > Anyway, one hitch I've run into is losing the "strict" checking of my > variable names. If I spend a bunch of work incrementing > $count and then > try to print $coutn, perl will fuss at me at compile time. > ("use strict" > starts every program I write) > > However, the laid-back approach of hash lookups will happily > let me print a > useless $this->{coutn} after incrementing $this->{count} a > few thousand > times. Tracking down typos like that can be a real pain. (And a > shuddering C programmer now beams...) > > Is this just the nature of the beast? Are there other ways to handle > instance variables in a class? I fully expect to find the answer ten > seconds after I send this message, so wish me luck. > > -dave > > > ps. I've ordered the OOP book that several in the group have > promoted...hope to have this program done before it gets here. > > -- > David Hempy > Internet Database Administrator > Kentucky Educational Television - Distance Learning Division > -- (859)258-7164 -- (800)333-9764 > > From sml at zfx.com Thu Mar 29 08:47:02 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? References: <3AC34842.EC923567@rcbowen.com> Message-ID: <3AC34AE6.31FD58FA@zfx.com> > Matt Cashner wrote: > if($self->{$method}) { should that be if (exists $self->{$method}) { ? surely you don't want to disallow attributes that have false values? also, > return undef; is always a bad thing to do. if the method is called in list context, a list with one element, undef(), will be returned, which is true in boolean context. a simple "return;" is safer. -- Steve Rich Bowen wrote: > > Resend - nonmember submission > > -------- Original Message -------- > > From: Matt Cashner > To: Perl Geeks > Subject: Re: LPM: Strict variable checking in classes? > > On Wed, 28 Mar 2001, David Hempy wrote: > > > However, the laid-back approach of hash lookups will happily let me print a > > useless $this->{coutn} after incrementing $this->{count} a few thousand > > times. Tracking down typos like that can be a real pain. (And a > > shuddering C programmer now beams...) > > use vars qw($AUTOLOAD); > sub AUTOLOAD { > my $self = shift; > my ($method, $return); > ($method = $AUTOLOAD) = ~s/.*:://; > if($self->{$method}) { > if(@_) { > $self->{$method} = shift; > } > return $self->{$method}; > } else { > warn "there is no $method attribute of this object, bingo."; > return undef; > } > } > > provided i typed that in correctly, that should work for you. if you > need an explanation of anything just ask :) > > and blessed has one syllable in my vernacular :) > > -------- > Matt Cashner > Web Applications Developer > The Creative Group (http://www.cre8tivegroup.com) > eek@eekeek.org | Codito, ergo sum -- Steve Lane From sungo at qx.net Thu Mar 29 09:03:25 2001 From: sungo at qx.net (Matt Cashner) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? In-Reply-To: <3AC34AE6.31FD58FA@zfx.com> Message-ID: On Thu, 29 Mar 2001, Steve Lane wrote: > if (exists $self->{$method}) { exists will always return true on a hash thanks to autovivification. defined is a much better option. m. From sml at zfx.com Thu Mar 29 09:53:00 2001 From: sml at zfx.com (Steve Lane) Date: Thu Aug 5 00:06:03 2004 Subject: LPM: Strict variable checking in classes? References: Message-ID: <3AC35A5C.E5344FDF@zfx.com> Matt Cashner wrote: > > On Thu, 29 Mar 2001, Steve Lane wrote: > > > if (exists $self->{$method}) { > > exists will always return true on a hash thanks to > autovivification. i don't think this is correct: perl -le 'print 1 if exists $self->{key}' [nothing] autovivification doesn't extend to the final subscript. in my example, the only autovivication that happens is that $self becomes an anonymous hashref. perl -le 'print 1 if exists $self->{key}; print $self' HASH(0x804ac1c) of course, if there is more than 1 dimension of subscripting, the subscripts before the final one get autovivified: perl -le 'print 1 if exists $self->{key}{key2}{key3}; print $self; print "EXISTS key" if exists $self->{key}; print "EXISTS key2" if exists $self->{key}{key2}; print "EXISTS key3" if exists $self->{key}{key2}{key3}' HASH(0x804ac1c) EXISTS KEY EXISTS KEY2 > defined is a much better option. $self->{$method} having a value of undef() should not mean that $method is an invalid method. -- Steve Lane