From MichaelRWolf at att.net Wed Apr 1 16:06:02 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed, 1 Apr 2009 19:06:02 -0400 Subject: SPUG: must dumpvar.pl be required BEGIN Message-ID: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> I found code fragments with a bare require require 'dumpvar.pl'; I could only get it to work by wrapping it in BEGIN BEGIN { require 'dumpvar.pl'; } Is this standard? Is there a better (for the 'shorter' definition of 'better') way to get the module to make &main::dumpValue available? Is there a procedural module that I could include with a 'use' instead of having to 'require' it? I found the Dumpvalue module, but would prefer a non-OO one if it exists. Thanks, Michael ====================== DEBUGGING output below... With a bare require, I got the following output. Backslash found where operator expected at 02_city_state.t line 38, near "dumpValue \" (Do you need to predeclare dumpValue?) Backslash found where operator expected at 02_city_state.t line 41, near "dumpValue \" (Do you need to predeclare dumpValue?) "my" variable $example masks earlier declaration in same scope at 02_city_state.t line 55. syntax error at 02_city_state.t line 38, near "dumpValue \" syntax error at 02_city_state.t line 41, near "dumpValue \" Execution of 02_city_state.t aborted due to compilation errors. The code worked when I used the BEGIN. (Here's lines 37-42.) print "These should pass\n"; dumpValue \@should_pass; print "These should fail\n"; dumpValue \@should_fail; -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From sthoenna at efn.org Wed Apr 1 16:45:10 2009 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed, 1 Apr 2009 16:45:10 -0700 (PDT) Subject: SPUG: must dumpvar.pl be required BEGIN In-Reply-To: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> References: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> Message-ID: <34743.71.212.101.173.1238629510.squirrel@webmail.efn.org> On Wed, April 1, 2009 4:06 pm, Michael R. Wolf wrote: > print "These should pass\n"; > dumpValue \@should_pass; There's your problem. Perl doesn't know at compile time that dumpValue is a subroutine rather than the method for an indirect method call. If you want to use not-yet-compiled subs as such, use parens around the arguments. From jarich at perltraining.com.au Wed Apr 1 17:12:36 2009 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 02 Apr 2009 11:12:36 +1100 Subject: SPUG: must dumpvar.pl be required BEGIN In-Reply-To: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> References: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> Message-ID: <49D402F4.8020406@perltraining.com.au> Michael R. Wolf wrote: > require 'dumpvar.pl'; > > I could only get it to work by wrapping it in BEGIN > > BEGIN { > require 'dumpvar.pl'; > } require happens at run-time. Thus the contents (and hints) from required files are not available at compile time. Wrapping a require in a BEGIN block means that it is instead compiled at the start of the compile process, and the symbol table is populated appropriately. It's worth being aware that "use" which we use with modules (such as in "use strict;") is roughly equivalent to: BEGIN { require 'module.pm'; module::import; } > Is this standard? Is there a better (for the 'shorter' definition of > 'better') way to get the module to make &main::dumpValue available? Files which are required are rarely modules. Require isn't very common these days, as making modules is usually better. For example you just need to create a package of the same name as your file, use Exporter and @EXPORT_OK if you want that functionality and "use" it instead of requiring. For example: # File: Dumpvar.pm # Non-pragmatic modules usually start with a capital package Dumpvar; use strict; use warnings; use base 'Exporter'; our @EXPORT_OK = qw(dumpValue); sub dumpValue { ... } 1; # Main code #!/usr/bin/perl -w use strict; use Dumpvar qw(dumpValue); my @should_pass; print "These should pass\n"; dumpValue \@should_pass; > Is there a procedural module that I could include with a 'use' instead > of having to 'require' it? I found the Dumpvalue module, but would > prefer a non-OO one if it exists. It doesn't appear, from what you've shown us that Dumpvalue is OO, it takes a reference, but if it were OO I'd expect something more like: my $dumper = Dumpvar->new; $dumper->dump(\@should_pass); Without knowing what dumpValue is doing this question is very hard to answer. Although perhaps you just want Data::Dumper: use Data::Dumper; print "These should pass\n"; print Dumper \@should_pass; Data::Dumper comes standard with Perl which is an additional plus. > print "These should fail\n"; > dumpValue \@should_fail; As Yitzchak pointed out, this can be fixed trivially by giving Perl a better hint that you're referring to a subroutine it hasn't seen yet by using parens: dumpValue(\@should_fail); It's a good idea to *always* use parentheses on all non-core functions, especially when you're not passing in an argument: noArgs(); This avoids the problem you've seen here, and a few more. All the best, J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From MichaelRWolf at att.net Wed Apr 1 18:09:26 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed, 1 Apr 2009 21:09:26 -0400 Subject: SPUG: must dumpvar.pl be required BEGIN In-Reply-To: <34743.71.212.101.173.1238629510.squirrel@webmail.efn.org> References: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> <34743.71.212.101.173.1238629510.squirrel@webmail.efn.org> Message-ID: On Apr 1, 2009, at 7:45 PM, Yitzchak Scott-Thoennes wrote: > On Wed, April 1, 2009 4:06 pm, Michael R. Wolf wrote: >> print "These should pass\n"; >> dumpValue \@should_pass; > > There's your problem. Perl doesn't know at compile time that > dumpValue > is a subroutine rather than the method for an indirect method call. > If you want to use not-yet-compiled subs as such, use parens around > the > arguments. > Of course. Thanks.... -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From andrew at sweger.net Thu Apr 2 13:18:38 2009 From: andrew at sweger.net (Andrew Sweger) Date: Thu, 2 Apr 2009 13:18:38 -0700 (PDT) Subject: SPUG: Google Summer of Code Student Deadline Message-ID: Attention students, time is running out: If you are a student and interested in Open Source, now is the time to act to get involved in Google's wonderful Summer of Code program. http://code.google.com/soc/ Josh McAdams made a video explaining The Perl Foundations involvement with GSoC: http://www.youtube.com/watch?v=-utZ2cA9r-E Each year, Google offers students the opportunity to spend their summer vacation coding rather than flipping burgers. You propose a project, and if selected, you're assigned a mentor and provided with a stipend. It is a competitive program to get into, but offers an amazing amount of real-world experience and the ability to get seriously involved in an open source project of your choosing. The Perl Foundation spans a wide variety of projects including Perl 5, Perl 6, and Parrot with many great mentors signed-up to help you succeed. And the deadline is fast approaching (noon (PDT) on Friday!) http://www.perlfoundation.org/perl5/index.cgi?gsoc From andrew at sweger.net Thu Apr 2 13:26:18 2009 From: andrew at sweger.net (Andrew Sweger) Date: Thu, 2 Apr 2009 13:26:18 -0700 (PDT) Subject: SPUG: Discount code for OSCON Message-ID: If you're thinking of going to OSCON this year and would like a 20% discount, use the code "os09usrg" when registering. https://en.oreilly.com/oscon2009/public/register -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From charles.e.derykus at boeing.com Thu Apr 2 14:39:51 2009 From: charles.e.derykus at boeing.com (DeRykus, Charles E) Date: Thu, 2 Apr 2009 14:39:51 -0700 Subject: SPUG: must dumpvar.pl be required BEGIN In-Reply-To: <49D402F4.8020406@perltraining.com.au> References: <25763E36-214E-42C5-8AEE-0A5891A161AA@att.net> <49D402F4.8020406@perltraining.com.au> Message-ID: From: Jacinta Richardson [mailto:jarich at perltraining.com.au] > Files which are required are rarely modules. Require isn't very common these days, > as making modules is usually better. For example you just need to create a package > of the same name as your file, use Exporter and @EXPORT_OK if you want that > functionality and "use" it instead of requiring. For examp One of the minor runtime benefits of 'require' is conditional module loading although I'm sure you can do the same thing with the 'autouse' pragma. if ($debug) { require LWP::Debug; LWP::Debug->import('+'); } Speaking of LWP, the UserAgent example still seems to use require for some reason - rational or not: NAME LWP::UserAgent - Web user agent class SYNOPSIS require LWP::UserAgent; my $ua = LWP::UserAgent->new; ... -- Charles DeRykus From michaelrwolf at att.net Thu Apr 2 15:10:53 2009 From: michaelrwolf at att.net (Michael R. Wolf) Date: Thu, 2 Apr 2009 18:10:53 -0400 Subject: SPUG: Working with currency Message-ID: <04846016-5E4A-4DED-847C-89332D28784A@att.net> I've got some students in class this week whose process was halted because they were off by $0.02 in their $3M totals. A quick CPAN search unearthed Math::Currency. If anyone has experience with it, I'd appreciate a quick "thumbs up" or "thumbs down" quick poll. I'd also appreciate any quick pointers to useful modules or practices (or anti-recommendations or anti-patterns). I don't need a *description of the problem*. I understand the limitations of software and hardware. What I'm looking for is some pointers to *pre-existing solutions*. Thanks, Michael P.S. I'm not making up the "2 cents" part. It sounds so cliche, but it's the real figure. Go figure!!! -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From cmeyer at helvella.org Thu Apr 2 16:23:10 2009 From: cmeyer at helvella.org (Colin Meyer) Date: Thu, 2 Apr 2009 16:23:10 -0700 Subject: SPUG: Working with currency In-Reply-To: <04846016-5E4A-4DED-847C-89332D28784A@att.net> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> Message-ID: <20090402232310.GA31708@infula.helvella.org> On Thu, Apr 02, 2009 at 06:10:53PM -0400, Michael R. Wolf wrote: > I've got some students in class this week whose process was halted > because they were off by $0.02 in their $3M totals. > > A quick CPAN search unearthed Math::Currency. If anyone has > experience with it, I'd appreciate a quick "thumbs up" or "thumbs > down" quick poll. I'd also appreciate any quick pointers to useful > modules or practices (or anti-recommendations or anti-patterns). Were your students trying to convert between different currencies? That's what Math::Currency seems geared towards. If they are trying to do money calculations, and are not worried about converting between foreign currencies, then the quick answer is to do all calculations in pennies, as integers, and only convert to dollars when displaying. This avoids propagating floating point rounding errors. The long answer is quite ... well, longer. There's lots on the web about calculations with money. > > I don't need a *description of the problem*. I understand the > limitations of software and hardware. What I'm looking for is some > pointers to *pre-existing solutions*. Er, it might help to have a description of the problem, in order to help you find answers. Solution to what? $0.02 off? Just add (or substract, as the case may be) that two cents. :P -Colin. From jay at scherrer.com Thu Apr 2 17:10:47 2009 From: jay at scherrer.com (Jay Scherrer) Date: Thu, 02 Apr 2009 17:10:47 -0700 Subject: SPUG: Working with currency In-Reply-To: <04846016-5E4A-4DED-847C-89332D28784A@att.net> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> Message-ID: <49D55407.2020503@scherrer.com> Is the problem within the actual calculations or the display? Perl does quite good at math by itself. And the built in print format sprintf works rather well. ex: sprintf(%0.2f); Jay Scherrer Bookkeeping and Tax Service Michael R. Wolf wrote: > I've got some students in class this week whose process was halted > because they were off by $0.02 in their $3M totals. > > A quick CPAN search unearthed Math::Currency. If anyone has experience > with it, I'd appreciate a quick "thumbs up" or "thumbs down" quick > poll. I'd also appreciate any quick pointers to useful modules or > practices (or anti-recommendations or anti-patterns). > > I don't need a *description of the problem*. I understand the > limitations of software and hardware. What I'm looking for is some > pointers to *pre-existing solutions*. > > Thanks, > Michael > > P.S. I'm not making up the "2 cents" part. It sounds so cliche, but > it's the real figure. Go figure!!! > From sthoenna at efn.org Thu Apr 2 17:46:46 2009 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu, 2 Apr 2009 17:46:46 -0700 (PDT) Subject: SPUG: Working with currency In-Reply-To: <04846016-5E4A-4DED-847C-89332D28784A@att.net> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> Message-ID: <34438.71.212.101.173.1238719606.squirrel@webmail.efn.org> On Thu, April 2, 2009 3:10 pm, Michael R. Wolf wrote: > I've got some students in class this week whose process was halted > because they were off by $0.02 in their $3M totals. > > I don't need a *description of the problem*. I understand the > limitations of software and hardware. What I'm looking for is some > pointers to *pre-existing solutions*. The only pre-existing solution that's going to work consistently is: Store and manipulate in pennies; only use dollars on user input and output. No modules required. :) From jack at foys.net Thu Apr 2 18:48:11 2009 From: jack at foys.net (Jack Foy) Date: Thu, 2 Apr 2009 18:48:11 -0700 Subject: SPUG: Working with currency In-Reply-To: <20090402232310.GA31708@infula.helvella.org> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <20090402232310.GA31708@infula.helvella.org> Message-ID: <20090403014811.GM16058@foys.net> Colin Meyer wrote: > If they are trying to do money calculations, and are not worried > about converting between foreign currencies, then the quick answer > is to do all calculations in pennies, as integers, and only convert > to dollars when displaying. This avoids propagating floating point > rounding errors. The long answer is quite ... well, longer. There's > lots on the web about calculations with money. This may be part of your longer answer: wouldn't integer calculations in fractional cents (to two or three decimal places) be closer to a real-world solution? -- Jack Foy From tyemq at cpan.org Thu Apr 2 19:17:17 2009 From: tyemq at cpan.org (Tye McQueen) Date: Thu, 2 Apr 2009 19:17:17 -0700 Subject: SPUG: Working with currency In-Reply-To: <20090403014811.GM16058@foys.net> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <20090402232310.GA31708@infula.helvella.org> <20090403014811.GM16058@foys.net> Message-ID: On Thu, Apr 2, 2009 at 6:48 PM, Jack Foy wrote: > This may be part of your longer answer: wouldn't integer calculations in > fractional cents (to two or three decimal places) be closer to a > real-world solution? No, you want to do calculations in units of pennies and round to the nearest penny (using banker's rounding) whenever you calculate a value that will be displayed to the customer (unless you are displaying values other than to the nearest penny, which is rare but not unheard of). And you make these calculation in floating point, which is what Perl does even if you use int() (but don't "use integer;"). Tye -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelrwolf at att.net Thu Apr 2 19:20:26 2009 From: michaelrwolf at att.net (Michael R. Wolf) Date: Thu, 2 Apr 2009 22:20:26 -0400 Subject: SPUG: Working with currency In-Reply-To: <34438.71.212.101.173.1238719606.squirrel@webmail.efn.org> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <34438.71.212.101.173.1238719606.squirrel@webmail.efn.org> Message-ID: <3B3A75C8-52CD-4B04-9C5C-886795B836FA@att.net> On Apr 2, 2009, at 8:46 PM, Yitzchak Scott-Thoennes wrote: > The only pre-existing solution that's going to work consistently is: > > Store and manipulate in pennies; only use dollars on user input and > output. > No modules required. :) A module-less solution was my first choice. It's elegant (for the "small and simple" definition of elegant). After an hour of digging, I can't find indications (much less an answer) on when it's necessary to 'use bigint'. In other words, what is the moral equivalent of MAXINT, or at least a close approximation (disregarding whatever legal fine-print exists) for a back of the envelope proof-of-concept design? -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From sthoenna at efn.org Thu Apr 2 19:35:08 2009 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Thu, 2 Apr 2009 19:35:08 -0700 (PDT) Subject: SPUG: Working with currency In-Reply-To: <3B3A75C8-52CD-4B04-9C5C-886795B836FA@att.net> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <34438.71.212.101.173.1238719606.squirrel@webmail.efn.org> <3B3A75C8-52CD-4B04-9C5C-886795B836FA@att.net> Message-ID: <49313.97.113.89.125.1238726108.squirrel@webmail.efn.org> On Thu, April 2, 2009 7:20 pm, Michael R. Wolf wrote:. > After an hour of digging, I can't find indications (much less an > answer) on when it's necessary to 'use bigint'. In other words, what is > the moral equivalent of MAXINT, or at least a close approximation > (disregarding whatever legal fine-print exists) for a back of the > envelope proof-of-concept design? 2**53 pennies = a bit over 90 trillion dollars From haircut at gmail.com Thu Apr 2 20:01:47 2009 From: haircut at gmail.com (Adam Monsen) Date: Thu, 2 Apr 2009 22:01:47 -0500 Subject: SPUG: Working with currency In-Reply-To: References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <20090402232310.GA31708@infula.helvella.org> <20090403014811.GM16058@foys.net> Message-ID: <9ebd65110904022001n5a88578al542b4266a3f87e94@mail.gmail.com> Sorry in advance, this drifts offtopic a bit. >> This may be part of your longer answer: wouldn't integer calculations in >> fractional cents (to two or three decimal places) be closer to a >> real-world solution? > > No, you want to do calculations in units of pennies and round to the nearest > penny (using banker's rounding) whenever you calculate a value that will be > displayed to the customer (unless you are displaying values other than to > the nearest penny, which is rare but not unheard of). > > And you make these calculation in floating point, which is what Perl does > even if you use int() (but don't "use integer;"). Be sure to get *very* specific requirements on rounding, especially when dealing with multiple currencies. See: http://www.xencraft.com/resources/multi-currency.html#rounding My current software project (*cough* Mifos *cough*) is forced to allow banks to perform rounding however they see fit. Different banks might use different methods, and (as mentioned in the above link to xencraft.com) different countries may proscribe different rounding rules. I think rounding is usually done when credits and debits are posted (both simultaneously in double-entry accounting) but until then, it may be beneficial to store fractional monetary amounts. From haircut at gmail.com Thu Apr 2 20:05:12 2009 From: haircut at gmail.com (Adam Monsen) Date: Thu, 2 Apr 2009 22:05:12 -0500 Subject: SPUG: Working with currency In-Reply-To: <9ebd65110904022001n5a88578al542b4266a3f87e94@mail.gmail.com> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <20090402232310.GA31708@infula.helvella.org> <20090403014811.GM16058@foys.net> <9ebd65110904022001n5a88578al542b4266a3f87e94@mail.gmail.com> Message-ID: <9ebd65110904022005l645257c1y9968a81b4c9ada6a@mail.gmail.com> > different countries may proscribe different rounding rules. s/proscribe/prescribe/ Although I suppose some rounding rules may also be proscribed implicitly or explicitly. From MichaelRWolf at att.net Thu Apr 2 20:19:36 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Thu, 2 Apr 2009 23:19:36 -0400 Subject: SPUG: Working with currency In-Reply-To: <9ebd65110904022001n5a88578al542b4266a3f87e94@mail.gmail.com> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <20090402232310.GA31708@infula.helvella.org> <20090403014811.GM16058@foys.net> <9ebd65110904022001n5a88578al542b4266a3f87e94@mail.gmail.com> Message-ID: On Apr 2, 2009, at 11:01 PM, Adam Monsen wrote: > Be sure to get *very* specific requirements on rounding, especially > when dealing with multiple currencies. See: > http://www.xencraft.com/resources/multi-currency.html#rounding The Math::BigInt module specifies 7 rounding modes: trunc, even, odd, +inf, -inf, zero, common. http://search.cpan.org/~tels/Math-BigInt-1.89/lib/Math/BigInt.pm#Rounding_mode_R -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From andrew at sweger.net Thu Apr 2 21:22:36 2009 From: andrew at sweger.net (Andrew Sweger) Date: Thu, 2 Apr 2009 21:22:36 -0700 (PDT) Subject: SPUG: Working with currency In-Reply-To: <49313.97.113.89.125.1238726108.squirrel@webmail.efn.org> Message-ID: On Thu, 2 Apr 2009, Yitzchak Scott-Thoennes wrote: > 2**53 pennies = a bit over 90 trillion dollars Reference, please? Context? (I mean, just throwing a number like this out just doesn't seem fair. 53 bits? That seems... odd.) -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. From bill at celestial.com Thu Apr 2 23:04:17 2009 From: bill at celestial.com (Bill Campbell) Date: Thu, 2 Apr 2009 23:04:17 -0700 Subject: SPUG: Working with currency In-Reply-To: <3B3A75C8-52CD-4B04-9C5C-886795B836FA@att.net> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <34438.71.212.101.173.1238719606.squirrel@webmail.efn.org> <3B3A75C8-52CD-4B04-9C5C-886795B836FA@att.net> Message-ID: <20090403060417.GA18898@ayn.mi.celestial.com> On Thu, Apr 02, 2009, Michael R. Wolf wrote: > > On Apr 2, 2009, at 8:46 PM, Yitzchak Scott-Thoennes wrote: > >> The only pre-existing solution that's going to work consistently is: >> >> Store and manipulate in pennies; only use dollars on user input and >> output. >> No modules required. :) > > > A module-less solution was my first choice. It's elegant (for the > "small and simple" definition of elegant). > > After an hour of digging, I can't find indications (much less an answer) > on when it's necessary to 'use bigint'. In other words, what is the > moral equivalent of MAXINT, or at least a close approximation > (disregarding whatever legal fine-print exists) for a back of the > envelope proof-of-concept design? That depends on the underlying hardware and the integer length. Normal longs will handle things most small-to-medium businesses normally deal with (until Hyperinflation hits which is coming RSN to a neighborhood near you). Dollar amounts are stored internally as cents. Addition and subtraction is a no-brainer, but multiplication and division is a bit messier as one needs to normalize to cents with appropriate rounding rules. It would be in interesting exercise in OO programming and overriding operators to create a class that would handle fixed point decimal numbers properly. I did something like this several years ago in perl, but generally find dealing with bigints to be pretty ugly. Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 When the customer has beaten upon you long enough, give him what he asks for, instead of what he needs. This is very strong medicine, and is normally only required once. -- The Consultant's Curse: From jwkrahn at shaw.ca Thu Apr 2 23:17:49 2009 From: jwkrahn at shaw.ca (John W. Krahn) Date: Thu, 02 Apr 2009 23:17:49 -0700 Subject: SPUG: Working with currency In-Reply-To: References: Message-ID: <49D5AA0D.5050807@shaw.ca> Andrew Sweger wrote: > On Thu, 2 Apr 2009, Yitzchak Scott-Thoennes wrote: > >> 2**53 pennies = a bit over 90 trillion dollars > > Reference, please? Context? (I mean, just throwing a number like this out > just doesn't seem fair. 53 bits? That seems... odd.) $ perl -MPOSIX -le'print DBL_MANT_DIG' 53 John -- Those people who think they know everything are a great annoyance to those of us who do. -- Isaac Asimov From kurt.buff at gmail.com Thu Apr 2 23:21:37 2009 From: kurt.buff at gmail.com (Kurt Buff) Date: Thu, 2 Apr 2009 23:21:37 -0700 Subject: SPUG: Working with currency In-Reply-To: <49313.97.113.89.125.1238726108.squirrel@webmail.efn.org> References: <04846016-5E4A-4DED-847C-89332D28784A@att.net> <34438.71.212.101.173.1238719606.squirrel@webmail.efn.org> <3B3A75C8-52CD-4B04-9C5C-886795B836FA@att.net> <49313.97.113.89.125.1238726108.squirrel@webmail.efn.org> Message-ID: On Thu, Apr 2, 2009 at 19:35, Yitzchak Scott-Thoennes wrote: > On Thu, April 2, 2009 7:20 pm, Michael R. Wolf wrote:. >> After an hour of digging, I can't find indications (much less an >> answer) on when it's necessary to 'use bigint'. ?In other words, what is >> the moral equivalent of MAXINT, or at least a close approximation >> (disregarding whatever legal fine-print exists) for a back of the >> envelope proof-of-concept design? > > 2**53 pennies = a bit over 90 trillion dollars Probably not big enough any more, not for Zimbabwe, and soon not for the US, either. Heh. From MichaelRWolf at att.net Fri Apr 3 00:41:23 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Fri, 3 Apr 2009 03:41:23 -0400 Subject: SPUG: Working with currency In-Reply-To: References: Message-ID: <9EA0C315-9B3E-4394-BEA3-5D4AE3F95BC2@att.net> On Apr 3, 2009, at 12:22 AM, Andrew Sweger wrote: > On Thu, 2 Apr 2009, Yitzchak Scott-Thoennes wrote: > >> 2**53 pennies = a bit over 90 trillion dollars > > Reference, please? Context? (I mean, just throwing a number like > this out > just doesn't seem fair. 53 bits? That seems... odd.) I wouldn't have known what to look for, but it was easy to find the 53, then do a bit of groping around (with grep) to see some related values.... $ perl -MConfig=config_sh -e 'print config_sh()' | grep '^nv' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' nv_preserves_uv_bits='53' nveformat='"e"' nvfformat='"f"' nvgformat='"g"' nvsize='8' nvtype='double' Snippet from 'perldoc Config': "nv_preserves_uv_bits" From perlxv.U: This variable indicates how many of bits type uvtype a variable nvtype can preserve. $ perl -le 'printf q(%.0f, )x3, (2**53), (2**53)+1, (2**53)-1' 9007199254740992, 9007199254740992, 9007199254740991, It appears that we can add one to 2**53, but can't subtract one from it... -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From jwkrahn at shaw.ca Fri Apr 3 03:35:46 2009 From: jwkrahn at shaw.ca (John W. Krahn) Date: Fri, 03 Apr 2009 03:35:46 -0700 Subject: SPUG: Working with currency In-Reply-To: <9EA0C315-9B3E-4394-BEA3-5D4AE3F95BC2@att.net> References: <9EA0C315-9B3E-4394-BEA3-5D4AE3F95BC2@att.net> Message-ID: <49D5E682.9050402@shaw.ca> Michael R. Wolf wrote: > > On Apr 3, 2009, at 12:22 AM, Andrew Sweger wrote: > >> On Thu, 2 Apr 2009, Yitzchak Scott-Thoennes wrote: >> >>> 2**53 pennies = a bit over 90 trillion dollars >> >> Reference, please? Context? (I mean, just throwing a number like this out >> just doesn't seem fair. 53 bits? That seems... odd.) > > > I wouldn't have known what to look for, but it was easy to find the 53, > then do a bit of groping around (with grep) to see some related values.... > > $ perl -MConfig=config_sh -e 'print config_sh()' | grep '^nv' > nvEUformat='"E"' > nvFUformat='"F"' > nvGUformat='"G"' > nv_preserves_uv_bits='53' > nveformat='"e"' > nvfformat='"f"' > nvgformat='"g"' > nvsize='8' > nvtype='double' Or simply: $ perl -V:nv.* nvEUformat='"E"'; nvFUformat='"F"'; nvGUformat='"G"'; nv_preserves_uv_bits='32'; nveformat='"e"'; nvfformat='"f"'; nvgformat='"g"'; nvsize='8'; nvtype='double'; John -- Those people who think they know everything are a great annoyance to those of us who do. -- Isaac Asimov From MichaelRWolf at att.net Mon Apr 6 06:25:46 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 6 Apr 2009 06:25:46 -0700 Subject: SPUG: Intro to Perl class 4/13-15 in Kent Message-ID: <7722423A-1890-4289-B467-B5FCE18DF008@att.net> I'll be teaching a 3-day intro to Perl class in Kent. If you know anyone who could use such a class, could you introduce them to me? Thanks, Michael -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From MichaelRWolf at att.net Mon Apr 6 11:46:28 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 6 Apr 2009 11:46:28 -0700 Subject: SPUG: Perl class in Kent 4/13-15 Message-ID: I'll be teaching a 3-day intro to Perl class in Kent. If you know anyone who could use such a class, could you introduce them to me? Thanks, Michael -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From amitsett at gmail.com Mon Apr 6 12:39:04 2009 From: amitsett at gmail.com (Amit Sett) Date: Mon, 6 Apr 2009 12:39:04 -0700 Subject: SPUG: Perl class in Kent 4/13-15 In-Reply-To: References: Message-ID: <4d8419da0904061239u5f0f2f52x8871ee77f1277a18@mail.gmail.com> Hi Michael, I can pass it on to friends and based on similar queries in the past the FAQ that prospective students have are cost, location, date and time range, amenities, prerequisites etc.. If you could provide that information that would be great. Regards, Amit On Mon, Apr 6, 2009 at 11:46 AM, Michael R. Wolf wrote: > I'll be teaching a 3-day intro to Perl class in Kent. > > If you know anyone who could use such a class, could you introduce them to > me? > > Thanks, > Michael > > -- > Michael R. Wolf > All mammals learn by playing! > MichaelRWolf at att.net > > > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmeyer at helvella.org Wed Apr 8 14:32:26 2009 From: cmeyer at helvella.org (Colin Meyer) Date: Wed, 8 Apr 2009 14:32:26 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting Message-ID: <20090408213226.GD1748@infula.helvella.org> April 2009 Seattle Perl Users Group (SPUG) Meeting ==================================================== Topic: Effective Debugging Speaker: Josh Jore Meeting Date: Tuesday, 21 April 2009 Meeting Time: 6:30 - 8:30 p.m. Location: Marchex - 4th & Pine Cost: Admission is free and open to the public Info: http://seattleperl.org/ ==================================================== Tuesday, April 21, is the next meeting of the THE SEATTLE PERL USERS GROUP. This Month's Talk My name is Josh Jore, here's the talk description. 15:57 < josh> Is there a SPUG topic yet? 15:59 < josh> or speaker? If not, I'll do it. I'm currently hanging out in perldb, the emacs+debugger marriage and thinking that OMG, why don't I hear people talk about this? "Effective debugging" 16:00 < josh> Unless the talk is supposed to be something like tomorrow because I don't want to have to write the talk in a night. Unless that's a good idea. About Josh Jore Josh is a Perl guy. He does a lot of neat things, some of which you may read about here: http://use.perl.org/~jjore/journal/ Pre-Meeting ================ If you are so inclined, please come to the pre-meeting at the Elephant & Castle pub on 5th & Union. We'll be there from 5-6:19PM. Meeting Location ================ Pizza and Beer will be provided at the meeting. Marchex 413 Pine St, Suite 500 Seattle, WA 98101 The building is just south of Westlake Center. Enter on 4th Avenue, near Pine street. The entry is near the Dog In The Park hotdog stand. http://www.baylis.org/static/marchex.png Due to all of the shopping around us there is plenty of parking available in garages, but it can be hard to find street parking in the evening. See you there! From mark.mertel at yahoo.com Wed Apr 8 15:13:26 2009 From: mark.mertel at yahoo.com (Mark Mertel) Date: Wed, 8 Apr 2009 15:13:26 -0700 (PDT) Subject: SPUG: not a perl question Message-ID: <972718.32784.qm@web50104.mail.re2.yahoo.com> I got asked?to write an algorithm?generating all possibile parenthetical permutations of a string containing a simple arthmetic experssion?(+,-,*). Ran out of time, but ran across the catalan number sequence as the way to do it. Has anybody?done this in perl?? ?--- Mark Mertel 206.441.4663 mark.mertel at yahoo.com http://www.linkedin.com/in/markmertel http://www.seattlejobs.com/13147468 -------------- next part -------------- An HTML attachment was scrubbed... URL: From seasprocket at gmail.com Thu Apr 9 20:52:22 2009 From: seasprocket at gmail.com (seasprocket at gmail.com) Date: Thu, 9 Apr 2009 20:52:22 -0700 Subject: SPUG: Interesting bug using 'map' Message-ID: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> I ran into a bug tonight using 'map' which taught me something about map and raised a further question: my ($fee, $fi, $fo) = map {$fropper ? $fropper->$_ : $glopper->$_} qw/fee fi fo/; The bug arises bc fropper and glopper are not guaranteed to have return values for fee/fi/fo, and bc map evaluates BLOCK in LIST context. So if fee or fi is undefined, you get an empty list which collapses in the final result. Then fi or fo can get assigned to the wrong variable. Here's my question, I can prevent it this way (by ORing with an empty string): my ($fee, $fi, $fo) = map {$fropper ? $fropper->$_ || '' : $glopper->$_ || ''} qw/fee fi fo/; But that's ugly -- is there a cleaner way to avoid this problem? -- ========================== 2People citizen's network for climate action: http://www.2people.org Greater Seattle Climate Dialogues: http://www.climatedialogues.org The Great Warming coalition ========================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyemq at cpan.org Thu Apr 9 22:19:21 2009 From: tyemq at cpan.org (Tye McQueen) Date: Thu, 9 Apr 2009 22:19:21 -0700 Subject: SPUG: Interesting bug using 'map' In-Reply-To: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> Message-ID: On Thu, Apr 9, 2009 at 8:52 PM, wrote: > map evaluates BLOCK in LIST context > But that's ugly -- is there a cleaner way to avoid this problem? > ... map { scalar( ... ) } ... There are also lots of other ways to get scalar context. Speaking of bugs, I consider the fact that the following doesn't fix the problem (at least not in all versions of Perl) to be a Perl bug :) ... map { ( ... )[0] } ... Tye -------------- next part -------------- An HTML attachment was scrubbed... URL: From seasprocket at gmail.com Fri Apr 10 07:46:01 2009 From: seasprocket at gmail.com (seasprocket at gmail.com) Date: Fri, 10 Apr 2009 07:46:01 -0700 Subject: SPUG: Interesting bug using 'map' In-Reply-To: References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> Message-ID: <3d8716b10904100746j704c83e4kf07268fd03b4bad4@mail.gmail.com> On Thu, Apr 9, 2009 at 10:19 PM, Tye McQueen wrote: > On Thu, Apr 9, 2009 at 8:52 PM, wrote: > >> map evaluates BLOCK in LIST context > > > >> But that's ugly -- is there a cleaner way to avoid this problem? >> > > ... map { scalar( ... ) } ... Okay, duh ... thanks for pointing that out. > > > There are also lots of other ways to get scalar context. Speaking of bugs, > I consider the fact that the following doesn't fix the problem (at least not > in all versions of Perl) to be a Perl bug :) > > ... map { ( ... )[0] } ... I was wondering myself why assignment to something like @arr[0] invokes list context. Just a convention, or perhaps some deeper reason? Maybe it is to avoid ambiguities such as @arr[$x..$y] ? > > > Tye > -- ========================== 2People citizen's network for climate action: http://www.2people.org Greater Seattle Climate Dialogues: http://www.climatedialogues.org The Great Warming coalition ========================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From iheffner at gmail.com Fri Apr 10 09:25:22 2009 From: iheffner at gmail.com (Ivan Heffner) Date: Fri, 10 Apr 2009 09:25:22 -0700 Subject: SPUG: Interesting bug using 'map' In-Reply-To: <3d8716b10904100746j704c83e4kf07268fd03b4bad4@mail.gmail.com> References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> <3d8716b10904100746j704c83e4kf07268fd03b4bad4@mail.gmail.com> Message-ID: On Fri, Apr 10, 2009 at 7:46 AM, wrote: > On Thu, Apr 9, 2009 at 10:19 PM, Tye McQueen wrote: >> >> On Thu, Apr 9, 2009 at 8:52 PM, wrote: >>> > I was wondering myself why assignment to something like @arr[0] invokes list > context. Just a convention, or perhaps some deeper reason? Maybe it is to > avoid ambiguities such as @arr[$x..$y] ? > You asked for an array slice (list) when you said @arr[0]. If you want an array element (scalar) use $arr[0]. I believe this is one of the gotchas called out in Learning Perl, but it has been years since I looked through that book. BTW, the array slice you asked for happens to be of length 1, but it is still a slice because you used the @ sigil. Ivan From mark.mertel at yahoo.com Fri Apr 10 11:30:53 2009 From: mark.mertel at yahoo.com (Mark Mertel) Date: Fri, 10 Apr 2009 11:30:53 -0700 (PDT) Subject: SPUG: Interesting bug using 'map' In-Reply-To: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> Message-ID: <522642.33391.qm@web50112.mail.re2.yahoo.com> instead of using map, you could use a hash slice: my ($fee, $fi, $fo) = @{ $fropper || $gropper }{ qw/fee fi fo/ }; --- Mark Mertel 206.441.4663 mark.mertel at yahoo.com http://www.linkedin.com/in/markmertel http://www.seattlejobs.com/13147468 ________________________________ From: "seasprocket at gmail.com" To: spug-list at pm.org Sent: Thursday, April 9, 2009 8:52:22 PM Subject: SPUG: Interesting bug using 'map' I ran into a bug tonight using 'map' which taught me something about map and raised a further question: my ($fee, $fi, $fo) = map {$fropper ? $fropper->$_ : $glopper->$_} qw/fee fi fo/; The bug arises bc fropper and glopper are not guaranteed to have return values for fee/fi/fo, and bc map evaluates BLOCK in LIST context. So if fee or fi is undefined, you get an empty list which collapses in the final result. Then fi or fo can get assigned to the wrong variable. Here's my question, I can prevent it this way (by ORing with an empty string): my ($fee, $fi, $fo) = map {$fropper ? $fropper->$_ || '' : $glopper->$_ || ''} qw/fee fi fo/; But that's ugly -- is there a cleaner way to avoid this problem? -- ========================== 2People citizen's network for climate action: http://www.2people.org Greater Seattle Climate Dialogues: http://www.climatedialogues.org The Great Warming coalition ========================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From MichaelRWolf at att.net Fri Apr 10 11:44:26 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Fri, 10 Apr 2009 11:44:26 -0700 Subject: SPUG: Interesting bug using 'map' In-Reply-To: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> Message-ID: <1C7C7B20-619B-425D-B362-E1CC4AB016DB@att.net> On Apr 9, 2009, at 8:52 PM, seasprocket at gmail.com wrote: > The bug arises bc fropper and glopper are not guaranteed to have > return values for fee/fi/fo, and bc map evaluates BLOCK in LIST > context. So if fee or fi is undefined, you get an empty list which > collapses in the final result. Then fi or fo can get assigned to the > wrong variable. You are describing the documented behavior, not a bug. See 'perldoc -f map' If you don't like the interaction between the existing functions, either rewrite them, or create wrapper functions that return the scalar value that you want to represent 'failure'. That value can be empty string, zero, even undef. From the limited description of your requirements, it sounds like 'return undef' would work for your requirements. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From rjk-spug at tamias.net Fri Apr 10 11:56:47 2009 From: rjk-spug at tamias.net (Ronald J Kimball) Date: Fri, 10 Apr 2009 14:56:47 -0400 Subject: SPUG: Interesting bug using 'map' In-Reply-To: <1C7C7B20-619B-425D-B362-E1CC4AB016DB@att.net> References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> <1C7C7B20-619B-425D-B362-E1CC4AB016DB@att.net> Message-ID: <20090410185647.GA84281@penkwe.pair.com> On Fri, Apr 10, 2009 at 11:44:26AM -0700, Michael R. Wolf wrote: > > On Apr 9, 2009, at 8:52 PM, seasprocket at gmail.com wrote: > > >The bug arises bc fropper and glopper are not guaranteed to have > >return values for fee/fi/fo, and bc map evaluates BLOCK in LIST > >context. So if fee or fi is undefined, you get an empty list which > >collapses in the final result. Then fi or fo can get assigned to the > >wrong variable. > > You are describing the documented behavior, not a bug. It's a bug using map, not a bug in map. Ronald From mail.spammagnet at gmail.com Fri Apr 10 12:40:51 2009 From: mail.spammagnet at gmail.com (BenRifkah Bergsten-Buret) Date: Fri, 10 Apr 2009 12:40:51 -0700 Subject: SPUG: Interesting bug using 'map' In-Reply-To: <522642.33391.qm@web50112.mail.re2.yahoo.com> References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> <522642.33391.qm@web50112.mail.re2.yahoo.com> Message-ID: On Fri, Apr 10, 2009 at 11:30 AM, Mark Mertel wrote: > instead of using map, you could use a hash slice: > my ($fee, $fi, $fo) = @{ $fropper || $gropper }{ qw/fee fi fo/ }; > Not exactly. I thought of this as well and it seems you might get a tiny performance gain doing it this way since the existence of $fropper is only evaluated once. Looking more closely I realized that the OP is doing method calls "$fropper->$_" instead of hash lookups "$fropper->{$_}". A slice in this case would only work if you had these objects tied to a hash class that overloaded FETCH with a method call. I imagine that would incur a performance penalty. The fact that these are method calls is the reason that Phil is running into the scalar vs. list context issue. A hash look-up have this problem. If I knew there were a ton of methods to be called I might do this: my $opper = $fropper || $glopper; my ($fee, $fi, $fo, ...) = map {scalar($opper->$_)} qw/fee fi fo .../; Of course, if calling any of these methods on $glopper has the side effect of changing the existence of $fropper then this won't give you the same result as in Phil's example. -- Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From seasprocket at gmail.com Sat Apr 11 13:26:48 2009 From: seasprocket at gmail.com (seasprocket at gmail.com) Date: Sat, 11 Apr 2009 13:26:48 -0700 Subject: SPUG: Interesting bug using 'map' In-Reply-To: References: <3d8716b10904092052k195a6026t7930a020720a41ff@mail.gmail.com> <522642.33391.qm@web50112.mail.re2.yahoo.com> Message-ID: <3d8716b10904111326s47e8d4eay173fc3a805431cf6@mail.gmail.com> On Fri, Apr 10, 2009 at 12:40 PM, BenRifkah Bergsten-Buret < mail.spammagnet at gmail.com> wrote: > Looking more closely I realized that the OP is doing method calls > "$fropper->$_" instead of hash lookups "$fropper->{$_}". A slice in this > case would only work if you had these objects tied to a hash class that > overloaded FETCH with a method call. I imagine that would incur a > performance penalty. > > The fact that these are method calls is the reason that Phil is running > into the scalar vs. list context issue. A hash look-up have this problem. > Ben, thanks for noticing this ... I had to do a little research to make sense of this point. An nonexistent hash element always returns undef, but an empty return statement returns () in list context. Thanks to everybody who replied! I learned a bunch in this thread!! Phil -- > Ben > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > -- ========================== 2People citizen's network for climate action: http://www.2people.org Greater Seattle Climate Dialogues: http://www.climatedialogues.org The Great Warming coalition ========================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at consultix-inc.com Tue Apr 21 11:17:36 2009 From: tim at consultix-inc.com (Tim Maher) Date: Tue, 21 Apr 2009 11:17:36 -0700 Subject: SPUG: Seattle Classes on DBI and other Perl Topics In-Reply-To: <20090408213226.GD1748@infula.helvella.org> References: <20090408213226.GD1748@infula.helvella.org> Message-ID: <20090421181736.GA6545@jumpy.consultix-inc.com> From: Tim Maher, Consultix Re: Spring and Summer Training Classes in Seattle In addition to our usual offerings of popular classes on UNIX, Linux, and Perl topics, we've got something extra special for Spring! Colin Meyer, ace Perl programmer and recognized expert on Database and Web programming, will be teaching his 3-day "Database Programming with Perl" class in early June. A brief description of this class follows after our full schedule of Seattle public classes, which is provided below. You'll find links to other Consultix resources and services further down. Best wishes, -Tim Maher (206) 781-8649 -------------------------------------------------------------- Spring and Summer Training Classes in Seattle from Consultix -------------------------------------------------------------- TITLE DATES Days Discount Deadline UNIX/Linux Fundamentals 5/26-05/29 4 4/24 *Perl Database Prog. 6/02-06/04 3 5/01 Perl Programming 7/06-07/08 3 6/05 Perl Modules 7/09-07/10 1.5 6/05 Shell Programming 7/13-07/15 3 6/12 UNIX/Linux Utilities 7/16-07/17 2 6/12 Intermediate Perl 7/21-07/23 3 6/19 !UNIX/Linux Fundamentals 8/17-08/20 4 7/17 !Perl Programming 8/24-08/26 3 7/24 !Perl Modules 8/27-08/28 1.5 7/24 -------------------------------------------------------------- * Taught by Colin Meyer; all other classes taught by Dr Tim Maher. ! Tentative dates; not yet accepting registrations. -------------------------------------------------------------- ** DATABASE PROGRAMMING with PERL ** A hands-on Training Course by Colin Meyer Presented by Consultix www.TeachMePerl.com The Perl "DBI" (database interface) approach to database programming allows one to write generic database-access programs that can interface with any of the popular database management systems (Oracle, Sybase, MySQL, etc.). Once the program is written, it's no big deal if the underlying database is subsequently changed from one type to another, because the DBI module insulates the programmer's code from most of the database-specific details anyway. This makes Perl a very effective and efficient platform for database programming, which is one reason why the language is so popular. This course is by local expert Colin Meyer, a well known member of the Seattle Perl Users Group, who has years of production-level Perl DBI/CGI experience with well-known high-tech companies. For example, Colin has worked on the databases for the websites of US West, Geospiza, and Whitepages.com, as well as those for the 2002 Winter Olympics. Most importantly, he's an easy-going guy who likes to share his knowledge and is really good at doing so! However, he rarely gets a chance to teach this popular class that he created, so if you want to learn about database programming with Perl from an expert, you'll want to seize this opportunity to do so. For more details on this course, see http://TeachMePerl.com/dbi.html, or contact Tim Maher, tim at TeachMePerl.com. CONSULTIX ON-LINE RESOURCES General Information: http://www.consultix-inc.com Course Listings: Perl, http://TeachMePerl.com/perllist.html UNIX/Shell, http://TeachMeUnix.com/unixlist.html Course descriptions: http://consultix-inc.com/sched.html On-Site Training: http://www.consultix-inc.com/on-site.html Tutoring: http://www.consultix-inc.com/tutoring.html Prices and Registration: http://www.consultix-inc.com/reg.txt http://www.consultix-inc.com/cgibin/register.cgi Instructor Evaluations: http://www.consultix-inc.com/testimonials.html Don't learn too much! Get Tim's "Minimal Perl" book: http://MinimalPerl.com *----------------------------------------------------------------------* | Tim Maher, PhD (206) 781-UNIX http://www.consultix-inc.com | | tim at ( TeachMePerl, TeachMeLinux, or TeachMeUnix ) dot Com | ! *CLASSES: 6/2: Perl Databases w/DBI 5/26: UNIX/Linux Fundamentals | | 7/6: Basic Perl 7/13: Korn/Bash Shell 7/21: Intermed. Perl | *-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- | > "Minimal Perl for UNIX People" has been an Amazon Best Seller! < | | * Download chapters, read reviews, and order at: MinimalPerl.com * | *----------------------------------------------------------------------* From twists at gmail.com Tue Apr 21 13:40:03 2009 From: twists at gmail.com (Joshua ben Jore) Date: Tue, 21 Apr 2009 13:40:03 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: <20090408213226.GD1748@infula.helvella.org> References: <20090408213226.GD1748@infula.helvella.org> Message-ID: Hey perlarinos, I wrote a nifty talk for you all. Here are the slides. There will also be a movie. http://diotalevi.isa-geek.net/~josh/090421/Effective%20Debugging.pdf Josh From seasprocket at gmail.com Tue Apr 21 13:49:44 2009 From: seasprocket at gmail.com (seasprocket at gmail.com) Date: Tue, 21 Apr 2009 13:49:44 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: References: <20090408213226.GD1748@infula.helvella.org> Message-ID: <3d8716b10904211349v1ac20a48y449d14b3c42800f7@mail.gmail.com> Is there a number to call, for those who might have to arrive late? On Tue, Apr 21, 2009 at 1:40 PM, Joshua ben Jore wrote: > Hey perlarinos, I wrote a nifty talk for you all. Here are the slides. > There will also be a movie. > > http://diotalevi.isa-geek.net/~josh/090421/Effective%20Debugging.pdf > > Josh > _____________________________________________________________ > Seattle Perl Users Group Mailing List > POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > MEETINGS: 3rd Tuesdays > WEB PAGE: http://seattleperl.org/ > -- ========================== 2People citizen's network for climate action: http://www.2people.org Greater Seattle Climate Dialogues: http://www.climatedialogues.org The Great Warming coalition ========================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at baylis.org Tue Apr 21 14:02:11 2009 From: steve at baylis.org (Steve Baylis) Date: Tue, 21 Apr 2009 14:02:11 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: <3d8716b10904211349v1ac20a48y449d14b3c42800f7@mail.gmail.com> References: <20090408213226.GD1748@infula.helvella.org> <3d8716b10904211349v1ac20a48y449d14b3c42800f7@mail.gmail.com> Message-ID: <314ddcbf0904211402yf9b8f64y4f6e816a5883798f@mail.gmail.com> On Tue, Apr 21, 2009 at 1:49 PM, wrote: > Is there a number to call, for those who might have to arrive late? > Yes. 425-533-2964. -Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.mertel at yahoo.com Tue Apr 21 16:00:28 2009 From: mark.mertel at yahoo.com (Mark Mertel) Date: Tue, 21 Apr 2009 16:00:28 -0700 (PDT) Subject: SPUG: PAUSE id Message-ID: <901234.33072.qm@web50110.mail.re2.yahoo.com> generally,?once a request for a PAUSE id has been submitted what is the process, and how long can it be expected to take? thanks ?--- Mark Mertel 206.441.4663 mark.mertel at yahoo.com http://www.linkedin.com/in/markmertel http://www.seattlejobs.com/13147468 -------------- next part -------------- An HTML attachment was scrubbed... URL: From breno at rio.pm.org Tue Apr 21 16:25:38 2009 From: breno at rio.pm.org (breno) Date: Tue, 21 Apr 2009 20:25:38 -0300 Subject: SPUG: PAUSE id In-Reply-To: <901234.33072.qm@web50110.mail.re2.yahoo.com> References: <901234.33072.qm@web50110.mail.re2.yahoo.com> Message-ID: About a week, sometimes less... Cheers, -b On Tue, Apr 21, 2009 at 8:00 PM, Mark Mertel wrote: > generally,?once a request for a PAUSE id has been submitted what is the > process, and how long can it be expected to take? > > thanks > > --- > Mark Mertel > 206.441.4663 > mark.mertel at yahoo.com > http://www.linkedin.com/in/markmertel > http://www.seattlejobs.com/13147468 > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > ? ? POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > ? ?MEETINGS: 3rd Tuesdays > ? ?WEB PAGE: http://seattleperl.org/ > From twists at gmail.com Tue Apr 21 16:38:10 2009 From: twists at gmail.com (Joshua ben Jore) Date: Tue, 21 Apr 2009 16:38:10 -0700 Subject: SPUG: PAUSE id In-Reply-To: References: <901234.33072.qm@web50110.mail.re2.yahoo.com> Message-ID: On Tue, Apr 21, 2009 at 4:25 PM, breno wrote: > About a week, sometimes less... It's a manual process done by the CPAN administrators. If you need to go faster, there is always module-authors@ Josh From brian.wisti at gmail.com Tue Apr 21 16:07:55 2009 From: brian.wisti at gmail.com (Brian Wisti) Date: Tue, 21 Apr 2009 16:07:55 -0700 Subject: SPUG: PAUSE id In-Reply-To: <901234.33072.qm@web50110.mail.re2.yahoo.com> References: <901234.33072.qm@web50110.mail.re2.yahoo.com> Message-ID: Once it's submitted, tiny gerbils bring it to the attention of important people who review your application. Approval is quick, but because the gerbils tire easily you might not learn if your submission was accepted for a week or two. But if you anger the gerbils on their return journey you will promptly get a huge workload which completely neutralizes any opportunity to write fun Perl code for a minimum of six months. Well ... something like that. That's how it seemed to work for me, anyways. You should get your approval within a couple of weeks. Kind Regards, Brian Wisti http://coolnamehere.com/ On Tue, Apr 21, 2009 at 4:00 PM, Mark Mertel wrote: > > generally,?once a request for a PAUSE id has been submitted what is the process, and how long can it be expected to take? > > thanks > > --- > Mark Mertel > 206.441.4663 > mark.mertel at yahoo.com > http://www.linkedin.com/in/markmertel > http://www.seattlejobs.com/13147468 > > _____________________________________________________________ > Seattle Perl Users Group Mailing List > ? ? POST TO: spug-list at pm.org > SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list > ? ?MEETINGS: 3rd Tuesdays > ? ?WEB PAGE: http://seattleperl.org/ From sthoenna at efn.org Tue Apr 21 21:43:53 2009 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Tue, 21 Apr 2009 21:43:53 -0700 (PDT) Subject: SPUG: copy-on-write shared memory on linux Message-ID: <61497.97.113.118.106.1240375433.squirrel@webmail.efn.org> There's some discussion of this here: http://search.cpan.org/perldoc/Apache2::SizeLimit#linux The perl module to read the smaps file (not necessarily as efficiently as possible, if that matters) is: http://search.cpan.org/perldoc/Linux::Smaps From MichaelRWolf at att.net Wed Apr 22 10:49:43 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed, 22 Apr 2009 10:49:43 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: References: <20090408213226.GD1748@infula.helvella.org> Message-ID: <5F30F235-8A43-4999-B8BC-CCE80E8414CA@att.net> On Apr 21, 2009, at 1:40 PM, Joshua ben Jore wrote: > Hey perlarinos, I wrote a nifty talk for you all. Here are the slides. > There will also be a movie. > > http://diotalevi.isa-geek.net/~josh/090421/Effective%20Debugging.pdf The movie was great!!! The talk was great!!! And the pictures in the transitions.... well, you get the idea. And they even elicited the laughs of a little girl in the audience. (An effective technique for creating a talk that was effective at many levels.) -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From MichaelRWolf at att.net Wed Apr 22 10:54:17 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed, 22 Apr 2009 10:54:17 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: <3d8716b10904211349v1ac20a48y449d14b3c42800f7@mail.gmail.com> References: <20090408213226.GD1748@infula.helvella.org> <3d8716b10904211349v1ac20a48y449d14b3c42800f7@mail.gmail.com> Message-ID: <1851836E-88AA-4062-8758-2FCA34C47A2D@att.net> On Apr 21, 2009, at 1:49 PM, seasprocket at gmail.com wrote: > Is there a number to call, for those who might have to arrive late? In case others are worried about getting locked out, the number has been posted on the front door, so there's no need to worry about forgetting to print it out before rushing out the door to get to the meeting. This is a great idea, especially since the woman at the front door oscillates between a receptionist and a guard, a tough position for her since she's *paid* to be a guard. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From cjac at colliertech.org Wed Apr 22 11:49:05 2009 From: cjac at colliertech.org (C.J. Adams-Collier) Date: Wed, 22 Apr 2009 11:49:05 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: <5F30F235-8A43-4999-B8BC-CCE80E8414CA@att.net> References: <20090408213226.GD1748@infula.helvella.org> <5F30F235-8A43-4999-B8BC-CCE80E8414CA@att.net> Message-ID: <20090422184905.GO20515@colliertech.org> On Wed, Apr 22, 2009 at 10:49:43AM -0700, Michael R. Wolf wrote: > And they even elicited the laughs of a little girl in the audience. > (An effective technique for creating a talk that was effective at > many levels.) Scarlet had an excellent time. The LOLCat slides were appreciated the most :) Sorry if we interrupted the talk more than appropriate. Feel free to flame me off-list for bringing a kid to an adult play date! > Michael R. Wolf Cheers, C.J. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From MichaelRWolf at att.net Wed Apr 22 14:43:30 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Wed, 22 Apr 2009 14:43:30 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: <20090422184905.GO20515@colliertech.org> References: <20090408213226.GD1748@infula.helvella.org> <5F30F235-8A43-4999-B8BC-CCE80E8414CA@att.net> <20090422184905.GO20515@colliertech.org> Message-ID: On Apr 22, 2009, at 11:49 AM, C.J. Adams-Collier wrote: > On Wed, Apr 22, 2009 at 10:49:43AM -0700, Michael R. Wolf wrote: > >> And they even elicited the laughs of a little girl in the audience. >> (An effective technique for creating a talk that was effective at >> many levels.) > > Scarlet had an excellent time. The LOLCat slides were appreciated > the most :) > > Sorry if we interrupted the talk more than appropriate. Feel free to > flame me off-list for bringing a kid to an adult play date! Au contrare... I think that our culture has too many mono-cultures. I think it's great to acknowledge that life isn't a balance of opposites as much as it is an integration of multiplicities. Some cultures would say "EITHER come to the meeting OR spend time with your daughter". I love that our could find a way for you to do BOTH!!! I think everyone benefited by you both attending. You and Scarlet reminded me of the Wall Family at OSCON I once asked one of his daughters (privately - to avoid bias) what she got out of attending. She said that she enjoyed many of the talks and also the opportunity to spend family time. It was, to my opinion, a genuine answer. I'd seen her grow up over the few OSCON's I'd been to, from a youngster to an engaged-to-be-married young woman. Perhaps I wax poetic about women and Perl, but does anyone else remember Larry's State of the Onion address (a talk that's BOTH never about Perl and always about Perl) where he started the talk with a picture of his first grandkid, then talked about the phases of his children's lives from being cute but helpless through mid-life, knowing that they'd again move toward old age and helplessness. In his short nod to Perl, he likened it to one of his daughters -- not as cute (for the childish definition of cute) as she had been as a young girl, but nevertheless in mid-life, strong, confident, competent, working the issues that make a family/culture/world work, with a long run ahead of her before decrepitude and the reverence of post-middle-age. In other nods, he casually mentioned other languages in phases that Perl's already mastered or may eventually enter. You can fill in the languages and phases here..... On another Wall-ism, I once asked Gloria (Larry's wife) about a point that Larry had made in a lecture. It bordered on the "Technology of Perl" and the "Culture of Perl". (Gloria knows *lots* of Perl by osmosis, and by her interest in linguistics and community-building. They're not partnered by accident.) As a follow-up, I asked her "What's more important about Perl: the language or the culture". Without hesitating, she gave me an answer that seemed at once deeply rooted in her human linguistic studies and also deeply appropriate to Perl5/Perl6 -- "You can't separate a language from its culture". Thanks for BOTH attending. I like what it says about our culture. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From twists at gmail.com Wed Apr 22 23:01:59 2009 From: twists at gmail.com (Joshua ben Jore) Date: Wed, 22 Apr 2009 23:01:59 -0700 Subject: SPUG: April 2009 Seattle Perl Users Group (SPUG) Meeting In-Reply-To: <20090422184905.GO20515@colliertech.org> References: <20090408213226.GD1748@infula.helvella.org> <5F30F235-8A43-4999-B8BC-CCE80E8414CA@att.net> <20090422184905.GO20515@colliertech.org> Message-ID: On Wed, Apr 22, 2009 at 11:49 AM, C.J. Adams-Collier wrote: > On Wed, Apr 22, 2009 at 10:49:43AM -0700, Michael R. Wolf wrote: > >> And they even elicited the laughs of a little girl in the audience. >> (An effective technique for creating a talk that was effective at >> many levels.) > > Scarlet had an excellent time. ?The LOLCat slides were appreciated the most :) > > Sorry if we interrupted the talk more than appropriate. ?Feel free to > flame me off-list for bringing a kid to an adult play date! No, if she's ok with it, bring her more often. I think the odds of getting kid-friendly talks is kind of low though. :-( Heck, many aren't even adult-friendly. On that note... going perpendicular, have the rest of you seen zrusila's slides from YAPC NA 2008's lightning talks? If not, http://www.slideshare.net/zrusilla/pulp-perl. Josh From MichaelRWolf at att.net Sun Apr 26 12:50:17 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Sun, 26 Apr 2009 12:50:17 -0700 Subject: SPUG: debug("Read The $_ Manual") foreach ; Message-ID: At the meeting earlier last week, the first step of good debugging was to RTFM. I just happened across an appropriate quote... Documentation is worth it just to be able to answer all your mail with 'RTFM' -- Alan Cox (heavily involved in Linux kernel development) Of course, this ability to defer questions to the documentation only works when 'f' maps to 'fine'. The obscene mapping of 'f' is ambiguous: poor code or merely poor documentation. Either way, it can't (yet) be considered a fine package. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From cmeyer at helvella.org Sun Apr 26 22:18:40 2009 From: cmeyer at helvella.org (Colin Meyer) Date: Sun, 26 Apr 2009 22:18:40 -0700 Subject: SPUG: debug("Read The $_ Manual") foreach ; In-Reply-To: References: Message-ID: <20090427051840.GE2364@infula.helvella.org> On Sun, Apr 26, 2009 at 12:50:17PM -0700, Michael R. Wolf wrote: [...] > > Of course, this ability to defer questions to the documentation only > works when 'f' maps to 'fine'. > > The obscene mapping of 'f' is ambiguous: poor code or merely poor > documentation. Either way, it can't (yet) be considered a fine package. Being a huge fan of fucking, I've always thought that the 'f' referred to the awesomeness of the docuementation. -Colin. From MichaelRWolf at att.net Mon Apr 27 11:55:15 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 27 Apr 2009 11:55:15 -0700 Subject: SPUG: debug("Read The $_ Manual") foreach ; In-Reply-To: <200904270139.03665.m3047@inwa.net> References: <20090427051840.GE2364@infula.helvella.org> <200904270139.03665.m3047@inwa.net> Message-ID: <3A622E5F-CD13-4245-BEDA-3081BC6C6657@att.net> On Apr 27, 2009, at 1:39 AM, Fred Morris wrote: > > I have come to the conclusion that there is a huge difference > between being an > asshole and being a pain in the ass. Some grammars might use the terms 'object' and 'actor' in this discussion of active verbs. > Why doesn't a politician run on the "Pro Fucking" platform? How > would they > solve the "pain in the ass" problem? The politicians that do, call it 'pro-sex' or 'sex-positive'. In those worlds, there are no prostitutes, only sex workers, attempting to decriminalize sex just like we decriminalized booze a century-or-so ago. If you want to go beyond politics to religion, there are certainly sex- positive religions. Really, even here in Seattle. Catholics have confessional booths. The booths at these sex-positive temples (yes, temples) have a more body-centered "Oh God!" connection going on. And, just to make sure that this isn't TOO far OT, there *is* an open source sex podcast, though it's been inactive lately. The sex community has many of the same issues with access to it's content/ performance as us (e.g. Digital Rights, and Open Source, and Creative Commons, and Free Software). They say "free as in 'free speech'", too. Perhaps *we* should disambiguate 'free' with "Free as in sex speech. Free as in sex acts." Beer is overrated. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From MichaelRWolf at att.net Mon Apr 27 14:53:11 2009 From: MichaelRWolf at att.net (Michael R. Wolf) Date: Mon, 27 Apr 2009 14:53:11 -0700 Subject: SPUG: Apology for OT discussion Message-ID: <66087EB5-3B5C-4C2C-B512-CE35B1F5E722@att.net> My apologies to the group for a tangential discussion. I'll keep this message short: I'm sorry. -- Michael R. Wolf All mammals learn by playing! MichaelRWolf at att.net From jobs-noreply at seattleperl.org Wed Apr 29 12:49:01 2009 From: jobs-noreply at seattleperl.org (SPUG Jobs) Date: Wed, 29 Apr 2009 12:49:01 -0700 (PDT) Subject: SPUG: JOB: contract, telecommute, Demand Media Message-ID: I'm looking for a contractor to help "productize" and extend a skunkworks project I've been working on here at Demand Media. Let me know if you're interested and available to start. Note that the job description mentions a commitment of 40 hours/week for a month. I am skeptical it will actually require that much time. My guess would be more like 20 hours per week for the first week or two, then 10-15 per week after that, with a longer overall duration (I expect the business team running this to continue to want changes and improvements made indefinitely). Kevin Fink Contact me: kevin {at} demandmedia.com Contract Software Developer Demand Media Overview: Every day Demand Media makes it possible for people to create and publish valuable content for millions of Internet users to engage around passionate communities, and for thousands of websites to grow with content and social media features their audiences want. Get involved with the company that is redefining the content and social media landscape! As a contractor with Demand Media you can build your skills and work with a group of motivated and intelligent individuals and collaborate with some of the most revolutionary leaders in the content and social media industry. Demand Media team members are energized by their ability to work in a fast paced, highly flexible environment where their decisions can have a positive effect on the company?s bottom line! Our team members enjoy a diverse environment with infinite opportunity. We're looking for ambitious, driven, self-starters who want to be on the leading edge of developing technology and the content and social media evolution. Position Summary: We are looking for someone to take over primary development responsibility for a critical component of our Content on Domains initiative. The current working prototype creates templates for content-driven web sites based on static configuration files and an XML feed of articles. It also interacts with the Google Webmaster API for site verification, sitemap submission, and error checking. It is written in Perl and Bash. The first phase of additional development will focus on cleaning up the existing system, adding better error handling, improving diagnostics, and potentially moving the configuration information into a database. Subsequent phases will include integrating with a Google Search Appliance (or other site-search facility), moving from static configuration files to a database, creating and/or modifying configuration information via interaction with external APIs, creating new template types and layouts, etc. This position will require some in-person meetings in Bellevue WA and potentially some travel to Santa Monica CA and/or Austin TX, but most of the work can be done via telecommuting if desired. Qualifications: - 5+ years experience developing database-backed web applications using Perl - Module development - Database design - MySQL/PostgreSQL/MS SQL/DBM/GDBM/etc - DBI/DBD and tied hashes - Experience consuming web services and APIs - LWP - XML::Simple - Strong knowledge of HTML and CSS - Excellent communication skills - Up-beat, can-do attitude Desired Skills: - Good understanding of and experience with SEO and site analytics - Experience integrating/implementing site search - Experience working with large-scale template-driven website creation - Experience integrating various forms of 3rd party advertising (Google Adsense, Kontera, etc) into websites - Experience with AJAX & Javascript We Offer: - Contractor position. Expected commitment of 40 hours / week. Timeframe TBD but initial expectation is for at least 1 month of dedicated work. - Energetic, focused, and collaborative work environment