From asimjalis at acm.org Tue Oct 1 03:26:07 2002 From: asimjalis at acm.org (Asim Jalis) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: GUI Wrapper for Command Line Message-ID: <20021001082607.GB42680@wokkil.pair.com> Does anyone know of any freeware or cheap programs for Windows that can wrap around a command line program to make it look like it has a GUI? So for example if the command line program takes two arguments: filemove FROM TO the program would create a simple dialog containing two editboxes labelled FROM and TO, a small area for output, and a "Execute" button. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From bill at celestial.com Tue Oct 1 09:28:34 2002 From: bill at celestial.com (Bill Campbell) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: GUI Wrapper for Command Line In-Reply-To: <20021001082607.GB42680@wokkil.pair.com>; from asimjalis@acm.org on Tue, Oct 01, 2002 at 04:26:07AM -0400 References: <20021001082607.GB42680@wokkil.pair.com> Message-ID: <20021001072834.A18294@barryg.mi.celestial.com> On Tue, Oct 01, 2002 at 04:26:07AM -0400, Asim Jalis wrote: >Does anyone know of any freeware or cheap programs for Windows >that can wrap around a command line program to make it look like >it has a GUI? So for example if the command line program takes >two arguments: > >filemove FROM TO > >the program would create a simple dialog containing two editboxes >labelled FROM and TO, a small area for output, and a "Execute" >button. There have been a number of these over the years of varying degrees of complexity. Perl::Tk is one of the most flexible. Bill -- INTERNET: bill@Celestial.COM Bill Campbell; Celestial Software LLC UUCP: camco!bill PO Box 820; 6641 E. Mercer Way FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676 URL: http://www.celestial.com/ ``Intellectually, teachers fall between education theorists and bright cocker spaniels. (Probably closer to the education theorists. The AKC has been doing wonders with spaniels.) If you think I'm kidding look at the GREs for education majors, whose scores are the lowest of all fields, and remember that these are the smart ones.'' -- http://www.FredOnEverything.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jay at Scherrer.com Tue Oct 1 11:12:38 2002 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: GUI Wrapper for Command Line In-Reply-To: <20021001082607.GB42680@wokkil.pair.com> References: <20021001082607.GB42680@wokkil.pair.com> Message-ID: <200210010912.38868.jay@scherrer.com> Asim, If you have the "Emu" book Learning Perl/Tk page. 237 has exactly what you want. Well almost :-) Jay On Tuesday 01 October 2002 01:26 am, Asim Jalis wrote: > Does anyone know of any freeware or cheap programs for Windows > that can wrap around a command line program to make it look like > it has a GUI? So for example if the command line program takes > two arguments: > > filemove FROM TO > > the program would create a simple dialog containing two editboxes > labelled FROM and TO, a small area for output, and a "Execute" > button. > > Asim > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From alan at ufies.org Tue Oct 1 13:15:48 2002 From: alan at ufies.org (Alan) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: ie and cookies Message-ID: <20021001181548.GE19336@ufies.org> Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. I'm setting a cookie and then doing a redirect as follows: my $c = Apache::Cookie->new( $r, -name => 'userdata', -value => $cookie, -expires => '1d', -path => '/dealers' ); $r->content_type('text/html'); $c->bake; $r->header_out("Refresh"=>"0;url=/dealers$request_uri"); $r->no_cache(1); $r->send_http_header; $r->print( print_refresh_page_content() ); (print_refresh_page_content just returns a string of "authenticated") This works *perfectly* in mozilla linux, galeon, mozilla windows, and ie6 under windows XP. It *doesn't* work on ie 6 under win98, winME, or ie 5.5 run through crossover office. I've played around with the security settings, and even at the lowest setting, with IE set to prompt for any cookies, it won't even acknowledge that I'm trying to set a cookie. Anyone have any ideas/solutions/thoughts? TIA alan -- Alan "Arcterex" -=][=- http://arcterex.net "I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From alan at ufies.org Tue Oct 1 17:10:42 2002 From: alan at ufies.org (Alan) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: ie and cookies (solved) In-Reply-To: <20021001181548.GE19336@ufies.org> References: <20021001181548.GE19336@ufies.org> Message-ID: <20021001221042.GC6272@ufies.org> On Tue, Oct 01, 2002 at 11:15:48AM -0700, Alan wrote: > Hi folks... I'm having a bit of a weird problem with Apache::Cookie and IE. > > I'm setting a cookie and then doing a redirect as follows: > > my $c = Apache::Cookie->new( $r, > -name => 'userdata', > -value => $cookie, > -expires => '1d', > -path => '/dealers' > ); > > $r->content_type('text/html'); > $c->bake; > $r->header_out("Refresh"=>"0;url=/dealers$request_uri"); > $r->no_cache(1); > $r->send_http_header; > $r->print( print_refresh_page_content() ); Turns out the problem was the expires tag... ie wouldn't set the cookie until it was set to '+1d'. Weird. alan -- Alan "Arcterex" -=][=- http://arcterex.net "I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From beckyls at u.washington.edu Tue Oct 1 21:30:18 2002 From: beckyls at u.washington.edu (Rebecca L. Schmidt) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: UW Python Message-ID: Hi all, For those of you interested in Python, I am pleased to announce a new 3-day Python programming course being offered at the UW October 21-23, 2002. We are fortunate to have Mark Lutz, well-known author of multiple O'Reilly Python books as the instructor for this intensive course. Through lectures and laboratory work, students learn the basics of Python programming. Register by calling (206) 543-2310 or 1 (800) 543-2320. For more information, please see: http://www.outreach.washington.edu/extinfo/comp/programming.asp#python Please feel free to contact Diana Wu, Program Manager, with any questions. Her email address is: dwu@ese.washington.edu. Best regards, Rebecca Schmidt Academic Programs University of Washington Extension - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From glyph at mac.com Thu Oct 3 20:07:12 2002 From: glyph at mac.com (Geoffrey & Kristin Grosenbach) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Got Job! Message-ID: <9D65E300-D735-11D6-AE15-0050E4C54C7E@mac.com> I'm now into my third day at a new job working exclusively with Perl and Linux! The pay is lousy, but I'm having a lot of fun and am working on some great projects, however disorderly they may be. Before this I thought everyone was deluded when they talked about massive, unreadable spaghetti Perl projects, but now I'm working in one! Seriously, most of the people there learned Perl while writing these projects, so hopefully I can use some of my software design experience to re-design their modules and save myself and my co-workers a lot of work (laziness...impatience...hubris...). Thanks to everyone on this list for the ideas you toss around here! It's helped me improve my Perl a lot. Geoff p.s. Hopefully I haven't ticked off any co-workers who might be reading this list (and recognize me), but even so, they're a great bunch and I think we'll have a lot of fun. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tleffler at u.washington.edu Tue Oct 8 19:26:08 2002 From: tleffler at u.washington.edu (Trevor Leffler) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Runtime binding, drivers Message-ID: <3DA377A0.6080007@u.washington.edu> Hi all, I've been researching the implementation of "drivers" in Perl, and am looking for some feedback from somebody, anybody. My motivation is from working with a FileSystem object that lets me do basic file manipulation on a filesystem (list, put, move, copy, delete, etc.). There are however, several kinds of filesystems that I might want to have an implementation for: local, remote (afs, nfs, samba...), virtual, etc. So a couple things come to mind: DBI, and Java's interface/implementation class support. DBI does all kinds of magic: outer and inner objects via tie, XS code, lots of sub-classing and run-time loading and binding of classes. I don't claim to understand all that goes on under the hood, but the framework is interesting and I wonder about its potential use as a generic object/driver mechanism for all sorts of other objects. I also wonder what kinds of beneficial features it provides to driver implementers. Java's support appears more straightforward, and is easily replicated in Perl. Once class is the interface, which itemizes method signatures, creates constants, and provides documentation. It's small, contains no real code, and is easy to pass around to implementation developers. A second class actually implements the interface. The compiler enforces the contract, and the developer just hacks out the necessary code. (Interfaces are also Java's tool for multiple inheritance and call-backs.) Perl can do all that. Well, it doesn't natively enforce API contracts, but that's part of its flexibility--we *could* enforce them if we wanted to. In addition to my wondering about DBI (above), I am curious about your thoughts and experiences related to the "one interface (DBI), many implementations (DBD::*)" concept, specifically relating to Perl. Are there any best practices? Any existing modules that lend themselves to this? Is this an attempt to make Perl look like other languages, or does this architecture have benefits (I think it does)? Are there other ways to think about this problem? I look forward to your comments. Thanks, -- Trevor Leffler, Software Developer PETTT / Ed-Tech Development Group Educational Partnerships & Learning Technologies University of Washington (206) 616-3406 / OUGL 230, Box 353080 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jonathan.souza at usg.sms.siemens.com Wed Oct 9 16:25:39 2002 From: jonathan.souza at usg.sms.siemens.com (Souza Jonathan) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Win32::Process Message-ID: I want to be able to open a process on another machine as if that program was run on that machine. So assuming that I had permission to do so and used Win32::AdminMisc::LogonAsUser, and then ran an .exe using Win32::Process::Create($Process,$Program, $CommandLine, $Inherit, $Flags, $Directory); $Directory set to the remote machine, would this actually use the remote machine's processor and be independent of my local machine? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20021009/6b4548a8/attachment.htm From souzajonathan at hotmail.com Wed Oct 9 16:51:28 2002 From: souzajonathan at hotmail.com (Jonathan Souza) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Remote process creation Message-ID: I want to be able to open a process on another machine as if that program was run on that machine. So assuming that I had permission to do so and used Win32::AdminMisc::LogonAsUser, and then ran an .exe using Win32::Process::Create($Process,$Program, $CommandLine, $Inherit, $Flags, $Directory); $Directory set to the remote machine, would this actually use the remote machine's processor and be independent of my local machine? or is it even simplier, by just changing to the working directory of the remote machine and using "system( some.exe )" after copying the file there? _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cwilkes-spug at ladro.com Wed Oct 9 17:34:37 2002 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Remote process creation In-Reply-To: References: Message-ID: <20021009223436.GA56037@www.ladro.com> On Wed, Oct 09, 2002 at 02:51:28PM -0700, Jonathan Souza wrote: > > Win32::Process::Create($Process,$Program, $CommandLine, $Inherit, $Flags, > $Directory); > > $Directory set to the remote machine, would this actually use the remote > machine's processor and be independent of my local machine? > > or is it even simplier, by just changing to the working directory of the > remote machine and using "system( some.exe )" after copying the file there? What you're doing in this case is telling perl to run on your own machine and use the files on a network share. Its not going to use the remote machine's CPU to do this. I'm not sure if there is a Perl module for Win32 to run a process on a remote machine but you can look into doing something along the lines of: 1) installing sshd on the remote machine, ssh into it and then run the program (no idea about this working in a Windows world) 2) have a perl program constantly running on the remote machine that looks for files in that directory and then springs to life when it sees it 3) setting up a crontab (I think that's an "at" job) on the remote machine to run the program periodically 4) same as #2 but send the program some sort of signal (ie telnet to a port on the box and enter in the magic word) to cause it to run 5) see if there is some sort of WinNT tools that allow you to run commands on a remote machine, like rsh. Chris - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From andrew at sweger.net Wed Oct 9 22:50:09 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: TPF interview w/ Tim Maher Message-ID: The Perl Foundation has posted their interview with White Camel winner Tim Maher. http://perlfoundation.org/index.cgi?page=tpf-newsletter-0902 -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From alan at ufies.org Thu Oct 10 00:24:17 2002 From: alan at ufies.org (Alan) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: damian's slides? Message-ID: <20021010052417.GC29930@ufies.org> Just wondering if the slides from The Damian's talk were available yet, the ones on time, space, time travel and melding all of it with perl? I'm really interested in how that module of his works you see... :) alan -- Alan "Arcterex" -=][=- http://arcterex.net "I used to herd dairy cows. Now I herd lusers. Apart from the isolation, I think I preferred the cows. They were better conversation, easier to milk, and if they annoyed me enough, I could shoot them and eat them." -Rodger Donaldson - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From mwallend at fastmail.fm Thu Oct 10 00:38:52 2002 From: mwallend at fastmail.fm (Michael Wallendahl) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Win32::Process In-Reply-To: Message-ID: What you want to do is go pick up a copy of Dave Roth's "Win32 Perl Scripting: The Administrators Handbook". Then check out the code for example 9.16. I believe the Example Code From the Book is available for download from Dave's web site at http://www.roth.net/books/handbook/ (on the left hand side). The code uses WMI to create a process on a remote machine. I have this book as well as his other book "Win32 Perl Programming: The Standard Extensions, Second Edition". Both are very good reference books full of good example code. Dave Roth is a godsend for those of us using Perl on Windows systems. I'm glad for his contributions to the Perl Community. -Mike On Wed, 9 Oct 2002, Souza Jonathan wrote: > I want to be able to open a process on another machine as if that program was run on that machine. > > So assuming that I had permission to do so and used Win32::AdminMisc::LogonAsUser, and then ran an .exe using > > Win32::Process::Create($Process,$Program, $CommandLine, $Inherit, $Flags, $Directory); > > $Directory set to the remote machine, would this actually use the remote machine's processor and be independent of my local machine? > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ingy at ttul.org Thu Oct 10 01:20:26 2002 From: ingy at ttul.org (Brian Ingerson) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Runtime binding, drivers In-Reply-To: <3DA377A0.6080007@u.washington.edu>; from tleffler@u.washington.edu on Tue, Oct 08, 2002 at 05:26:08PM -0700 References: <3DA377A0.6080007@u.washington.edu> Message-ID: <20021009232026.B891@ttul.org> On 08/10/02 17:26 -0700, Trevor Leffler wrote: > Hi all, > > I've been researching the implementation of "drivers" in Perl, and am looking What type of drivers are you talking about? You can't do kernel loaded drivers in Perl by definition. Perl is linked with the libc, and those system calls can't be made from kernel code, AFAIK. Cheers, Brian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tleffler at u.washington.edu Thu Oct 10 11:12:43 2002 From: tleffler at u.washington.edu (Trevor Leffler) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Runtime binding, drivers References: <3DA377A0.6080007@u.washington.edu> <20021009232026.B891@ttul.org> Message-ID: <3DA5A6FB.7010009@u.washington.edu> Brian Ingerson wrote: > On 08/10/02 17:26 -0700, Trevor Leffler wrote: > >>Hi all, >> >>I've been researching the implementation of "drivers" in Perl, and am looking > > > What type of drivers are you talking about? You can't do kernel loaded > drivers in Perl by definition. Perl is linked with the libc, and those system > calls can't be made from kernel code, AFAIK. > > Cheers, Brian I am not talking about hardware drivers or other low-level kernel nastiness. Sorry if I scared people off with that terminology! Rather, I'm am interested in DBI/DBD-style drivers. Or perhaps I should call them "implementations conforming to a defined interface." Perhaps some tangible, if silly, code would help show my thoughts. -------- my $dog = new Animal("Animal::Dog"); my $cat = new Animal("Animal::Cat"); $dog->speak("Fork over your bacon!"); # Output: "Woof! Fork over your bacon! Woof!" $cat->speak("Don't rub my fur the wrong way."); # Output: "Meow! Don't rub my fur the wrong way. Meow!" -------- Think about how DBI works here. We ask for two animals, a dog and a cat, both of which conform to the Animal interface (one method, "speak", which takes a string). Our $dog is actually an Animal::Dog object (not an Animal object), which implements the interface in its own special way--it prepends and appends "Woof!" to the passed string. Likewise, our $cat is an Animal::Cat object. The implementation might be in pure Perl, or XS, or whatever. The point, and my queries, are about the architecture that could make this possible. Do I look to DBI as a model (ugh) or are there other models to follow? I keep bringing up DBI only because I'm unaware of other Perl modules that do what it does. BTW, I've already coded something that works, but I'm really interested in some discussion of this topic--your experience with this, pros and cons of model A vs model B, if you have no experience with this then what do you think it *should* do or behave. How would you design it? Thanks, --Trevor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From chris at chriskate.net Thu Oct 10 18:20:36 2002 From: chris at chriskate.net (Chris Sutton) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Runtime binding, drivers In-Reply-To: <3DA5A6FB.7010009@u.washington.edu> Message-ID: I'll throw my 2 cents in on this, at least in how DBI/DBD stuff works and my experiences. At work we run MySQL and Postgresql. No matter how hard you try and make things common to work with both databases, by using the DBI interface, there are aways exceptions in the underlying way the two different databases behave. At some point do you just give up on the "middleware" DBI code and just use the direct "Pg" or "MySQL" perl interfaces, especially if you are not likely to have different databases. As much as people like to say "this complicated code base can work with Postgresql, Oracle, DB2 or whatever, all you have to do us use DBI", there are times when the implementation just doesn't work out and is not the most efficient way to do things. (As an aside, Postgresql and MySQL are way different types of database. Don't let anyone tell you any different). In your Dog/Cat example below, might there be a very special unique type of Cat which can't speak and which would not work with that interface. I guess what I'm getting at is at some point, you need to decide when the "middleware" has gotten more complicated than its worth and you are better off just learning how to bark and meow ;) On Thu, 10 Oct 2002, Trevor Leffler wrote: > Brian Ingerson wrote: > > On 08/10/02 17:26 -0700, Trevor Leffler wrote: > > > >>Hi all, > >> > >>I've been researching the implementation of "drivers" in Perl, and am looking > > > > > > What type of drivers are you talking about? You can't do kernel loaded > > drivers in Perl by definition. Perl is linked with the libc, and those system > > calls can't be made from kernel code, AFAIK. > > > > Cheers, Brian > > I am not talking about hardware drivers or other low-level kernel nastiness. > Sorry if I scared people off with that terminology! Rather, I'm am interested > in DBI/DBD-style drivers. Or perhaps I should call them "implementations > conforming to a defined interface." Perhaps some tangible, if silly, code would > help show my thoughts. > > -------- > my $dog = new Animal("Animal::Dog"); > my $cat = new Animal("Animal::Cat"); > > $dog->speak("Fork over your bacon!"); > # Output: "Woof! Fork over your bacon! Woof!" > > $cat->speak("Don't rub my fur the wrong way."); > # Output: "Meow! Don't rub my fur the wrong way. Meow!" > -------- > > Think about how DBI works here. We ask for two animals, a dog and a cat, both > of which conform to the Animal interface (one method, "speak", which takes a > string). Our $dog is actually an Animal::Dog object (not an Animal object), > which implements the interface in its own special way--it prepends and appends > "Woof!" to the passed string. Likewise, our $cat is an Animal::Cat object. > > The implementation might be in pure Perl, or XS, or whatever. The point, and my > queries, are about the architecture that could make this possible. Do I look to > DBI as a model (ugh) or are there other models to follow? I keep bringing up > DBI only because I'm unaware of other Perl modules that do what it does. > > BTW, I've already coded something that works, but I'm really interested in some > discussion of this topic--your experience with this, pros and cons of model A vs > model B, if you have no experience with this then what do you think it *should* > do or behave. How would you design it? > > Thanks, > --Trevor > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From perlocity at yahoo.com Thu Oct 10 18:27:36 2002 From: perlocity at yahoo.com (Tim Maher) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: FPerl by MJD in Nov.; Discounts to 10/18 Message-ID: <20021010232736.22740.qmail@web13104.mail.yahoo.com> --- Tim Maher wrote: > Date: Thu, 10 Oct 2002 16:22:10 -0700 > From: Tim Maher > To: perlocity@yahoo.com > Subject: Perl by MJD in Nov.; Discounts to 10/18 > MARK-JASON DOMINUS TEACHING IN NOVEMBER > > Yes Perl fans, the rumors are true. In November, you can take > specialized Perl training classes through Consultix from the > ingenious, entertaining, and ever popular Mark-Jason Dominus > ("MJD"), whose top-rated presentations at O'Reilly Perl Conferences, > YAPC conferences, and GeekCruises have won him a large following. > > Here's a list of the individual classes, along with links > to detailed class outlines (that are also provided at > http://teachmeperl.com): > > CLASS NAME DATES DAYS > ---------------------------------------------------------- > "Intermediate Topics in Perl" 11/19-20 2 > DETAILS: http://216.158.52.121/class/about/intermediate/ > > "Tricks of the Wizards" 11/21 .5 > DETAILS: http://216.158.52.121/class/about/tricks/ > > "Regular Expression Mastery" 11/21 .5 > DETAILS: http://216.158.52.121/class/about/regex/ > > "Hands-On Repair Shop and Red Flags" 11/22 1 > DETAILS: http://216.158.52.121/class/about/repair/ > > "Object Oriented Programming" 11/25-27 3 > DETAILS: http://216.158.52.121/class/about/oop/ > > You might recognize some of the class titles shown above from past > Perl conferences, but these November offerings are different in > two respects. First, all but the half-day classes are "Hands-On", > instead of being lecture-only presentations like you get at > conferences. So you'll actually have a chance to apply the new > techniques you learn under Mark's guidance in comprehensive lab > sessions. > > Secondly, because Mark is constantly making substantial upgrades to > his courses to incorporate new concepts and examples, much of the > content will be different from what's been presented at conferences. > > So even those who've seen the conference versions of these classes > can obtain additional benefits from participating in our November > offerings. > > Note that there are discounts for those who register, and pay by > charge card or provide an acceptable Purchase Order, by 5pm Pacific > Time on 10/18. See http://teachmeperl.com/register.html for details. > > The full schedule of our Winter classes is listed below. > > --------------------------------------------------------- > SCHEDULE OF CONSULTIX PUBLIC CLASSES, in Kirkland WA > --------------------------------------------------------- > Courses by Dr. Tim Maher: > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > TITLE DATES Days > Minimal Perl 10/25 1 > Basic OO Perl 10/28-29 2 > Intermediate Pattern Matching 10/30-31 1.5 > > --------------------------------------------------------- > Courses by Mark-Jason Dominus: > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > TITLE DATES Days > Intermediate Topics in Perl 11/19-20 2 > Tricks of the Wizards 11/21 .5 > Regular Expression Mastery 11/21 .5 > Hands-On Program Repair Shop 11/22 1 > and Red Flags > Object Oriented Programming 11/25-27 3 > +--------------------------------------------------------+ > > SCHEDULE POSTERS ATTACHED > > We've attached "poster versions" of our upcoming public class schedule > to this message. We'd be grateful if you could post one of these on an > electronic or physical bulletin board, or email one to a colleague, to > help us publicize these upcoming classes. Thanks in advance! 8-} > > CONSULTIX ON-LINE RESOURCES > General Information: > http://www.consultix-inc.com > > On-Site Training: > http://www.consultix-inc.com/on-site.html > > Course Listings: > Perl, http://teachmeperl.com/perllist.html > UNIX/Shell, http://teachmeunix.com/unixlist.html > > Registration and Pricing: http://www.consultix-inc.com/reg.html > Instructor Evaluations: http://www.consultix-inc.com/evals.html > Course Evaluations: http://www.consultix-inc.com/course_evals.html > > *----------------------------------------------------------------------------* > | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX > | > | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") > | > | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net > | > *----------------------------------------------------------------------------* > > ATTACHMENT part 2 application/pdf ===== -Tim Tim Maher tim@consultix-inc.com __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tleffler at u.washington.edu Thu Oct 10 19:20:18 2002 From: tleffler at u.washington.edu (Trevor Leffler) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Runtime binding, drivers References: Message-ID: <3DA61942.2070307@u.washington.edu> So you'd say that in practice, DBI doesn't really live up to the hype of "Don't change a line of code! One DB interface uber alles!" Is this a failing of DBI, and if you were to redesign the API, could you fix it? Rather, it sounds like what you're saying is that, yes, these two things are DBs, but they are so dissimilar that no API could be designed to unify to two. How about this... Regarding the issue of a service's (filesystem, DB, animal) capabilities, would it satisfy you if your app could query the service's capababilities and then "do the right thing?" For example, we decide that the Animal API should not require a method "speak," because we know that Animal::Fish can't. How about adding "speak" to some optional capabilities list that our app could query for. Perhaps your app could also ask for all the implementations that can speak. Since the middleware is still be designed and I get to test it out, I hope to inform the designers about issues like these--it's too dumb! it's too complex! it doesn't work with product X! Thanks for your input. I'll keep it in mind as I apply this stuff to real-world situations. Thanks, --Trevor Chris Sutton wrote: > I'll throw my 2 cents in on this, at least in how DBI/DBD stuff works > and my experiences. > > At work we run MySQL and Postgresql. No matter how hard you try and make > things common to work with both databases, by using the DBI interface, > there are aways exceptions in the underlying way the two different > databases behave. > > At some point do you just give up on the "middleware" DBI code and just > use the direct "Pg" or "MySQL" perl interfaces, especially if you are not > likely to have different databases. As much as people like to say "this > complicated code base can work with Postgresql, Oracle, DB2 or whatever, > all you have to do us use DBI", there are times when the implementation > just doesn't work out and is not the most efficient way to do things. (As > an aside, Postgresql and MySQL are way different types of database. > Don't let anyone tell you any different). > > In your Dog/Cat example below, might there be a very special unique type > of Cat which can't speak and which would not work with that interface. > > I guess what I'm getting at is at some point, you need to decide when the > "middleware" has gotten more complicated than its worth and you are better > off just learning how to bark and meow ;) > > On Thu, 10 Oct 2002, Trevor Leffler wrote: > > >>Brian Ingerson wrote: >> >>>On 08/10/02 17:26 -0700, Trevor Leffler wrote: >>> >>> >>>>Hi all, >>>> >>>>I've been researching the implementation of "drivers" in Perl, and am looking >>> >>> >>>What type of drivers are you talking about? You can't do kernel loaded >>>drivers in Perl by definition. Perl is linked with the libc, and those system >>>calls can't be made from kernel code, AFAIK. >>> >>>Cheers, Brian >> >>I am not talking about hardware drivers or other low-level kernel nastiness. >>Sorry if I scared people off with that terminology! Rather, I'm am interested >>in DBI/DBD-style drivers. Or perhaps I should call them "implementations >>conforming to a defined interface." Perhaps some tangible, if silly, code would >>help show my thoughts. >> >>-------- >>my $dog = new Animal("Animal::Dog"); >>my $cat = new Animal("Animal::Cat"); >> >>$dog->speak("Fork over your bacon!"); >># Output: "Woof! Fork over your bacon! Woof!" >> >>$cat->speak("Don't rub my fur the wrong way."); >># Output: "Meow! Don't rub my fur the wrong way. Meow!" >>-------- >> >>Think about how DBI works here. We ask for two animals, a dog and a cat, both >>of which conform to the Animal interface (one method, "speak", which takes a >>string). Our $dog is actually an Animal::Dog object (not an Animal object), >>which implements the interface in its own special way--it prepends and appends >>"Woof!" to the passed string. Likewise, our $cat is an Animal::Cat object. >> >>The implementation might be in pure Perl, or XS, or whatever. The point, and my >>queries, are about the architecture that could make this possible. Do I look to >>DBI as a model (ugh) or are there other models to follow? I keep bringing up >>DBI only because I'm unaware of other Perl modules that do what it does. >> >>BTW, I've already coded something that works, but I'm really interested in some >>discussion of this topic--your experience with this, pros and cons of model A vs >>model B, if you have no experience with this then what do you think it *should* >>do or behave. How would you design it? >> >>Thanks, >>--Trevor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Thu Oct 10 19:24:06 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Nov. MJD Classes; Discounts end 10/18 Message-ID: <20021010172406.A13773@timji.consultix-inc.com> NOTE: Due to a mail configuration problem, many did not receive the earlier mailing of this message. Sorry if this represents the second one for you. ------------------------------------------ Subject: Nov. Classes by Perl Expert "MJD" MARK-JASON DOMINUS TEACHING IN NOVEMBER Yes Perl fans, the rumors are true. In November, you can take specialized Perl training classes through Consultix from the ingenious, entertaining, and ever popular Mark-Jason Dominus ("MJD"), whose top-rated presentations at O'Reilly Perl Conferences, YAPC conferences, and GeekCruises have won him a large following. Here's a list of the individual classes, along with links to detailed class outlines (that are also provided at http://teachmeperl.com): CLASS NAME DATES DAYS ---------------------------------------------------------- "Intermediate Topics in Perl" 11/19-20 2 DETAILS: http://216.158.52.121/class/about/intermediate/ "Tricks of the Wizards" 11/21 .5 DETAILS: http://216.158.52.121/class/about/tricks/ "Regular Expression Mastery" 11/21 .5 DETAILS: http://216.158.52.121/class/about/regex/ "Hands-On Repair Shop and Red Flags" 11/22 1 DETAILS: http://216.158.52.121/class/about/repair/ "Object Oriented Programming" 11/25-27 3 DETAILS: http://216.158.52.121/class/about/oop/ You might recognize some of the class titles shown above from past Perl conferences, but these November offerings are different in two respects. First, all but the half-day classes are "Hands-On", instead of being lecture-only presentations like you get at conferences. So you'll actually have a chance to apply the new techniques you learn under Mark's guidance in comprehensive lab sessions. Secondly, because Mark is constantly making substantial upgrades to his courses to incorporate new concepts and examples, much of the content will be different from what's been presented at conferences. So even those who've seen the conference versions of these classes can obtain additional benefits from participating in our November offerings. Note that there are discounts for those who register, and pay by charge card or provide an acceptable Purchase Order, by 5pm Pacific Time on 10/18. See http://teachmeperl.com/register.html for details. The full schedule of our Winter classes is listed below. --------------------------------------------------------- SCHEDULE OF CONSULTIX PUBLIC CLASSES, in Kirkland WA --------------------------------------------------------- Courses by Dr. Tim Maher: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TITLE DATES Days Minimal Perl 10/25 1 Basic OO Perl 10/28-29 2 Intermediate Pattern Matching 10/30-31 1.5 --------------------------------------------------------- Courses by Mark-Jason Dominus: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TITLE DATES Days Intermediate Topics in Perl 11/19-20 2 Tricks of the Wizards 11/21 .5 Regular Expression Mastery 11/21 .5 Hands-On Program Repair Shop 11/22 1 and Red Flags Object Oriented Programming 11/25-27 3 +--------------------------------------------------------+ SCHEDULE POSTERS AVAILABLE "Poster versions" of our upcoming public class schedule are available at our web site. We'd be grateful if you could post one of these on an electronic or physical bulletin board, or email one to a colleague, to help us publicize these upcoming classes. Thanks in advance! 8-} CONSULTIX ON-LINE RESOURCES General Information: http://www.consultix-inc.com On-Site Training: http://www.consultix-inc.com/on-site.html Course Listings: Perl, http://teachmeperl.com/perllist.html UNIX/Shell, http://teachmeunix.com/unixlist.html Registration and Pricing: http://www.consultix-inc.com/reg.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Course Evaluations: http://www.consultix-inc.com/course_evals.html *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | *----------------------------------------------------------------------------* -- *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | CLASSES: 10/21: UNIX, 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Thu Oct 10 19:28:02 2002 From: benjamin at dzhan.com (benjamin@dzhan.com) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: MAC address Message-ID: <20021010172701.J38774-100000@crimea.dzhan.com> Is there a way using perl socket/networking functions to determine the source hardware MAC address of incoming connections? --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ben at reser.org Thu Oct 10 20:40:32 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Runtime binding, drivers In-Reply-To: <3DA61942.2070307@u.washington.edu> References: <3DA61942.2070307@u.washington.edu> Message-ID: <20021011014032.GM2556@occipital.brain.org> On Thu, Oct 10, 2002 at 05:20:18PM -0700, Trevor Leffler wrote: > So you'd say that in practice, DBI doesn't really live up to the hype of > "Don't change a line of code! One DB interface uber alles!" Is this a > failing of DBI, and if you were to redesign the API, could you fix it? > Rather, it sounds like what you're saying is that, yes, these two things > are DBs, but they are so dissimilar that no API could be designed to unify > to two. DBI never claimed you didn't have to change a line of code. The jist is that you get a nearly identical interface for multiple database engines. If you are very careful and only use features that are supported by all the databases and their drivers it is hypothetically possible to move from one database to another without changing your code. But in the real world we use such features. Fortunately, DBI makes the pain of switching much less painful than it would be if we had to switch from one entirely proprietary interface to another. In order for DBI to guarantee no changes to your code to switch it would have to only support the features that all the databases and drivers support. Which probably wouldn't be very desireable. Basically DBI provides you enough rope to hang yourself if you want. But it's entirely up to you to do that. -- Ben Reser http://ben.reser.org Never take no as an answer from someone who isn't authorized to say yes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From andrew at sweger.net Fri Oct 11 00:10:07 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: MAC address In-Reply-To: <20021010172701.J38774-100000@crimea.dzhan.com> Message-ID: That information is lost when going through bridges and routers. For example, if you pulled the MAC from the ARP table for the remote half of the socket, you may be getting the MAC of the local router involved in that socket. If you're only dealing with local LAN connections, there might be a way. I can go on (and on) about this off-list if you like. On Thu, 10 Oct 2002 benjamin@dzhan.com wrote: > Is there a way using perl socket/networking functions to determine the > source hardware MAC address of incoming connections? -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From davidinnes at chicagoscience.com Sat Oct 12 02:57:56 2002 From: davidinnes at chicagoscience.com (David Innes) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Petty perl obfuscation question In-Reply-To: <20020926094845.C11582@hobart.helvella.org> Message-ID: <000001c271c5$13219860$fe7e5e40@converger.net> So I'm a slow learner who's just started writing modules. Hey, they're fun! Since all my work is usually embedded in IIS/ASP HTML I've always tried to keep my stuff moderately readable. Now that I can hid a bunch of my stuff in modules where only I'll see it I'm starting to play with obfuscation. I've gotten this function down to two lines and I'm wondering if it can be gotten down to one. It doesn't need to be one, but this is Perl so why not try? Here's the deal. My function gets a string that has an arbitrary-length prefix and a string of arbitrary length composed of two-character tokens of the form Digit/Character. The prefix is always separated from the token with a hyphen. The function separates the tokens from the prefix string, sorts the tokens, and then returns the re-concatenated prefix with it's now-sorted set of tokens. So it started out as... #Define two subroutines sub TokenSorter { #Verbose version $String = shift; my ($Prefix, $Tokens) = ( $String =~ m/^(..*-)(..*)$/ ); my @Tokens = ($Tokens =~ /([0-9][A-Z])/ig); #pull out tokens @Tokens = sort @Tokens; $Tokens = join('', @Tokens); $String = $Prefix . $Tokens; return ($String); } #I've managed to shorten all this down to... sub ShorterTokenSorter { #Two line version my ($Prefix, $Tokens) = (shift =~ /^(..*-)(..*)$/); return ($Prefix . join('', sort($Tokens =~ /([0-9][A-Z])/ig))); } #Display the output print TokenSorter("Prefix-3C2B1A") . "\n"; print ShorterTokenSorter("Prefix-3C2B1A") ."\n"; I think I ought to be able to collapse this into one line where I return $Prefix concatenated with some kind of gruesomely manipulated mess instead of the $Units variable. But I don't know how. I'm actually happy with what I've got so this is a purely academic question. Thanks for your help. -- David Innes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From andrew at sweger.net Sat Oct 12 05:48:33 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:09:13 2004 Subject: SPUG: Petty perl obfuscation question In-Reply-To: <000001c271c5$13219860$fe7e5e40@converger.net> Message-ID: Assuming well formed input, this seems to work: $string = "Prefix-3C2B1A"; $string =~ s/(?<=-).+/join'',sort$&=~m{(..)}g/e; This simply replaces the tokens in place. I had trouble getting it into a subroutine as one line though. It seems like we should be able to drop the join() call too. On Sat, 12 Oct 2002, David Innes wrote: > #I've managed to shorten all this down to... > > sub ShorterTokenSorter { #Two line version > my ($Prefix, $Tokens) = (shift =~ /^(..*-)(..*)$/); > return ($Prefix . join('', sort($Tokens =~ /([0-9][A-Z])/ig))); > } > > #Display the output > print TokenSorter("Prefix-3C2B1A") . "\n"; > print ShorterTokenSorter("Prefix-3C2B1A") ."\n"; -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ingy at ttul.org Sat Oct 12 14:09:22 2002 From: ingy at ttul.org (Brian Ingerson) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Petty perl obfuscation question In-Reply-To: ; from andrew@sweger.net on Sat, Oct 12, 2002 at 03:48:33AM -0700 References: <000001c271c5$13219860$fe7e5e40@converger.net> Message-ID: <20021012120922.A27404@ttul.org> On 12/10/02 03:48 -0700, Andrew Sweger wrote: > Assuming well formed input, this seems to work: > > $string = "Prefix-3C2B1A"; > $string =~ s/(?<=-).+/join'',sort$&=~m{(..)}g/e; $string =~ s!(?<=-).+!join'',sort$&=~/(..)/g!e; Good stuff Andy. I can't seem to knock it down by more than a stroke. I tried to lose the join as well, but to no avail. Sort doesn't seem to do anything in scalar context, as the manpage confirms. Cheers, Brian - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ced at carios2.ca.boeing.com Sat Oct 12 21:57:16 2002 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Petty perl obfuscation question Message-ID: <200210130257.TAA04099@carios2.ca.boeing.com> > $string = "Prefix-3C2B1A"; > $string =~ s/(?<=-).+/join'',sort$&=~m{(..)}g/e; >This simply replaces the tokens in place. I had trouble getting it into a >subroutine as one line though. It seems like we should be able to drop the >join() call too. Not nearly as elegant... but avoids the join ;) my($p,@s) = $string=~/(.*-|..)/g;$p.=$_ for sort @s;$p Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Mon Oct 14 14:20:54 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: [mjd@plover.com: Perl Quiz of the Week] Message-ID: <20021014122053.K14857@hobart.helvella.org> SPUGgers, MJD (aka Mark-Jason Dominus, who will be teaching Perl courses in our area in the near future) has started a Perl Quiz-of-the-Week email list. I'm forwarding his announcement from the funwithperl list. -Colin. -------------- next part -------------- An embedded message was scrubbed... From: Mark-Jason Dominus Subject: Perl Quiz of the Week Date: Sat, 12 Oct 2002 22:43:11 -0400 Size: 1493 Url: http://mail.pm.org/archives/spug-list/attachments/20021014/741f8f18/attachment.eml From sthoenna at efn.org Sun Oct 13 19:54:52 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Petty perl obfuscation question References: <200210130257.TAA04099@carios2.ca.boeing.com> Message-ID: On Sat, 12 Oct 2002 19:57:16 -0700 (PDT), ced@carios2.ca.boeing.com wrote: > >> $string = "Prefix-3C2B1A"; >> $string =~ s/(?<=-).+/join'',sort$&=~m{(..)}g/e; > >>This simply replaces the tokens in place. I had trouble getting it into a >>subroutine as one line though. It seems like we should be able to drop the >>join() call too. > >Not nearly as elegant... but avoids the join ;) > >my($p,@s) = $string=~/(.*-|..)/g;$p.=$_ for sort @s;$p That's longer than the join would have been. The simple solution: sub TokenSorter{my($p,@t)=pop=~/.*-|../g;join'',$p,sort@t} is pretty hard to beat. After some effort I came up with: sub TokenSorter{substr join('',sort"-$_[0]"=~/.*-|../g),1} sub TokenSorter{${\(($_=pop)=~/.*-/gc)}.join'',sort/../g} sub TokenSorter{$_=pop;(/.*-/gc,"$&").join'',sort/../g} sub TokenSorter{@_=pop=~/.*-|../g;join'',shift,sort@_} If the OP was more interested in obfuscation than brevity, here's an attempt (doesn't work if prefix can contain a '-'; doesn't work on EBCDIC): sub TokenSorter { local$"; "$${\reverse\split'-'=>$_[0]}-@{[(${chr(34)}=''),sort+pop=~/(?:.*-)?(..)/g]}" } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Mon Oct 14 22:28:57 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Oct. Meeting: Intro to Perl and SPUG Message-ID: <20021014202857.A4307@timji.consultix-inc.com> SPUGsters: In addition to the topics listed below, I'd like to exhibit some interesting beginner-level "one-liners" provided by audience members, so please come prepared with your favorites. Also, if anybody would like to do a lighting talk on a Beginner's level topic, you're welcome to do so. In other words, I won't need all the time for myself, so I'll be happy to share! 8-} -Tim October 2002 Seattle Perl Users Group Meeting ----------------------------------------------------- Speaker: Dr. Tim Maher, of Consultix, Inc. tim@teachmeperl.com, www.teachmeperl.com Time: Tuesday, October 15, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Title: "Introduction to Perl and SPUG" Topics to be covered: - History of Perl - Benefits of Perl - The People of Perl - Resources for Learning Perl - Intro. to Programming in Perl - Questions and Answers - History of SPUG - Great Moments in SPUGgery - Call for PartiSPUGation About the Speaker: ----------------- Tim Maher has been teaching people how to use UNIX and its related languages since 1980, first as a university professor of computer science, later as a corporate trainer for the Bell System's Western Electric division, and since 1986 as the founder and CEO of Consultix, Inc. (one of the "Big Three" Perl training companies). Tim is also the founder and leader of SPUG, which has been recognized as one of the best Perl Users Groups on the planet. This recognition led to Tim being recently honored with the "White Camel" award, and being interviewed by The Perl Foundation and perl.com. Come to Tuesday's meeting and find out what's so great about Perl and SPUG! Pre- and Post- Meeting Activities --------------------------------- The recommended pre-meeting diner is the Cedars restaurant, at 50th St. and Brooklyn, in the University District, near the Safeco building where the meeting will take place. The phone number is 527-5247. If you're planning to be there, please post a message to the list with your expected arrival time (5:30-5:45pm is recommended). As usual, those seeking liquid input before (and after) the meeting are invited to congregate at the Bigtime Brewery and Alehouse. See the web-site for more details. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ced at carios2.ca.boeing.com Tue Oct 15 13:09:14 2002 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Petty perl obfuscation question Message-ID: <200210151809.LAA05024@carios2.ca.boeing.com> >> $string = "Prefix-3C2B1A"; >> $string =~ s/(?<=-).+/join'',sort$&=~m{(..)}g/e; >... >Not nearly as elegant... but avoids the join ;) > >my($p,@s) = $string=~/(.*-|..)/g;$p.=$_ for sort @s;$p |That's longer than the join would have been. |The simple solution: | |sub TokenSorter{my($p,@t)=pop=~/.*-|../g;join'',$p,sort@t} | |is pretty hard to beat. | |After some effort I came up with: | |sub TokenSorter{substr join('',sort"-$_[0]"=~/.*-|../g),1} |sub TokenSorter{${\(($_=pop)=~/.*-/gc)}.join'',sort/../g} |sub TokenSorter{$_=pop;(/.*-/gc,"$&").join'',sort/../g} |sub TokenSorter{@_=pop=~/.*-|../g;join'',shift,sort@_} |If the OP was more interested in obfuscation than brevity, here's an attempt |(doesn't work if prefix can contain a '-'; doesn't work on EBCDIC): | |sub TokenSorter { local$"; |"$${\reverse\split'-'=>$_[0]}-@{[(${chr(34)}=''),sort+pop=~/(?:.*-)?(..)/g]}" |} Hey, I already bashed my lack of elegance and even added a smiley re: not needing a join. [ I was just out pointing another solution that was nearly as short and might appeal to those less familiar with lookbehind assertions and sub eval's.] BTW, your examples are incredibly instructive.. I had forgotten the usefulness of the /c modifer. Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Thu Oct 17 14:19:52 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Oct & Nov Meetings Announced Message-ID: <20021017121952.A12847@timji.consultix-inc.com> SPUGsters, Just a quick note to tell you that I've updated the seattleperl.org web page to show information about the next two meetings: 10/31/02: Dan Sugalski, on Parrot and Perl 6 Yes, this will be our 2nd meeting for October; ain't we lucky! 8-} 11/19/02: Tentatively, Mark-Jason Dominus, on "Something Interesting". Mark's trip is contingent on sufficient advance registrations for his 11/19-27 corporate classes. Teachmeperl.com has details, and Online Registration is open. -Tim *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | CLASSES by Tim Maher: 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | | by MARK-JASON DOMINUS: 11/19-20: Int. Topics in Perl, 11/25-27: O-O Prog. | | 11/21: Tricks of Wizards & Regex Mastery, 11/22: Repair Shop & Red Flags | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From humbaba9 at yahoo.com Mon Oct 21 18:19:05 2002 From: humbaba9 at yahoo.com (Meryll Larkin) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? Message-ID: <20021021231905.88552.qmail@web12805.mail.yahoo.com> 10/21/02 Greetings SPUGsters, I recently set up an Apache Web server on Red Hat Linux and I'm hoping someone can help me with some advice on how to get Perl and MySQL to work together on it. step 1. I'm successfully serving Perl-CGI (and static HTML) web pages. step 2. I installed MySQL and I can successfully view and update the MySQL database on the mysql> command line. step 3 failed: I copied a script I had working on Windows Apache with MySQL and Active Perl (which works with the databases I already tested on Red Hat). This did not work. Do I need a C compiler (gcc?) on my server in order to get MySQL and Perl to communicate? Or rather to run the "make" for the various drivers? I spent a day on the Web at CPAN and MySQL yesterday, reading documentation, downloading and installing .rpm files (DBI modules, DBD modules) that are supposed to work with Perl-MySQL, DBI-DBD-MySQL, Perl-DBI-DBD-MySQL. I continued to get an error message (running the Web page from the command line) saying that I am probably missing a driver for MySQL. It doesn't seem to be finding or using files I installed, although they are in @INC. The web-page generating script works fine until it gets to the DBI->connect line (run time error). I have Carp and DynaLoader in the @INC path. I finally tried installing Perl 5.8 (I was using 5.6) and Makefile.PL worked, but "make" gave me gcc: command not found and did not complete. For security I started out with a very stripped-down installation of RedHat7.2 to build this server. I'm thinking I stripped down too much. Because "make" seems to require the C compiler. Can I "make" the files on my development Linux box and then secure copy them to my Apache server or do they need to "make" on the same machine where they will be working? When I run a script to find out what DBI drivers I have installed, it lists mSQL, mysql, and Mysql (like I said, I spent a day on CPAN).... Other suggestions? TIA, Meryll Larkin __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Mon Oct 21 19:02:44 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? In-Reply-To: <20021021231905.88552.qmail@web12805.mail.yahoo.com> Message-ID: Meryll, Can you show us your script? Thanks, Peter Darley -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Meryll Larkin Sent: Monday, October 21, 2002 4:19 PM To: spug-list@pm.org Subject: SPUG: installing perl mysql DBD - need C compiler? 10/21/02 Greetings SPUGsters, I recently set up an Apache Web server on Red Hat Linux and I'm hoping someone can help me with some advice on how to get Perl and MySQL to work together on it. step 1. I'm successfully serving Perl-CGI (and static HTML) web pages. step 2. I installed MySQL and I can successfully view and update the MySQL database on the mysql> command line. step 3 failed: I copied a script I had working on Windows Apache with MySQL and Active Perl (which works with the databases I already tested on Red Hat). This did not work. Do I need a C compiler (gcc?) on my server in order to get MySQL and Perl to communicate? Or rather to run the "make" for the various drivers? I spent a day on the Web at CPAN and MySQL yesterday, reading documentation, downloading and installing .rpm files (DBI modules, DBD modules) that are supposed to work with Perl-MySQL, DBI-DBD-MySQL, Perl-DBI-DBD-MySQL. I continued to get an error message (running the Web page from the command line) saying that I am probably missing a driver for MySQL. It doesn't seem to be finding or using files I installed, although they are in @INC. The web-page generating script works fine until it gets to the DBI->connect line (run time error). I have Carp and DynaLoader in the @INC path. I finally tried installing Perl 5.8 (I was using 5.6) and Makefile.PL worked, but "make" gave me gcc: command not found and did not complete. For security I started out with a very stripped-down installation of RedHat7.2 to build this server. I'm thinking I stripped down too much. Because "make" seems to require the C compiler. Can I "make" the files on my development Linux box and then secure copy them to my Apache server or do they need to "make" on the same machine where they will be working? When I run a script to find out what DBI drivers I have installed, it lists mSQL, mysql, and Mysql (like I said, I spent a day on CPAN).... Other suggestions? TIA, Meryll Larkin __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaron at activox.com Mon Oct 21 19:18:40 2002 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? In-Reply-To: <20021021231905.88552.qmail@web12805.mail.yahoo.com> Message-ID: <3.0.5.32.20021021171840.0196da68@mail.activox.com> well, start from scratch. presuming you haven't set up any other users yet, take this, change [rootpass] to the proper password (presuming you've set a root password for mysql, otherwise leave password blank), save it, run from the command line, and tell us what it says: >>>>CUT>>>>>> #!/usr/bin/perl # fast in and out use DBI; # ===== db connection ===== # my $host = 'localhost'; my $port = '3306'; my $driver = 'mysql'; my $db = 'mysql'; my $dbuser = 'root'; my $dbpass = '[rootpass]'; my $dsn = "DBI:$driver:database=$db;host=$host;port=$port"; my $dbh = DBI->connect($dsn, $dbuser, $dbpass) or die "$DBI::errstr"; print qq(it looks like a good connect\n); >>>CUT>>>>>>> At 04:19 PM 10/21/2002 -0700, you wrote: >10/21/02 > >Greetings SPUGsters, > >I recently set up an Apache Web server on Red Hat Linux and I'm hoping >someone can help me with some advice on how to get Perl and MySQL to >work together on it. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From moonbeam at catmanor.com Mon Oct 21 19:16:54 2002 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? Message-ID: <200210220016.g9M0Gsa24532@catmanor.com> As I remember, Redhat has replaced the gcc compilor with the egcs compilor. So that you can compile the kernel the gcc compilor has been renamed to kgcc. (go figure). So, when you build the makefile try... perl Makefile.PL CC=cc This may not work, since perl will try to use the compilor options used when perl was originally built. See 'perl -V'. Sometimes, you can get away with editing the makefile. William - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaron at activox.com Mon Oct 21 19:34:05 2002 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? In-Reply-To: <20021021231905.88552.qmail@web12805.mail.yahoo.com> Message-ID: <3.0.5.32.20021021173405.0196da68@mail.activox.com> are you actually using the CPAN module to install mods or are you bringing them down and building them by hand? At 04:19 PM 10/21/2002 -0700, Meryll Larkin wrote: >lists mSQL, mysql, and Mysql (like I said, I spent a day on CPAN).... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From humbaba9 at yahoo.com Tue Oct 22 14:32:17 2002 From: humbaba9 at yahoo.com (Meryll Larkin) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? In-Reply-To: <20021021231905.88552.qmail@web12805.mail.yahoo.com> Message-ID: <20021022193217.81052.qmail@web12805.mail.yahoo.com> 10/22/02 Thank you all for your help. I'm pretty sure by now that mysql never installed fully because I don't have a C++ compiler. I'm still working on this and I'll keep you updated - later this week. http://www.mysql.com/doc/en/configure_options.html If you don't have a C++ compiler, mysql will not compile (it is the one client program that requires C++). In this case, you can remove the code in configure that tests for the C++ compiler and then run ./configure with the --without-server option. The compile step will still try to build mysql, but you can ignore any warnings about `mysql.cc'. (If make stops, try make -k to tell it to continue with the rest of the build even if errors occur.) I've been running into all kinds of trouble, found files missing ( mysql.socks for one ), error messages about bootstrap, hostname... So, thank you, William, the command didn't work, but you put me on the right track. Find displayed my egcs compiler on my dev machine, but even that was absent from my server, so I have no C++ compiler there. Aaron, THANK YOU for your script, I'll be able to run it again later. Right now it shows this error message: install_driver(mysql) failed: Can't locate loadable object for module DBD::mysql in @INC (@INC contains: (long path here, and yes, it is there) Compilation failed in require at (eval 1) line 3 Perhaps a module that DBD::mysql requires hasn't been fully installed at testDBI.pl line 15. Line 15 is the DBI-> connect line. To answer your other question, I went into a loading frenzy and didn't keep track.... Well, that's almost true. On mysql.com there are a bunch of rpm files. I downloaded those off the Web (http, and ftp, mostly ftp) and used rpm -i filename from /, just like the mysq.com instructions say to install. But I got stuck on the steps after that - never could run configure - lots of error messages. But the funny thing was that I was able to use the mysql on the command line and that I had use of my old databases. On CPAN I used perl -MCPAN -e shell. I think I wasn't installing fully because I don't have the C++ compiler. Okay, now scripts: When I used this script (which I got from About): #! use strict; use DBI; print "Here's a list of DBI drivers:\n"; my @available_drivers = DBI->available_drivers('quiet'); my $driver; foreach $driver(@available_drivers) { print "$driver\n"; } Here is what I got: ADO ExampleP Multiplex Mysql Pg Proxy mSQL mysql So I am puzzled as to why it can find DBD/mysql.pm with the script above but not with DBI->connect Peter, you wanted to see my script: #!/usr/bin/perl use strict; use DBI; use Data::Dumper; my $DATA_BASE = 'dbi:mysql:phonebook'; my $password = "deleted"; my $user = "deleted"; my $sql = qq|SELECT * FROM phonebook |; print "Content-type: text/html\n\n"; print qq|Phonebook Test
|; # connect to the db my $dbh = DBI->connect ($DATA_BASE, $user, $password) || print ("can\'t connect to database: $!" . $DATA_BASE->errstr); my $sql_st = $dbh->prepare($sql) || print ("can\'t prepare $sql"); $sql_st->execute || print ("can\'t execute sql statement:
" . $sql_st->errstr); while (my $record = $sql_st->fetchrow_hashref) { print qq| |; } print qq|
$record->{'id'} $record->{'name'} $record->{'phone'} $record->{'department'}



