From atjensen at home.com Tue Jun 6 11:37:24 2000 From: atjensen at home.com (Aaron Jensen) Date: Wed Aug 4 00:05:10 2004 Subject: Let's Add Some Spice Message-ID: <393D28C4.F071498A@home.com> It's time to spice up the mailing list. I have a question about some code I've encountered in Lincoln Stein's "Official Guide to Programming with CGI.pm" page 71. (Don't worry, my question isn't about CGI.) Here is the code: 0 #! /usr/bin/perl 1 2 # script: loan.cgi 3 use CGI qw/:standard :html3/; 4 5 # this defines the contents of the fill out forms 6 # on each page 7 @Pages = ('Personal Information','References', 8 'Assets','Review','Confirmation'); 9 %FIELDS = ( 10 'Personal Information'=> 11 ['Name','Address','Telephone','Fax], 12 'References'=> 13 ['Personal References 1','Personal References 2'], 14 'Assets'=> 15 ['Savings Account','Home','Car'] 16 ); 17 18 # accumlate the field names into %ALL_FIELDS: 19 foreach(values %FIELDS){ 20 grep(%ALL_FIELDS{$_}++, @$_); 21 } My question is, what is happening on lines 19 - 21? I've stared at it and stared at it, looked in Perl books, experimented, and have a very fuzzy approximation/guess of what is going on. I know what the result is, just not how that result is acheived. How can clear things up for me? -- =-=-=-=-=-=-=-=-=-=-=-= Aaron Jensen atjensen@home.com Visual Prose Web Design www.proseweb.com =-=-=-=-=-=-=-=-=-=-=-= TIMTOWTDI From merlyn at stonehenge.com Tue Jun 6 12:09:10 2000 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Wed Aug 4 00:05:10 2004 Subject: Let's Add Some Spice In-Reply-To: Aaron Jensen's message of "Tue, 06 Jun 2000 09:37:24 -0700" References: <393D28C4.F071498A@home.com> Message-ID: >>>>> "Aaron" == Aaron Jensen writes: Aaron> 19 foreach(values %FIELDS){ Aaron> 20 grep(%ALL_FIELDS{$_}++, @$_); Aaron> 21 } If that's really line 20, Lincoln should be shot. The proper syntax is $ALL_FIELDS{$_}++. Unfortunately, the current Perl compiler doesn't catch this error. Aaron> My question is, what is happening on lines 19 - 21? I've Aaron> stared at it and stared at it, looked in Perl books, Aaron> experimented, and have a very fuzzy approximation/guess of Aaron> what is going on. I know what the result is, just not how Aaron> that result is acheived. How can clear things up for me? if $FIELDS{fred}[3] = "betty", then $ALL_FIELDS{"betty"} is set to true, for any betty, fred, or 3. :) Walk through the dereferencing for the details. I'd've written this as: for (values %FIELDS) { for (@$_) { $ALL_FIELDS{$_} = 1; } } Does that make more sense now? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! TIMTOWTDI From daniel at chetlin.com Fri Jun 30 14:57:10 2000 From: daniel at chetlin.com (Daniel Chetlin) Date: Wed Aug 4 00:05:10 2004 Subject: TPC anyone? Message-ID: <20000630125710.F1134@localhost.localdomain> After enjoying myself immensely at YAPC, I've decided that I have to go to TPC. Since the conference fee itself is so high (major drawback of being a consultant: no employer to pay your entry fee) I'm looking for ways to cut costs in airfare and hotel stay. In that vein, three questions: a) Has anyone found a particularly cheap flight to Monterey? The United meeting line gave me a $186 quote (out of PDX, of course, and stopping in SF both ways). Can we do better? b) Is there anyone who is going, has not yet made sleeping arrangements, and would be interested in sharing a hotel room? c) Any other thoughts on shaving dollars? One possibility for me would be skipping the tutorials, which I didn't find nearly as useful as the other sessions at YAPC. For those of you who've been to TPC before, how elementary do the tutorials tend to be? If the highest level course is MJD's Wizards talk (which I saw and found enjoyable but unessential at YAPC), then I can probably safely skip it. Although ... I could always use the Linux/Apache stuff instead. Argh. Hope to hear from anyone here who is planning to go. Thanks! -dlc TIMTOWTDI From merlyn at stonehenge.com Fri Jun 30 15:09:06 2000 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Wed Aug 4 00:05:10 2004 Subject: TPC anyone? In-Reply-To: Daniel Chetlin's message of "Fri, 30 Jun 2000 12:57:10 -0700" References: <20000630125710.F1134@localhost.localdomain> Message-ID: >>>>> "Daniel" == Daniel Chetlin writes: Daniel> a) Has anyone found a particularly cheap flight to Monterey? The United Daniel> meeting line gave me a $186 quote (out of PDX, of course, and stopping in SF Daniel> both ways). Can we do better? Monterey doesn't have frequent service. You're probably a lot better off going to San Jose and renting a car for the two hour drive to Monterey. That's what I'm doing. Daniel> b) Is there anyone who is going, has not yet made sleeping Daniel> arrangements, and would be interested in sharing a hotel room? talk to bill@stonehenge.com - I think he's coming up with ideas about that. Daniel> c) Any other thoughts on shaving dollars? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! TIMTOWTDI From sarah at pound.perl.org Fri Jun 30 15:33:00 2000 From: sarah at pound.perl.org (Sarah Burcham) Date: Wed Aug 4 00:05:10 2004 Subject: TPC anyone? In-Reply-To: ; from merlyn@stonehenge.com on Fri, Jun 30, 2000 at 01:09:06PM -0700 References: <20000630125710.F1134@localhost.localdomain> Message-ID: <20000630153259.A6394@pound.perl.org> > Daniel> b) Is there anyone who is going, has not yet made sleeping > Daniel> arrangements, and would be interested in sharing a hotel room? > > talk to bill@stonehenge.com - I think he's coming up with ideas about > that. I thought his master game plan was going home with the cutest waitress? ::ducks:: -sarah TIMTOWTDI From masque at mindless.com Fri Jun 30 23:15:58 2000 From: masque at mindless.com (Paul Blair) Date: Wed Aug 4 00:05:10 2004 Subject: TPC anyone? Message-ID: <001c01bfe313$0f586bc0$0c13a8c0@c946807-a.potlnd1.or.home.com> From: Daniel Chetlin To: pdx-pm-list@pm.org Date: Friday, June 30, 2000 1:00 PM Subject: TPC anyone? >After enjoying myself immensely at YAPC, I've decided that I have to go to >TPC. Since the conference fee itself is so high (major drawback of being a >consultant: no employer to pay your entry fee) I'm looking for ways to cut >costs in airfare and hotel stay. > >In that vein, three questions: > >a) Has anyone found a particularly cheap flight to Monterey? The United >meeting line gave me a $186 quote (out of PDX, of course, and stopping in SF >both ways). Can we do better? I think I'm paying $146. Stopping in SF is pretty much the only way to go, unless you want to drive. I suggest carpooling. Flights to San Jose aren't bad, and neither is the drive. I did this last year. >c) Any other thoughts on shaving dollars? Well, I didn't say this, but just don't go to the conference. :] Hang out with the perlers in the halls. You'll learn quite a bit and have a good time. >One possibility for me would be skipping the tutorials, which I didn't find >nearly as useful as the other sessions at YAPC. For those of you who've been >to TPC before, how elementary do the tutorials tend to be? If the highest >level course is MJD's Wizards talk (which I saw and found enjoyable but >unessential at YAPC), then I can probably safely skip it. Although ... I could >always use the Linux/Apache stuff instead. Argh. RANDAL'S TUTORIALS ARE REQUIRED. (You can slip me that fiver later, merlyn.) The tutorials are indeed expensive. I went to Advanced Perl I and II last year, and while they were good learning, I can't see paying my own money for them. MJD's Tricks Of The Wizards talk was priceless, but you've already been to that. The threading course, again, decent...but I have a hard time feeding two kids and a wife and buying toys AND paying $395 per class. :] To reiterate, TPC can be a somewhat inexpensive experience, it's up to you. Oh, this should help, however. Our friends at O'Reilly sent along this tidbit: "The Early Bird discount for the O'Reilly Open Source Convention and Perl Conference 4.0 officially ended as of June 19th. As a special promo offer to UGs, O'Reilly will continue extending the Early Bird Pricing to O'Reilly UG members only. "This savings applies to both the Tutorials and Conference Sessions. Conference Sessions price--$795 ($895 regular price). Tutorial pricing depends on number taken-- learn more, save more. "To receive this discount - use the special promotion code: 1010. There is a field on the registration form that will ask for this code." So, as that pdx.pm is an "O'Reilly UG" (say it with me: UG!) we qualify for this discount. That could help things. Paul. TIMTOWTDI