|; $dbh->disconnect || print ("can\'t disconnect
"); exit 0; When I look through a browser at the results, it gets as far as the second table and then stops (so it displays a blank page). When I run it on the command line, I get that far and then the same error message as I got with Aaron's script. Thank you all, I'll keep you posted. Meryll --- Meryll Larkin wrote: > 10/21/02 > > Greetings SPUGsters, > > I recently set up an Apache Web server on Red Hat Linux and I'm > hoping > someone can help me with some advice on how to get Perl and MySQL to > work together on it. > > step 1. I'm successfully serving Perl-CGI (and static HTML) web > pages. > > step 2. I installed MySQL and I can successfully view and update the > MySQL database on the mysql> command line. > > step 3 failed: > I copied a script I had working on Windows Apache with MySQL and > Active > Perl (which works with the databases I already tested on Red Hat). > This did not work. > > Do I need a C compiler (gcc?) on my server in order to get MySQL and > Perl to communicate? Or rather to run the "make" for the various > drivers? > > I spent a day on the Web at CPAN and MySQL yesterday, reading > documentation, downloading and installing .rpm files (DBI modules, > DBD > modules) that are supposed to work with Perl-MySQL, DBI-DBD-MySQL, > Perl-DBI-DBD-MySQL. I continued to get an error message (running the > Web page from the command line) saying that I am probably missing a > driver for MySQL. It doesn't seem to be finding or using files I > installed, although they are in @INC. The web-page generating script > works fine until it gets to the DBI->connect line (run time error). > I > have Carp and DynaLoader in the @INC path. > > I finally tried installing Perl 5.8 (I was using 5.6) and Makefile.PL > worked, but "make" gave me > gcc: command not found > and did not complete. > > For security I started out with a very stripped-down installation of > RedHat7.2 to build this server. I'm thinking I stripped down too > much. > Because "make" seems to require the C compiler. > > Can I "make" the files on my development Linux box and then secure > copy > them to my Apache server or do they need to "make" on the same > machine > where they will be working? > > When I run a script to find out what DBI drivers I have installed, it > lists mSQL, mysql, and Mysql (like I said, I spent a day on CPAN).... > > Other suggestions? > > TIA, > > Meryll Larkin > > > > __________________________________________________ > Do you Yahoo!? > Y! Web Hosting - Let the expert host your web site > http://webhosting.yahoo.com/ > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address > For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: > http://seattleperl.org > __________________________________________________ Do you Yahoo!? Y! Web Hosting - Let the expert host your web site http://webhosting.yahoo.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaron at activox.com Tue Oct 22 14:54:13 2002 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? In-Reply-To: <20021022193217.81052.qmail@web12805.mail.yahoo.com> References: <20021021231905.88552.qmail@web12805.mail.yahoo.com> Message-ID: <3.0.5.32.20021022125413.01d94a10@mail.activox.com> I normally wouldn't suggest this, but as (a) this is your fun box, not a production server and (b) you say you are able to get a mysql db prompt (and presumably query it) from the command line, there is a presumption that mysql is installed and talking on your box. Thus chasing mysql issues wouldn't be the first tree I'd run up...it looks like your DBD::mysql install was abortive, missing some junk and cannot load dynamically. Or when you built perl did you build static? Questions abound...easy one first. Let's presume all is well except you're missing dynaload modules for DBD::mysql. There is an easy fix for this. from a CPAN shell prompt, try force install DBD::mysql I just installed on a box with no traces of mysql anywhere on it (it connects to a different db server). using CPAN to install, it kvetched massively about not being able to attach to the server on localhost to run tests, but once I forced it to install (with the loadables yours is complaining about), pointed it to the db server, all was well. like butter, it was. mmmmm. At the very least, after doing this, your error message will change to say it cannot connect to the mysql server and give you the next bread crumb in your diagnostic trail to grandma's house. At 12:32 PM 10/22/2002 -0700, Meryll Larkin wrote: >10/22/02 >Thank you all for your help. I'm pretty sure by now that mysql never >installed fully because I don't have a C++ compiler. I'm still working >on this and I'll keep you updated - later this week. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From james at banshee.com Tue Oct 22 20:06:15 2002 From: james at banshee.com (James Moore) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: installing perl mysql DBD - need C compiler? In-Reply-To: <3.0.5.32.20021022125413.01d94a10@mail.activox.com> Message-ID: <007701c27a30$67045030$797ba8c0@gealach> You probably are better off installing a binary distribution rather than a source distro for mysql. Unless you have some non-standard needs, the binaries should be just fine. In fact, they're preferable, as you know that they're built and tested, as opposed to building them in a different environment. ------------------------------------------------------------ James M. Moore james@banshee.com Banshee Software: Web software development Open Source / .NET / Embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Wed Oct 23 13:07:11 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Re: The Perl Journal Message-ID: <20021023110711.A31955@timji.consultix-inc.com> SPUGsters, Here's the "call for papers" I received today from the new editor of The Perl Journal. So please consider writing up an article on something interesting you've done with Perl, and you'll achieve publicity, karmic upgrades, and even financial profit - $350 for feature articles. -Tim P.S. We've still got lots of open seats in all of Mark Dominus' classes, and if we don't get more registrations soon, we'll have to cancel them. So if you're planning to attend, register now, at http://teachmeperl.com/cgibin/register.html *----------------------------------------------------------------------------* | CLASSES by Tim Maher: 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | | by MARK-JASON DOMINUS: 11/19-20: Int. Topics in Perl, 11/25-27: O-O Prog. | | 11/21: Tricks of Wizards & Regex Mastery, 11/22: Repair Shop & Red Flags | *----------------------------------------------------------------------------* ----- Forwarded message from Erickson ----- Date: Wed, 23 Oct 2002 10:16:28 -0700 From: Erickson Hi Tim, I'm Jon Erickson, an editor The Perl Journal and Dr. Dobb's Journal. I don't know if have run across the news but we're relaunching TPJ as an e-zine (see www.tpj.com). The first issue should be out in a couple of weeks, and it will be monthly after that. Needless to say, we'll be looking for more articles than ever before so I'd like to invite you (or any SPUG members, etc) to submit any ideas, articles, etc. I know you've written for TPJ in the past and hope you'll consider writing for it again. If you have any questions, please don't hesitate to ask. Thanks Jon jerickson@tpj.com *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | CLASSES by Tim Maher: 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | | by MARK-JASON DOMINUS: 11/19-20: Int. Topics in Perl, 11/25-27: O-O Prog. | | 11/21: Tricks of Wizards & Regex Mastery, 11/22: Repair Shop & Red Flags | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From kquasar at hotpop.com Thu Oct 24 11:56:23 2002 From: kquasar at hotpop.com (Karan Nahata) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Windows Resource Files Message-ID: <001201c27b7e$4bbf5000$ed00a8c0@nahata> Hi , I have to generate Resource files (Windows Resource Files , ' .rc ' [dot rc] , The forms , The Dialogs etc. etc. ) , other wise generated by Microsoft Visual Studio . Can any one suggest me of some PERL Package (if any to generate this) ... Regards , Karan Nahata -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20021024/0b5b3e66/attachment.htm From creede at penguinsinthenight.com Sat Oct 26 08:08:50 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Storable and DBI Message-ID: <1035637731.21499.73.camel@svetlana> Greetings fellow SPUGsters, I was playing around with the Storable module this morning and ran into some odd behavior. I wondered if anyone else has ever seen this, and whether there's a fix or whether I should just code around it. I have a module that I want to serialize using Storable. This module, I'll call it Foo, starts out: #!/usr/bin/perl -w package Foo; use DBI; use CGI; The module exports, among other things, an attribute page(), a method dbh() created using DBI->connect() that gives you a reference to the database handle generated by DBI, and a method cgi() that gives you a reference to a CGI object. So far so good. Everything works OK and I can access my MySQL setup and write web pages and stuff like that, no problem. So, I write this program to test out Storable: #!/usr/bin/perl use Storable qw( freeze thaw ); use Foo; use Data::Dumper; my $foo = new Foo; my $bar = freeze $foo; my $baz = thaw $bar; print $baz->page; print "\n"; print $baz->cgi->p("I've been stored!"); print "\n"; my $query = 'select count(*) as count from main'; print "$query\n"; my $sth = $baz->dbh->prepare($query); $sth->execute; my $row = $sth->fetchrow_hashref; print $row->{count}; print "\n\n"; The first two calls to $baz work fine. I get 20 I've been stored! and the contents of the query print. The database call fails completely. The clue as to why is contained in this cryptic statement in and among the output that happens when I thaw()ed $bar: dbih_getcom handle DBI::db=HASH(0x810636c) is not a DBI handle (has no magic) at test1.cgi line 17 So, my question is, why is it that the DBI call fails? It can't be just because it's an object -- if that was it the call to CGI would fail too. I can code around this by removing the DBI stuff to another module or to the CGI script that uses those calls, but I'm curious as to why this is happening, and whether there might be a way around it. Thanks, -- Creede -- * .~. `( --------------------------------------------------------------- ` / V \ . Creede Lambard : Nothing is quite so powerful as /( )\ creede@penguinsinthenight.com : a penguin whose time has come. ^^-^^ --------------------------------------------------------------- Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/archives/spug-list/attachments/20021026/4399fa9d/attachment.bin From jay at Scherrer.com Sun Oct 27 14:11:02 2002 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? Message-ID: <200210271211.02655.jay@scherrer.com> Hello, I've been trying to pass the contents of a newly created class hash to another subroutine. So far I can assign $values to the derived $keys individually. But I'm having trouble sending the whole "key=>value" contents of the new hash out to another subroutine for further processing. Any suggestions? Jay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ryanparr at thejamescompany.com Sun Oct 27 13:44:00 2002 From: ryanparr at thejamescompany.com (Ryan Parr) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Re: Storable and DBI References: <1035637731.21499.73.camel@svetlana> Message-ID: <019901c27df1$3343b1e0$400117ac@ISSQOA06688> I would assume that because the DBI object needs to be instantiated by calling the DBI->connect method, that it would not be properly restored. All that serialization can do is print out the object, probably a hash reference, and the name of the class it was instantiated to. So when you restore you recover the member data stored in the object, but no methods that were called on the original object can be recalled. -- Ryan ----- Original Message ----- From: "Creede Lambard" To: Sent: Saturday, October 26, 2002 5:08 AM Subject: SPUG: Storable and DBI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From adamm at wazamatta.com Sun Oct 27 15:14:20 2002 From: adamm at wazamatta.com (Adam Monsen) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <200210271211.02655.jay@scherrer.com>; from jay@Scherrer.com on Sun, Oct 27, 2002 at 12:11:02PM -0800 References: <200210271211.02655.jay@scherrer.com> Message-ID: <20021027131420.A21779@wazamatta.com> On 27-Oct-2002 12:11 -0800, Jay Scherrer wrote: > Hello, > I've been trying to pass the contents of a newly created class hash to > another subroutine. So far I can assign $values to the derived $keys > individually. But I'm having trouble sending the whole "key=>value" > contents of the new hash out to another subroutine for further > processing. Any suggestions? > Jay Hey Jay, Please provide a short code sample that demonstrates the problem you're experiencing if you want specific help. That said, here are two ways to pass a hash into a subroutine. #!/usr/bin/perl -w use strict; use Data::Dumper; my %hash = ( 'blah' => '178', 'foo' => '296' ); my_sub(%hash); # pass hash as a list my_sub2(\%hash); # pass hash reference sub my_sub { my %local_hash = @_; print "in my_sub()\n"; print "\%local_hash has: \n", Dumper(\%local_hash); } sub my_sub2 { my $local_hashref = $_[0]; print "in my_sub2()\n"; print "\$local_hashref has: \n", Dumper($local_hashref); } -- Adam Monsen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From doug at beaver.net Sun Oct 27 16:41:51 2002 From: doug at beaver.net (Doug Beaver) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Re: Storable and DBI In-Reply-To: <019901c27df1$3343b1e0$400117ac@ISSQOA06688>; from ryanparr@thejamescompany.com on Sun, Oct 27, 2002 at 11:44:00AM -0800 References: <1035637731.21499.73.camel@svetlana> <019901c27df1$3343b1e0$400117ac@ISSQOA06688> Message-ID: <20021027174151.A97243@beaver.net> On Sun, Oct 27, 2002 at 11:44:00AM -0800, Ryan Parr wrote: > I would assume that because the DBI object needs to be instantiated by > calling the DBI->connect method, that it would not be properly > restored. All that serialization can do is print out the object, > probably a hash reference, and the name of the class it was > instantiated to. So when you restore you recover the member data > stored in the object, but no methods that were called on the original > object can be recalled. this is because Storable can't properly serialize code refs, globs or XS code. it might not work well on tied variables either, that no magic error leads me to believe it expected that key to be tied. if you create simple pure perl classes that hold data, storable works pretty well, but if your object has state that isn't stored in its keys (say it's an XS object or has references to an open socket or fd) or it uses globs or code refs, it won't serialize properly. sometimes you get helpful errors like creede mentioned, sometimes you just get a segv or undef is returned. doug > -- Ryan > > ----- Original Message ----- > From: "Creede Lambard" > To: > Sent: Saturday, October 26, 2002 5:08 AM > Subject: SPUG: Storable and DBI > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- Space Ghost: Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. Moltar: Okay, but that's not the cd burner... Space Ghost: Moltar! Yes! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From creede at penguinsinthenight.com Sun Oct 27 16:53:29 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Re: Storable and DBI In-Reply-To: <20021027174151.A97243@beaver.net> References: <1035637731.21499.73.camel@svetlana> <019901c27df1$3343b1e0$400117ac@ISSQOA06688> <20021027174151.A97243@beaver.net> Message-ID: <1035759210.1145.9.camel@svetlana> On Sun, 2002-10-27 at 14:41, Doug Beaver wrote: > this is because Storable can't properly serialize code refs, globs or XS > code. I think that's the kicker. I remember reading this in the Storable perldoc, but didn't put 2 and 2 together. Thanks for the responses. This gives me an idea of what to do next. -- * .~. `( ------------------------------------------------ ` / V \ . Creede Lambard : Geek by nature. /( )\ creede@penguinsinthenight.com : Linux by choice. ^^-^^ ------------------------------------------------ Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/archives/spug-list/attachments/20021027/f479e5dc/attachment.bin From ingy at ttul.org Sun Oct 27 19:49:38 2002 From: ingy at ttul.org (Brian Ingerson) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: ANNOUNCE: CPAN-MakeMaker-0.10 Message-ID: <20021027174938.C24206@ttul.org> CPAN/MakeMaker version 0.10 =========================== The module ExtUtils::MakeMaker is familiar to everybody. It's on the first line of every Makefile.PL of every module distribution on CPAN. The good thing about ExtUtils::MakeMaker is that it is powerful, featureful, flexible, cross-platform and on virtually every installation of Perl 5. The bad thing about this legacy workhorse is that the Perl community is crippled to significantly improve it. Any features added now can only enhance the current release of Perl. Authors would shun new features anyway, because their modules could not be used in earlier versions of Perl that account for the overwhelming majority of installations. Unfortunately, ExtUtils::MakeMaker is also stuck with a suboptimal interface for new Perl authors. Writing a good Makefile.PL requires an unnecessary level of expertise. Although anything is possible, some seemingly simple tasks (like distributing scripts) involve a lot of setup. Complicating the matter is the fact that there is no API for accessing many of the powerful internals of ExtUtils::MakeMaker. CPAN::MakeMaker changes everything. This module is a drop-in replacement for ExtUtils::MakeMaker. CPAN::MakeMaker works exactly like its legacy counterpart, but it makes a lot of simple things easier, and some harder things possible. CPAN::MakeMaker is a self-distributing module. Only the people who want to create a Perl module or script distribution need to install it. The first time you run your Makefile.PL, CPAN::MakeMaker will attach itself to your distribution. The people who end up installing your distribution don't even need to have into on their system at all. It just works. You should be able to switch any of your existing module distributions to CPAN::MakeMaker by simply changing the line: use ExtUtils::MakeMaker; to: use CPAN::MakeMaker; And then run the command 'perl Makefile.PL'. Everything should just work as before, but now you can take advantage of CPAN::MakeMaker's additional features. See the CPAN::MakeMaker documentation for more details. Make the Switch! NEW FEATURES 0.10: - Initial Release INSTALLATION To install this module type the following: perl Makefile.PL make make test make install COPYRIGHT AND LICENCE Copyright (C) 2002 Brian Ingerson This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jay at Scherrer.com Mon Oct 28 03:26:36 2002 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <20021027131420.A21779@wazamatta.com> References: <200210271211.02655.jay@scherrer.com> <20021027131420.A21779@wazamatta.com> Message-ID: <200210280126.36205.jay@scherrer.com> Heres a short sample, Is there a way of passing the establised hash content back to a subroutine? So far with the simplified setting below, I can pass values to a new class hash as in "get_Info()" and print them calling the keys of the new hash. but how do I get the whole anchelada without redefining the whole hash again? Below is a very brief snapshot of what I'm working with. Thanks, Jay The script: testForm.pl #!/usr/local/bin/perl use strict; use FORM; my ($client, $clienId, $schedule, $firstname, $lastname); ## Create new class ## $client = new FORM; ## Define new data ## $clientId = (1234); $schedule = ("2002"); $firstname = ("Jane"); $lastname = ("Doe"); ## Input new data into $client hash ## $client->FORM::get_Info($clientId, $schedule, $firstname, $lastname); ## print $client data to xml file ## $client->FORM::save2XMLfile; The package: package FORM; ## Some routines in package form ## my %FORM = ( CLIENT_ID => 'undef', SCHEDULE => 'undef', FIRSTNAME => 'undef', LASTNAME => 'undef' ); new { ##Create new data file based on %client ## my $that = shift; my $class = ref($that) || $that; my $self = {%FORM}; bless $self, $class; return $self; } save2XMLfile { my $form =@_; my $outFile = "clientName.xml"; # prints new class to file# my ($clientTag, $value); open(OUTFILE, ">$outfile") or die "Can't $!\n"; print OUTFILE ("\n"); print OUTFILE ("
\n"); foreach $clientTag (keys %form) { $value = $form{$clientTag}; print OUTFILE ("<$clientTag>$value\n"); } print OUTFILE ("\n"); close OUTFILE; } get_Info { $form->{CLIENT_ID} = $clientId if defined $clientId; $form->{SCHEDULE} = $schedule if defined $schedule; $form->{FIRSTNAME} = $firstname if defined $firstname; $form->{LASTNAME} = $lastname if defined $lastname; return %form; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ramon at ramonred.net Mon Oct 28 11:54:16 2002 From: ramon at ramonred.net (Ramon Hildreth) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Loading an hashref into an array, displaying as table In-Reply-To: <200210280126.36205.jay@scherrer.com> Message-ID: <008001c27eab$0cd7eca0$0100a8c0@Rupert> Hi, I am trying to create a table in cgi, that displays the contents of an array. I know how to do the table part. The problem is trying to load the array. I need to take a fetchrow_hashref, and load that into the array a row at a time. I am thinking my basic structure will be something like this: While ( my $row = $sth->frechrow_hashref()0 { Do some stuff-- foreach my $field ($row) { push ( my @array_row, Tr td ( $field->{contact}), td, etc..... } } Print table (@array_row); Any help would be greatly appreciated. Ramon Hildreth. Ramon Hildreth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Mon Oct 28 13:25:08 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Loading an hashref into an array, displaying as table In-Reply-To: <008001c27eab$0cd7eca0$0100a8c0@Rupert> Message-ID: Ramon, I'm not sure what you're doing with the array (I assume you're doing something with the CGI module), but I think if you take what I did and replace the push line with whatever you actually want, it should give you a possible structure for doing this. What I suggest is as follows: my @Array_Row while (my $Row = $sth->fetchrow_hashref()) { do some stuff for my $Field (keys %{$Row}) { push @Array_Row, $Field, $$Row{$Field} # $Field = the name of the field # $$Row{$Field} = value in the field } } print table (@Array_Row); Thanks, Peter Darley -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Ramon Hildreth Sent: Monday, October 28, 2002 9:54 AM To: spug-list@pm.org Subject: SPUG: Loading an hashref into an array, displaying as table Hi, I am trying to create a table in cgi, that displays the contents of an array. I know how to do the table part. The problem is trying to load the array. I need to take a fetchrow_hashref, and load that into the array a row at a time. I am thinking my basic structure will be something like this: While ( my $row = $sth->frechrow_hashref()0 { Do some stuff-- foreach my $field ($row) { push ( my @array_row, Tr td ( $field->{contact}), td, etc..... } } Print table (@array_row); Any help would be greatly appreciated. Ramon Hildreth. Ramon Hildreth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From adamm at wazamatta.com Tue Oct 29 01:46:35 2002 From: adamm at wazamatta.com (Adam Monsen) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <200210280126.36205.jay@scherrer.com>; from jay@scherrer.com on Mon, Oct 28, 2002 at 01:26:36AM -0800 References: <200210271211.02655.jay@scherrer.com> <20021027131420.A21779@wazamatta.com> <200210280126.36205.jay@scherrer.com> Message-ID: <20021028234634.A27739@wazamatta.com> Jay, The code you provided does not compile. Here are some free hints. - subroutines start with the keyword 'sub' (see code I sent you earlier) - please 'use strict' in the FORM package - indent your code (formatting may have been lost when the email was sent) - pick a naming convention. 'get_info()' or 'getInfo()', but not both - using the string 'undef' as a hash value might confuse other programmers. Don't do that. - comments like 'Create new class' and 'Define new data' are frivolous and simply reduce readability. - the comment 'Create new data file based on %client' is _wrong_. Remove it. - it's a good idea to use a CPAN module to generate XML rather than write it by hand. Something like XML::Generator or XML::Simple would work. - instead of '$client->FORM::get_Info' do '$client->get_Info' - consider /not/ doing object orientation, it's only complicating the issue. However, if you really want to use object orientation, you do not need to pass the hash created in get_Info() to save2XMLfile() since the FORM object you create ($client) has this information. If this doesn't make sense, ditch object orientation. - s/anchelada/enchilada/g - see: perldocs 'perlboot' and 'perlstyle', for now. I fixed your source code and cleaned it up quite a bit. The output looks like this:
Jane Doe 2002 1234 I would be happy to provide this source at the measly sum of US$6.95 for services and time. The funds will be donated to The Perl Foundation to further support of the Perl programming language. -Adam On 28-Oct-2002 01:26 -0800, Jay Scherrer wrote: > Heres a short sample, > Is there a way of passing the establised hash content back to a > subroutine? So far with the simplified setting below, I can pass > values to a new class hash as in "get_Info()" and print them calling > the keys of the new hash. but how do I get the whole anchelada without > redefining the whole hash again? Below is a very brief snapshot of > what I'm working with. > Thanks, > Jay > > The script: > testForm.pl > #!/usr/local/bin/perl > use strict; > use FORM; > my ($client, $clienId, $schedule, $firstname, $lastname); > ## Create new class ## > $client = new FORM; > ## Define new data ## > $clientId = (1234); > $schedule = ("2002"); > $firstname = ("Jane"); > $lastname = ("Doe"); > ## Input new data into $client hash ## > $client->FORM::get_Info($clientId, $schedule, $firstname, $lastname); > ## print $client data to xml file ## > $client->FORM::save2XMLfile; > > The package: > > package FORM; > ## Some routines in package form ## > > my %FORM = ( > CLIENT_ID => 'undef', > SCHEDULE => 'undef', > FIRSTNAME => 'undef', > LASTNAME => 'undef' > ); > > new { > ##Create new data file based on %client ## > my $that = shift; > my $class = ref($that) || $that; > my $self = {%FORM}; > bless $self, $class; > return $self; > } > > save2XMLfile { > my $form =@_; > my $outFile = "clientName.xml"; # prints new class to file# > my ($clientTag, $value); > open(OUTFILE, ">$outfile") or die "Can't $!\n"; > print OUTFILE ("\n"); > print OUTFILE ("
\n"); > foreach $clientTag (keys %form) { > $value = $form{$clientTag}; > print OUTFILE ("<$clientTag>$value\n"); > } > print OUTFILE ("\n"); > close OUTFILE; > } > > get_Info { > $form->{CLIENT_ID} = $clientId if defined $clientId; > $form->{SCHEDULE} = $schedule if defined $schedule; > $form->{FIRSTNAME} = $firstname if defined $firstname; > $form->{LASTNAME} = $lastname if defined $lastname; > return %form; > } -- Adam Monsen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jgardn at alumni.washington.edu Tue Oct 29 15:08:15 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <20021028234634.A27739@wazamatta.com> References: <200210271211.02655.jay@scherrer.com> <200210280126.36205.jay@scherrer.com> <20021028234634.A27739@wazamatta.com> Message-ID: <200210291308.15035.jgardn@alumni.washington.edu> On Monday 28 October 2002 11:46 pm, Adam Monsen wrote: > > I would be happy to provide this source at the measly sum of US$6.95 for > services and time. The funds will be donated to The Perl Foundation to > further support of the Perl programming language. > At first I laughed when I read this. But then I realized that this is a really good idea. I was ignoring this thread like I've ignored so many others, but monetary renumeration -- particularly for a noble cause -- is certainly an incentive for writing a good and useful reply. Perhaps future posters might be willing to put a price tag in the subject line. This would represent the size of the donation they are willing to make to the Perl Foundation (or related charity) for a good answer. For example: SPUG: Help with my homework ($5.00) The funds can be easily transferred to the Perl Foundation via Tim at the next perl meeting. -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From andrew at sweger.net Tue Oct 29 21:05:12 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <20021028234634.A27739@wazamatta.com> Message-ID: All-in-all good advice, but this (below) is going too far. (I'm trying to be slightly humorous here, so bear with me.) "anchelada" is correct and matches Jay's accent perfectly. On Mon, 28 Oct 2002, Adam Monsen wrote: > - s/anchelada/enchilada/g -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Tue Oct 29 22:30:38 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Halloween Mtg: Sugalski on Parrot & Perl 6 Message-ID: <20021029203038.A2044@timji.consultix-inc.com> Fellow SPUGsters, We're very lucky to have the Parrot Designer on hand for our second meeting of this month, with a talk about very low-level programming issues (for a change), and what's up with Perl 6. Note also the *new* official SPUG Watering Hole, which is much more conducive to conversation than the old place (see below). Hope to see many of you at this meeting! Feel free to come in costume, if you wish. 8-} -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | JAWCAR ("Just Another White Camel Award Recipient" | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== Special Halloween 2002 Seattle Perl Users Group Meeting ------------------------------------------------------- Speaker: Dan Sugalski, "Parrot Designer" Time: Thursday, October 31, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ Title: "Parrot in a Nutshell, and What's New in Perl 6" Parrot is a virtual machine that's being created to execute byte code for Perl 6, along with a few other languages you might have heard of (see www.parrotcode.org). Dan will give a quick introduction to some of the concepts underlying interpreters in general, and Parrot in particular. He'll then cover Parrot's design goals and some of the reasons the Parrot project was undertaken for Perl 6. He'll also give a brief overview of the changes that are coming in Perl 6, and those that aren't coming. About the Speaker ----------------- Dan Sugalski is the designer of Parrot. He is deeply and tragically involved with the threading model introduced with Perl 5.005 and the author of more than a dozen Perl modules. Dan was also, for a while, the maintainer of the Perl port to VMS. He's currently writing a book for O'Reilly ("Programming Cocoa Applications with Perl") and doing freelance consulting and training. When he's not hacking, he's also a pretty good pastry cook. Pre- and Post- Meeting Activities --------------------------------- For those who wish to socialize with others before the meeting over drinks, we have designated a nearby pub as a gathering place: "Finn MacCool's", at 4217 University Ave. North (just a few blocks North of our old hangout, the Big Time Brewery). (NOTE: This is a new location for us, as of earlier this month.) Those wishing to dine with other SPUGsters and the speaker are encouraged to assemble at the "Cedars Restaurant", at 50th St. and Brooklyn, in the University District. (This is quite near the SAFECO tower.) Try to arrive between 5:30 and 6:00, and be ready to walk over to the SAFECO tower at about 6:30. The phone number is 527-5247. Those intending to dine should RSVP to spug@seattleperl.org so we can reserve a pre-allocated table of sufficient magnitude. Meeting Location ---------------- Our meetings are held in the gigantic SAFECO Tower at the corner of Brooklyn St. and NE 45th St., near the University of Washington. This building is the largest structure in the area, and as such is easy to spot once you get anywhere near it. Getting to the Building >From points North of the University District: Take I-5 south bound, exit at NE 45th Street. Turn left (east) on NE 45th Street. You should easily see the SAFECO building ahead on the right. When you reach Brooklyn Ave NE, you're there. Find a convenient parking space. >From points East of Seattle: Take highway 520 or I-90 west, exit to north bound I-5. Follow directions for downtown Seattle below. >From Downtown Seattle: Take I-5 north bound, exit at NE 45th Street (keep right). Turn right (east) on NE 45th Street. You will see the SAFECO building ahead on the right. When you reach Brooklyn Ave NE, you're there. Find a convenient parking space. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | CLASSES by Tim Maher: 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | | by MARK-JASON DOMINUS: 11/19-20: Int. Topics in Perl, 11/25-27: O-O Prog. | | 11/21: Tricks of Wizards & Regex Mastery, 11/22: Repair Shop & Red Flags | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ingy at ttul.org Tue Oct 29 23:29:26 2002 From: ingy at ttul.org (Brian Ingerson) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Re: [SEAPY] Halloween Mtg: Sugalski on Parrot & Perl 6 In-Reply-To: <20021029203038.A2044@timji.consultix-inc.com>; from tim@consultix-inc.com on Tue, Oct 29, 2002 at 08:30:38PM -0800 References: <20021029203038.A2044@timji.consultix-inc.com> Message-ID: <20021029212926.B17803@ttul.org> On 29/10/02 20:30 -0800, Tim Maher wrote: > Fellow SPUGsters, > > We're very lucky to have the Parrot Designer on hand for > our second meeting of this month, with a talk about very low-level > programming issues (for a change), and what's up with Perl 6. > Note also the *new* official SPUG Watering Hole, which is much more > conducive to conversation than the old place (see below). > > Hope to see many of you at this meeting! Feel free to come in costume, > if you wish. 8-} Yahoo! I'll be there. I'll be the one wearing the lipring costume. ;-} I think it's only courteous that we invite our friends on the Ruby mailing list as well. Maybe we can get Matz to drop in. Oh, and our very own prodigal son, Doug Beaver. C'mon Doug, drop by and enlighten us. Cheers, Brian > -Tim > ====================================================== > | Tim Maher, Ph.D. tim@timmaher.org | > | JAWCAR ("Just Another White Camel Award Recipient" | > | SPUG Founder & Leader spug@seattleperl.org | > | Seattle Perl Users Group www.seattleperl.org | > ====================================================== > > Special Halloween 2002 Seattle Perl Users Group Meeting > ------------------------------------------------------- > > Speaker: Dan Sugalski, "Parrot Designer" > Time: Thursday, October 31, 2002 7-9pm > Location: SAFECO bldg, Brooklyn St. and NE 45th St. > Cost: Admission is free and open to the general public. > Info: http://seattleperl.org/ > > Title: "Parrot in a Nutshell, and What's New in Perl 6" > > Parrot is a virtual machine that's being created to execute byte code > for Perl 6, along with a few other languages you might have heard of > (see www.parrotcode.org). > > Dan will give a quick introduction to some of the concepts underlying > interpreters in general, and Parrot in particular. He'll then cover > Parrot's design goals and some of the reasons the Parrot project was > undertaken for Perl 6. > > He'll also give a brief overview of the changes that are coming in > Perl 6, and those that aren't coming. > > > About the Speaker > ----------------- > Dan Sugalski is the designer of Parrot. He is deeply and tragically > involved with the threading model introduced with Perl 5.005 and the > author of more than a dozen Perl modules. Dan was also, for a while, > the maintainer of the Perl port to VMS. He's currently writing a > book for O'Reilly ("Programming Cocoa Applications with Perl") and > doing freelance consulting and training. When he's not hacking, he's > also a pretty good pastry cook. > > Pre- and Post- Meeting Activities > --------------------------------- > For those who wish to socialize with others before the meeting over > drinks, we have designated a nearby pub as a gathering place: "Finn > MacCool's", at 4217 University Ave. North (just a few blocks North of > our old hangout, the Big Time Brewery). (NOTE: This is a new location > for us, as of earlier this month.) > > Those wishing to dine with other SPUGsters and the speaker are > encouraged to assemble at the "Cedars Restaurant", at 50th St. and > Brooklyn, in the University District. (This is quite near the SAFECO > tower.) Try to arrive between 5:30 and 6:00, and be ready to walk over > to the SAFECO tower at about 6:30. The phone number is 527-5247. > Those intending to dine should RSVP to spug@seattleperl.org so we can > reserve a pre-allocated table of sufficient magnitude. > > Meeting Location > ---------------- > Our meetings are held in the gigantic SAFECO Tower at the corner of > Brooklyn St. and NE 45th St., near the University of Washington. This > building is the largest structure in the area, and as such is easy to > spot once you get anywhere near it. > > Getting to the Building > > >From points North of the University District: > > Take I-5 south bound, exit at NE 45th Street. Turn left (east) on > NE 45th Street. You should easily see the SAFECO building ahead on > the right. When you reach Brooklyn Ave NE, you're there. Find a > convenient parking space. > > >From points East of Seattle: > > Take highway 520 or I-90 west, exit to north bound I-5. Follow > directions for downtown Seattle below. > > >From Downtown Seattle: > > Take I-5 north bound, exit at NE 45th Street (keep right). Turn > right (east) on NE 45th Street. You will see the SAFECO building > ahead on the right. When you reach Brooklyn Ave NE, you're there. > Find a convenient parking space. > > ====================================================== > | Tim Maher, Ph.D. tim@timmaher.org | > | SPUG Founder & Leader spug@seattleperl.org | > | Seattle Perl Users Group www.seattleperl.org | > ====================================================== > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > *----------------------------------------------------------------------------* > | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | > | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | > | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | > | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | > | CLASSES by Tim Maher: 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | > | by MARK-JASON DOMINUS: 11/19-20: Int. Topics in Perl, 11/25-27: O-O Prog. | > | 11/21: Tricks of Wizards & Regex Mastery, 11/22: Repair Shop & Red Flags | > *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From adamm at wazamatta.com Wed Oct 30 01:04:54 2002 From: adamm at wazamatta.com (Adam Monsen) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: ; from andrew@sweger.net on Tue, Oct 29, 2002 at 07:05:12PM -0800 References: <20021028234634.A27739@wazamatta.com> Message-ID: <20021029230454.A29841@wazamatta.com> Okay then, that's worth a $.50 discount. On 29-Oct-2002 19:05 -0800, Andrew Sweger wrote: > All-in-all good advice, but this (below) is going too far. (I'm trying to > be slightly humorous here, so bear with me.) "anchelada" is correct and > matches Jay's accent perfectly. > > On Mon, 28 Oct 2002, Adam Monsen wrote: > > > - s/anchelada/enchilada/g -- Adam Monsen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From adamm at wazamatta.com Wed Oct 30 01:42:47 2002 From: adamm at wazamatta.com (Adam Monsen) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <200210291308.15035.jgardn@alumni.washington.edu>; from jgardn@alumni.washington.edu on Tue, Oct 29, 2002 at 01:08:15PM -0800 References: <200210271211.02655.jay@scherrer.com> <200210280126.36205.jay@scherrer.com> <20021028234634.A27739@wazamatta.com> <200210291308.15035.jgardn@alumni.washington.edu> Message-ID: <20021029234247.B29841@wazamatta.com> On 29-Oct-2002 13:08 -0800, Jonathan Gardner wrote: > On Monday 28 October 2002 11:46 pm, Adam Monsen wrote: > > > > I would be happy to provide this source at the measly sum of US$6.95 for > > services and time. The funds will be donated to The Perl Foundation to > > further support of the Perl programming language. > > > > At first I laughed when I read this. But then I realized that this is a really > good idea. I was ignoring this thread like I've ignored so many others, but > monetary renumeration -- particularly for a noble cause -- is certainly an > incentive for writing a good and useful reply. > > Perhaps future posters might be willing to put a price tag in the subject > line. This would represent the size of the donation they are willing to make > to the Perl Foundation (or related charity) for a good answer. For example: > > SPUG: Help with my homework ($5.00) > > The funds can be easily transferred to the Perl Foundation via Tim at the next > perl meeting. Totally cool. Every donation counts! The "help for sale" idea is rather like Google Answers, except it's for a non-profit organization. -- Adam Monsen - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jay at Scherrer.com Wed Oct 30 10:03:07 2002 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <20021028234634.A27739@wazamatta.com> References: <200210271211.02655.jay@scherrer.com> <200210280126.36205.jay@scherrer.com> <20021028234634.A27739@wazamatta.com> Message-ID: <200210300803.07874.jay@scherrer.com> Hey, Next you'll ask for a credit card number, right? I took you up on the reading of perltoot. Now I know why your drumming for your own copy. THanks for the proof reading though. I hadn't used zsub because I thought that there was a zsub conflict with the server, I almost used zub. The reason I'm using oop in the program is for scaleable functions. As for using 'undef' well maybe the Perl foundation can provide you with your own copy of perltoot. Do you have any Camel picture's ? Thanks, Jay On Monday 28 October 2002 11:46 pm, Adam Monsen wrote: > Jay, > > The code you provided does not compile. Here are some free hints. > > - subroutines start with the keyword 'sub' (see code I sent you earlier) > - please 'use strict' in the FORM package > - indent your code (formatting may have been lost when the email was > sent) > - pick a naming convention. 'get_info()' or 'getInfo()', but not both > - using the string 'undef' as a hash value might confuse other > programmers. Don't do that. > - comments like 'Create new class' and 'Define new data' are frivolous > and simply reduce readability. > - the comment 'Create new data file based on %client' is _wrong_. Remove > it. > - it's a good idea to use a CPAN module to generate XML rather than > write it by hand. Something like XML::Generator or XML::Simple would > work. > - instead of '$client->FORM::get_Info' do '$client->get_Info' > - consider /not/ doing object orientation, it's only complicating the > issue. However, if you really want to use object orientation, you do > not need to pass the hash created in get_Info() to save2XMLfile() > since the FORM object you create ($client) has this information. If > this doesn't make sense, ditch object orientation. > - s/anchelada/enchilada/g > - see: perldocs 'perlboot' and 'perlstyle', for now. > > I fixed your source code and cleaned it up quite a bit. The output looks > like this: > > >
> Jane > Doe > 2002 > 1234 > > > I would be happy to provide this source at the measly sum of US$6.95 for > services and time. The funds will be donated to The Perl Foundation to > further support of the Perl programming language. > > -Adam > > On 28-Oct-2002 01:26 -0800, Jay Scherrer wrote: > > Heres a short sample, > > Is there a way of passing the establised hash content back to a > > subroutine? So far with the simplified setting below, I can pass > > values to a new class hash as in "get_Info()" and print them calling > > the keys of the new hash. but how do I get the whole anchelada without > > redefining the whole hash again? Below is a very brief snapshot of > > what I'm working with. > > Thanks, > > Jay > > > > The script: > > testForm.pl > > #!/usr/local/bin/perl > > use strict; > > use FORM; > > my ($client, $clienId, $schedule, $firstname, $lastname); > > ## Create new class ## > > $client = new FORM; > > ## Define new data ## > > $clientId = (1234); > > $schedule = ("2002"); > > $firstname = ("Jane"); > > $lastname = ("Doe"); > > ## Input new data into $client hash ## > > $client->FORM::get_Info($clientId, $schedule, $firstname, $lastname); > > ## print $client data to xml file ## > > $client->FORM::save2XMLfile; > > > > The package: > > > > package FORM; > > ## Some routines in package form ## > > > > my %FORM = ( > > CLIENT_ID => 'undef', > > SCHEDULE => 'undef', > > FIRSTNAME => 'undef', > > LASTNAME => 'undef' > > ); > > > > new { > > ##Create new data file based on %client ## > > my $that = shift; > > my $class = ref($that) || $that; > > my $self = {%FORM}; > > bless $self, $class; > > return $self; > > } > > > > save2XMLfile { > > my $form =@_; > > my $outFile = "clientName.xml"; # prints new class to file# > > my ($clientTag, $value); > > open(OUTFILE, ">$outfile") or die "Can't $!\n"; > > print OUTFILE ("\n"); > > print OUTFILE ("
\n"); > > foreach $clientTag (keys %form) { > > $value = $form{$clientTag}; > > print OUTFILE ("<$clientTag>$value\n"); > > } > > print OUTFILE ("\n"); > > close OUTFILE; > > } > > > > get_Info { > > $form->{CLIENT_ID} = $clientId if defined $clientId; > > $form->{SCHEDULE} = $schedule if defined $schedule; > > $form->{FIRSTNAME} = $firstname if defined $firstname; > > $form->{LASTNAME} = $lastname if defined $lastname; > > return %form; > > } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From bob at hiltners.com Wed Oct 30 10:35:07 2002 From: bob at hiltners.com (Bob Hiltner) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? References: <20021028234634.A27739@wazamatta.com> <20021029230454.A29841@wazamatta.com> Message-ID: <002001c28032$4f38fc50$0200a8c0@computer> http://donate.perl-foundation.org/index.pl?node=Contribution%20Info%20&lastn ode_id=270 (Would think a simple paypal link would be doable. Then folks really *could* have a google answers sort of offer.) It's a novel idea and I hope it won't be taken too seriously. Cooperative mentoring is one of the hallmarks of Open Source that make it work. Folks should be encouraged to ask and answer questions freely. But hey, if one could have a link saying they'll donate $10/$20 to SomeCharity|Perl Foundation for help, I doubt many would object. ----- Original Message ----- From: "Adam Monsen" To: "Andrew Sweger" Cc: "Jay Scherrer" ; "Seattle Perl Users" Sent: Tuesday, October 29, 2002 11:04 PM Subject: Re: SPUG: Pasing hash references? > Okay then, that's worth a $.50 discount. > > On 29-Oct-2002 19:05 -0800, Andrew Sweger wrote: > > All-in-all good advice, but this (below) is going too far. (I'm trying to > > be slightly humorous here, so bear with me.) "anchelada" is correct and > > matches Jay's accent perfectly. > > > > On Mon, 28 Oct 2002, Adam Monsen wrote: > > > > > - s/anchelada/enchilada/g > > -- > Adam Monsen > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ben at reser.org Wed Oct 30 13:26:23 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Pasing hash references? In-Reply-To: <002001c28032$4f38fc50$0200a8c0@computer> References: <20021028234634.A27739@wazamatta.com> <20021029230454.A29841@wazamatta.com> <002001c28032$4f38fc50$0200a8c0@computer> Message-ID: <20021030192623.GL2512@occipital.brain.org> On Wed, Oct 30, 2002 at 08:35:07AM -0800, Bob Hiltner wrote: > (Would think a simple paypal link would be doable. Then folks really > *could* have a google answers sort of offer.) After this happening I'm not sure paypal is such a good idea: http://slashdot.org/article.pl?sid=02/10/27/042226&mode=thread&tid=98 -- Ben Reser http://ben.reser.org "If you're not making any mistakes, you're flat out not trying hard enough." - Jim Nichols - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Wed Oct 30 23:19:50 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:14 2004 Subject: SPUG: Dan the Parrot man: Holding Court Downtown Message-ID: <20021030211950.A6726@timji.consultix-inc.com> SPUGsters, Our Halloween speaker, Dan "the Parrot Man" Sugalski arrived today, and is staying at a downtown hotel. He thinks he'll have a couple of free hours in the 2-5 time period Thursday (tomorrow) afternoon, and is willing to meet with others who want to meet with him to chat about Perly or Parrotish issues, or suchlike. Note that we're having a dinner for him starting at 5:30 pm at the Cedars Restaurant (the one at 50th and Brooklyn, not the other one) tomorrow, and then drinks at Finn MacCool's after his talk, so there are other opportunities to enjoy his company tomorrow. But Dan and I thought it might be an interesting opportunity for people who might already, e.g., be working downtown to have conversations that could be more focused, lengthy, and audible 8-}, than those that will take place in larger throngs later that day. So if anybody wants to hook up with Dan during this time period tomorrow, please drop me a note, and I'll act as coordinator to set something up. -Tim P.S. Those wishing to attend any of Mark Dominus' classes in November, please register by Friday - or else it might be too late! Details at teachmeperl.com *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | CLASSES by Tim Maher: 10/25: Min Perl, 10/28: OO Perl, 10/30: Int Regexes | | by MARK-JASON DOMINUS: 11/19-20: Int. Topics in Perl, 11/25-27: O-O Prog. | | 11/21: Tricks of Wizards & Regex Mastery, 11/22: Repair Shop & Red Flags | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org