From rjbs-perl-abe at lists.manxome.org Thu Jun 1 19:36:20 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 1 Jun 2006 22:36:20 -0400 Subject: [ABE.pm] June Perl Mongering! Message-ID: <20060602023620.GD18496@zodiac.codesimply.com> Frankly, I think our last get-together was heapum good times. We said that "first Wednesdays" seemed like a good plan, and I'm all for sticking to it. i think Faber said he couldn't make it, so that's all the more reason to show up: we can talk about him behind his back! There will be beer -- potentially as cheap as last time -- and fried food and shop talk. Who can resist? Without objection, I'll see you folks at McGrady's on this coming Wednesday, June 7, at 18:30! -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060601/b346cfbd/attachment.bin From rjbs-perl-abe at lists.manxome.org Thu Jun 1 19:36:45 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 1 Jun 2006 22:36:45 -0400 Subject: [ABE.pm] Perl Hacks Message-ID: <20060602023645.GE18496@zodiac.codesimply.com> FWIW, Perl Hacks is out. I got my copy yesterday. So far, it looks like a neat little book. More about it soon! -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060601/5633539a/attachment.bin From fiedlert at gmail.com Fri Jun 2 03:59:26 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Fri, 2 Jun 2006 06:59:26 -0400 Subject: [ABE.pm] June Perl Mongering! In-Reply-To: <20060602023620.GD18496@zodiac.codesimply.com> References: <20060602023620.GD18496@zodiac.codesimply.com> Message-ID: <814422ce0606020359u6a208f3ep74d83afb795688a7@mail.gmail.com> Im going to try to make it - where is McGrady's? On 6/1/06, Ricardo SIGNES wrote: > > Frankly, I think our last get-together was heapum good times. We said that > "first Wednesdays" seemed like a good plan, and I'm all for sticking to it. i > think Faber said he couldn't make it, so that's all the more reason to show up: > we can talk about him behind his back! > > There will be beer -- potentially as cheap as last time -- and fried food and > shop talk. Who can resist? > > Without objection, I'll see you folks at McGrady's on this coming Wednesday, > June 7, at 18:30! > > -- > rjbs > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (GNU/Linux) > > iD8DBQFEf6Qk5IEwYcR13KMRAqMVAKCBhFT7KuKjY8P6FG7PdZMQYfidigCggHWz > soiM/ZjcMI8zzqJ/7Rvm5WA= > =zZTG > -----END PGP SIGNATURE----- > > > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > > -- Adhere to your own act, and congratulate yourself if you have done something strange and extravagant, and broken the monotony of a decorous age. -- Ralph Waldo Emerson From fiedlert at gmail.com Fri Jun 2 03:59:26 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Fri, 2 Jun 2006 06:59:26 -0400 Subject: [ABE.pm] June Perl Mongering! In-Reply-To: <20060602023620.GD18496@zodiac.codesimply.com> References: <20060602023620.GD18496@zodiac.codesimply.com> Message-ID: <814422ce0606020359u6a208f3ep74d83afb795688a7@mail.gmail.com> Im going to try to make it - where is McGrady's? On 6/1/06, Ricardo SIGNES wrote: > > Frankly, I think our last get-together was heapum good times. We said that > "first Wednesdays" seemed like a good plan, and I'm all for sticking to it. i > think Faber said he couldn't make it, so that's all the more reason to show up: > we can talk about him behind his back! > > There will be beer -- potentially as cheap as last time -- and fried food and > shop talk. Who can resist? > > Without objection, I'll see you folks at McGrady's on this coming Wednesday, > June 7, at 18:30! > > -- > rjbs > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (GNU/Linux) > > iD8DBQFEf6Qk5IEwYcR13KMRAqMVAKCBhFT7KuKjY8P6FG7PdZMQYfidigCggHWz > soiM/ZjcMI8zzqJ/7Rvm5WA= > =zZTG > -----END PGP SIGNATURE----- > > > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > > -- Adhere to your own act, and congratulate yourself if you have done something strange and extravagant, and broken the monotony of a decorous age. -- Ralph Waldo Emerson From rjbs-perl-abe at lists.manxome.org Fri Jun 2 05:20:45 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Fri, 2 Jun 2006 08:20:45 -0400 Subject: [ABE.pm] June Perl Mongering! In-Reply-To: <814422ce0606020359u6a208f3ep74d83afb795688a7@mail.gmail.com> References: <20060602023620.GD18496@zodiac.codesimply.com> <814422ce0606020359u6a208f3ep74d83afb795688a7@mail.gmail.com> Message-ID: <20060602122045.GB4244@knight.local> * Ted Fiedler [2006-06-02T06:59:26] > Im going to try to make it - where is McGrady's? http://maps.google.com/maps?f=q&hl=en&q=117+e.+3rd+st,+bethlehem,+pa&ll=40.612584,-75.376897&spn=0.01453,0.038023&om=1 It's on 3rd Street in south Bethlehem, just east of New Street, across the street from the strip mall with a Rite Aid in it. -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060602/32b1744f/attachment.bin From faber at linuxnj.com Fri Jun 2 15:04:44 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Fri, 2 Jun 2006 18:04:44 -0400 Subject: [ABE.pm] June Perl Mongering! In-Reply-To: <20060602023620.GD18496@zodiac.codesimply.com> References: <20060602023620.GD18496@zodiac.codesimply.com> Message-ID: <20060602220444.GC8707@neptune.faber.nom> On 01/06/06 22:36 -0400, Ricardo SIGNES wrote: > > Frankly, I think our last get-together was heapum good times. We said that > "first Wednesdays" seemed like a good plan, and I'm all for sticking to it. Sounds good to me! > I think Faber said he couldn't make it, so that's all the more reason to show up: > we can talk about him behind his back! Hey! In that case, I'll have to send in a spy; someone to take notes and all that. Be careful what you say in front of any new people. You never know... > Without objection, I'll see you folks at McGrady's on this coming Wednesday, > June 7, at 18:30! And if a miracle occurs, I'll be there as well! -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From faber at linuxnj.com Fri Jun 2 15:05:57 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Fri, 2 Jun 2006 18:05:57 -0400 Subject: [ABE.pm] June Perl Mongering! In-Reply-To: <814422ce0606020359u6a208f3ep74d83afb795688a7@mail.gmail.com> References: <20060602023620.GD18496@zodiac.codesimply.com> <814422ce0606020359u6a208f3ep74d83afb795688a7@mail.gmail.com> Message-ID: <20060602220557.GD8707@neptune.faber.nom> On 02/06/06 06:59 -0400, Ted Fiedler wrote: > Im going to try to make it - where is McGrady's? And everyone wonders, "Could this be Faber's spy?" Hmmmm... -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From tfreedman at iqep.com Sat Jun 3 05:48:15 2006 From: tfreedman at iqep.com (Tom Freedman) Date: Sat, 3 Jun 2006 08:48:15 -0400 Subject: [ABE.pm] June Perl Mongering! References: <20060602023620.GD18496@zodiac.codesimply.com> Message-ID: <488856AE33F91F4A881EA12F52DDC8C620165C@inbtmail1.group.iqep.com> I'll be there, but probably not until ~8 or 8:30. Seeing as we were there until almost 10 last time, I'm hoping you'll still be hanging out. -Tom ________________________________ From: abe-pm-bounces+tfreedman=iqep.com at pm.org on behalf of Ricardo SIGNES Sent: Thu 6/1/2006 10:36 PM To: abe-pm at mail.pm.org Subject: [ABE.pm] June Perl Mongering! Without objection, I'll see you folks at McGrady's on this coming Wednesday, June 7, at 18:30! -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 3566 bytes Desc: not available Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060603/b561c9f4/attachment.bin From rjbs-perl-abe at lists.manxome.org Wed Jun 7 11:34:06 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 7 Jun 2006 14:34:06 -0400 Subject: [ABE.pm] see you (who?) tonight Message-ID: <20060607183406.GF18496@zodiac.codesimply.com> So, I'll try to be at McGrady's around 18:30, tonight. I know Tom should be there, but late. John is waffling, as he had emergency oral surgery today. Is that an excuse? Not if you ask me! I mean... McGrady's has ice cream! Faber said he's probably not showing up. So... Ted? Michael? Jim? Stephen? If no one is planning to be on time, I will hang out outside or across the street so that I'm not the one weird-o taking a big table for a half hour while I wait for the rest of my party, drinking too much. If you'll be on time, let me know and I'll just head in. Side note: I was told that sending mail to abe at pm.org was causing weird reply-to problems, since the reply-to got written to be @mail.pm.org. I don't want to type the extra five characters, so I've updaed mailman to use abe at pm.org as the reply-to. Let me know if there are further problems. -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060607/80d97025/attachment.bin From fiedlert at gmail.com Wed Jun 7 14:20:51 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Wed, 7 Jun 2006 17:20:51 -0400 Subject: [ABE.pm] see you (who?) tonight In-Reply-To: <20060607183406.GF18496@zodiac.codesimply.com> References: <20060607183406.GF18496@zodiac.codesimply.com> Message-ID: <814422ce0606071420y7f60bf48m6e4bd2f50f25f091@mail.gmail.com> I am going to try to make it - I will be late - probably about 8:00 if thats OK. Ted On 6/7/06, Ricardo SIGNES wrote: > > So, I'll try to be at McGrady's around 18:30, tonight. I know Tom should be > there, but late. John is waffling, as he had emergency oral surgery today. Is > that an excuse? Not if you ask me! I mean... McGrady's has ice cream! Faber > said he's probably not showing up. > > So... Ted? Michael? Jim? Stephen? If no one is planning to be on time, I > will hang out outside or across the street so that I'm not the one weird-o > taking a big table for a half hour while I wait for the rest of my party, > drinking too much. If you'll be on time, let me know and I'll just head in. > > Side note: I was told that sending mail to abe at pm.org was causing weird > reply-to problems, since the reply-to got written to be @mail.pm.org. I don't > want to type the extra five characters, so I've updaed mailman to use > abe at pm.org as the reply-to. Let me know if there are further problems. > > -- > rjbs > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (GNU/Linux) > > iD8DBQFEhxwe5IEwYcR13KMRAm1KAJ9UaHGDKMBWR13B/Q0QM348b56J4wCggsLs > K/QDqvPhJNbRwDFykQNavD8= > =Q9OD > -----END PGP SIGNATURE----- > > > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > > -- Adhere to your own act, and congratulate yourself if you have done something strange and extravagant, and broken the monotony of a decorous age. -- Ralph Waldo Emerson From rjbs-perl-abe at lists.manxome.org Wed Jun 7 15:00:35 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 7 Jun 2006 18:00:35 -0400 Subject: [ABE.pm] see you (who?) tonight In-Reply-To: <814422ce0606071420y7f60bf48m6e4bd2f50f25f091@mail.gmail.com> References: <20060607183406.GF18496@zodiac.codesimply.com> <814422ce0606071420y7f60bf48m6e4bd2f50f25f091@mail.gmail.com> Message-ID: <20060607220035.GH18496@zodiac.codesimply.com> * Ted Fiedler [2006-06-07T17:20:51] > I am going to try to make it - I will be late - probably about 8:00 if thats > OK. No problem. Like I said, if I don't see anyone I recognize, or who recognizes me ( http://abe.pm.org/wiki/index.cgi?rjbs ), I'll hang out across the street or something and read Perl Hacks. :) I'll probably head in around 19:00 or 19:30, whether or not anyone else has shown up (come on, surely SOMEONE will be there by then!) and get some beer and a burger and something. I'm already kind of hungry! Finally, if anyone gets lost, I'm at +1 610 570 1950. -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060607/1b2c966d/attachment.bin From rjbs-perl-abe at lists.manxome.org Wed Jun 7 21:10:04 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Thu, 8 Jun 2006 00:10:04 -0400 Subject: [ABE.pm] and the winner is... Message-ID: <20060608041003.GK18496@zodiac.codesimply.com> And the winners of this month's Perl Monger's meeting are... Faber, Ted, and Ricardo, who showed up. I guess Faber was too worried about the possibility that we'd just talk smack about him, because he showed up before anyone else. He would've been safe, since the only two prospective attendees who knew him couldn't make it. John was "recovering from surgery" and Tom was "stick at the car dealership." Honestly, what happened to good excuses like, "abducted by aliens" or "it's not Perl, it's me; there's no spark"? I must have been really hungry, because I put away most of an order of wings, a burger, some fries, and a few pints. I gave some consideration to getting some ice cream, too. Maybe I was inspired by talk of losing weight. We also talked about how annoying commercial unix clones are, and I learned about... what is it called? SMIT? Bleh! I tried to talk Faber into buying a MacBook, which he seemed to already have on his mind. We talked about how customers are dumb and how we are totally awesome. Just think, next time you, too, might show and be awesome, too. As the night went on, I lost control and started talking about Sub::Exporter again and Faber decided to bail. Don't worry, after YAPC I'll be sure to be obsessed with something else annoying... maybe URI::Overcanonicalize will be done by then. Finally, Ted, as requested: Mail::DeliveryStatus::BounceParser. -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060608/83705e11/attachment.bin From fiedlert at gmail.com Wed Jun 7 21:27:01 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Thu, 8 Jun 2006 00:27:01 -0400 Subject: [ABE.pm] and the winner is... In-Reply-To: <20060608041003.GK18496@zodiac.codesimply.com> References: <20060608041003.GK18496@zodiac.codesimply.com> Message-ID: <814422ce0606072127w3d045cdcr493cf0e997412654@mail.gmail.com> Yes as soon as I got home I looked it up on CPAN decided once again, what a beautiful thing - its going to save me lots of time, and I somehow got to reading the documentation for MIME::Entity and Mail::Header. and IO::All is going to keep me awake tonight... On 6/8/06, Ricardo SIGNES wrote: > > And the winners of this month's Perl Monger's meeting are... Faber, Ted, and > Ricardo, who showed up. > ... -- "The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." -- Robert M Pirsig -- Robert M Pirsig From phil at five-lawrences.com Sun Jun 11 20:51:07 2006 From: phil at five-lawrences.com (Phil Lawrence) Date: Sun, 11 Jun 2006 22:51:07 -0500 Subject: [ABE.pm] subclassing the DBI In-Reply-To: References: Message-ID: On May 22, 2006, at 9:09 PM, Faber J. Fedor wrote: > ... What I was trying to do was to build on the $self > object, i.e. my base class defines $self->{date}, $self->{template}, > etc. which all of the derived classes need. Then each derived class > adds to $self the variables the derived class needs. This way I don't > need to call '$dbh = get_dbh()' in every function that needs to do > a SQL > stmt (which are quite a few). OK, I found an example of subclassing the DBI. Read the comments in the connect method below. package DBIx::DLM; use strict; use diagnostics; use base DBI; use File::Basename; use DBD::CSV; sub selectall_hashref { my $self = shift; my $statement = shift or die; my $key_field = shift or die; # adjust self as necessary :-) $self->_adjust( \$statement, shift() ); return $dbh->selectall_hashref( $statement, $key_field, undef, @_ ); } sub connect { # Note that other classes may inherit and use this method only if they also # subclass DBIx::DLM::db and DBIx::DLM::st in the same manner that DBIx::DLM # subclasses DBI::db and DBI::st. See ./t/subclass.t in the DBI install # directory for the basic example of subclassing the DBI from which this # module was modelled. my $proto = shift; my $class = ref($proto) || $proto; # Tell the DBI that $class is a new 'root class'. This enables DBI to # bless our object for us. In other words, the constructor for our class # is in the DBI package! $class->init_rootclass; my $parm_href = shift; # set defaults, unless invocant has alreay set them # (see perldoc DBD::CSV for all possible attrs) for ( [ 'eol' => "\n" ] , [ 'sep_char' => "\t" ] , [ 'quote_char' => undef ] , [ 'escape_char' => undef ] , [ 'FetchHashKeyName' => undef ] ) { unless (defined $parm_href->{$_[0]}) { $parm_href->{$_[0]} = $_[1] if defined $_[1]; } } # get default dbh my $dbh = $class->connect('DBI:CSV:'); # turn on the trace first, if so requested if (defined $parm_href->{trace}) { $dbh->trace( $parm_href->{trace} ); } # use any $parm key/value pairs (with scalar values) to set dbh defaults for (keys %{$parm_href}) { # already took care of tracing next if /trace/; unless (ref $parm_href->{$_}) { # since we'll blindly try any attr, we'll # catch errors and just put them in the # trace, then move on eval { $dbh->{$_} = $parm->{$_} }; $dbh->trace( "Warning: $@") if $@; } } return $dbh; } sub _adjust { my $self = shift; my $statement = ${ shift }; my $parm_href = shift; my ($select, $remaining) = split /FROM/i, $statement; (my $from, $remaining) = split /WHERE/i, $remaining; my @tables = split /,/, $from; for (@tables) { # if any unusual characters if (/\W/) { die "$_ not valid filename" unless (-f $_); my ($name,$path,$suffix) = fileparse( $_, qr/\W.+/ ); die unless defined $name; $parm_href->{table}{$name}{_pns}{path} = defined $path ? $path : '' ; $parm_href->{table}{$name}{_pns}{suffix} = defined $suffix ? $suffix : '' ; # use slimmed-down table name $_ = $name; } else { $parm->{table}{$_}{_pns}{path} = ''; $parm->{table}{$_}{_pns}{suffix} = ''; } } # rebuild $statement with slimmed-down table names, instead of whatever # was passed in (e.g. filenames with path) $statement = $select . 'FROM' . join(',', at tables) . $remaining; # override dbh defaults on a per table basis for (keys %{$parm_href->{table}}) { $dbh->{'csv_tables'}{$_}{file} = $parm_href->{table}{$_}{_pns}{path} . $_ . $parm_href->{table}{$_}{_pns}{suffix} ; # any of these default attrs may be overridden by invocant for my $attr ($parm_href->{table}{$_}) { # only non-ref attributes can be set. This # distinguishes from the stuff we jam into # $parm_href and those things the invocant # has passed along. next if ref $parm_href->{table}{$_}{$attr}; $dbh->{'csv_tables'}{$_}{$attr} = $parm_href->{table}{$_}{$attr} unless defined $dbh->{'csv_tables'}{$_} {$attr}; } } return $dbh; } #======================================================================= ======== package DBIx::DLM::db; use DBI; use vars qw( @ISA ); push @ISA, 'DBI::db'; #======================================================================= ======== package DBIx::DLM::st; use DBI; use vars qw( @ISA ); push @ISA, 'DBI::st'; 1; From phil at five-lawrences.com Mon Jun 12 04:56:45 2006 From: phil at five-lawrences.com (Phil Lawrence) Date: Mon, 12 Jun 2006 06:56:45 -0500 Subject: [ABE.pm] subclassing the DBI In-Reply-To: References: Message-ID: <5B5F925C-821A-4F1C-83ED-1781FDE86039@five-lawrences.com> On Jun 11, 2006, at 10:51 PM, Phil Lawrence wrote: > > On May 22, 2006, at 9:09 PM, Faber J. Fedor wrote: >> ... What I was trying to do was to build on the $self >> object, i.e. my base class defines $self->{date}, $self->{template}, >> etc. which all of the derived classes need. Then each derived class >> adds to $self the variables the derived class needs. This way I >> don't >> need to call '$dbh = get_dbh()' in every function that needs to do >> a SQL >> stmt (which are quite a few). > > OK, I found an example of subclassing the DBI. Read the comments in > the connect method below. Never mind that. I found my version controlled copy. Here was my latest revision: package DBIx::DLM; @DBIx::DLM::ISA = qw(DBI); use strict; use diagnostics; sub dlm_connect { # reference ./t/subclass.t in the DBI install directory for the basic # example of subclassing the DBI. my $proto = shift; my $class = ref($proto) || $proto; my $parm_href = shift || {}; # set defaults, unless invocant has alreay set them # (see perldoc DBD::CSV for all possible attrs) for ( [ 'csv_eol' => "\n" ] , [ 'csv_sep_char' => "\t" ] , [ 'csv_quote_char' => undef ] , [ 'csv_escape_char' => undef ] , [ 'FetchHashKeyName' => undef ] ) { unless (defined $parm_href->{$_->[0]}) { $parm_href->{$_->[0]} = $_->[1] if defined $_->[1]; } } # get default dbh my $dbh = $class->SUPER::connect('DBI:CSV:'); # turn on the trace first, if so requested if (defined $parm_href->{trace}) { $dbh->trace( $parm_href->{trace} ); } # use any $parm key/value pairs (with scalar values) to set dbh defaults for (keys %{$parm_href}) { # already took care of tracing next if /trace/; unless (ref $parm_href->{$_}) { # since we'll blindly try any attr, we'll # catch errors and just put them in the # trace, then move on eval { $dbh->{$_} = $parm_href->{$_} }; $dbh->trace( "Warning: $@") if $@; } } return $dbh; } package DBIx::DLM::dr; @DBIx::DLM::dr::ISA = qw(DBI::dr); sub connect { my ($drh, $dsn, $user, $pass, $attr) = @_; my $dbh = $drh->SUPER::connect($dsn, $user, $pass, $attr); #delete $attr->{CompatMode}; # to test clone return $dbh; } package DBIx::DLM::db; @DBIx::DLM::db::ISA = qw(DBI::db); use File::Basename; use File::Spec; use Cwd; use DBD::CSV; sub selectall_hashref { my $self = shift; my $statement = shift or die; my $key_field = shift or die; # adjust self as necessary :-) $self->_adjust( \$statement, shift() ); return $self->SUPER::selectall_hashref( $statement, $key_field, undef, @_ ); } sub _adjust { my $self = shift; my $statement = shift; my $parm_href = shift; my ($select, $remaining) = split /FROM/i, $$statement; (my $from, $remaining) = split /WHERE/i, $remaining; $remaining = '' unless defined $remaining; my @tables = split /,/, $from; for (@tables) { # remove any whitespace residual from splitting s/\s+//; # these are, of course, filenames my ($name,$path,$suffix) = fileparse( $_, qr/\W.+/ ); $path = File::Spec->canonpath( cwd() ) unless $path; for (File::Spec->join($path,($name . $suffix))) { die "$_ not a valid filename" unless -f; } $parm_href->{table}{$name}{_pns}{path} = $path; $parm_href->{table}{$name}{_pns}{suffix} = defined $suffix ? $suffix : '' ; # use slimmed-down table name $_ = $name; } # rebuild statement with slimmed-down table names, instead of whatever # was passed in (e.g. filenames with path) $$statement = $select . 'FROM ' . join(',', at tables) . $remaining; # override dbh defaults on a per table basis for (keys %{$parm_href->{table}}) { $self->{'csv_tables'}{$_}{file} = $parm_href->{table}{$_}{_pns}{path} . $_ . $parm_href->{table}{$_}{_pns} {suffix} ; # any of these default attrs may be overridden by invocant for my $attr ($parm_href->{table}{$_}) { # only non-ref attributes can be set. This # distinguishes from the stuff we might jam into # $parm_href and those things the invocant # has passed along. next if ref $parm_href->{table}{$_}{$attr}; $self->{'csv_tables'}{$_}{$attr} = $parm_href->{table}{$_}{$attr} unless defined $self->{'csv_tables'}{$_} {$attr}; } } return $self; } #======================================================================= ======== package DBIx::DLM::db; use DBI; use vars qw( @ISA ); push @ISA, 'DBI::db'; #======================================================================= ======== package DBIx::DLM::st; use DBI; use vars qw( @ISA ); push @ISA, 'DBI::st'; 1; From faber at linuxnj.com Wed Jun 21 14:05:55 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Wed, 21 Jun 2006 17:05:55 -0400 Subject: [ABE.pm] cool vimrc ideas Message-ID: <20060621210555.GB21840@neptune.faber.nom> I'm putting together a vimrc files for some programemrs who are new to Linux and vim. What cool things are in your vimrc file that would impress a programmer? For example, I've got a macro that will insert a timestamp whenever Time-stamp: <21 Jun 2006 05:04:44 PM Faber Fedor> is typed in insert mode. Yeah, just like that. The keystrokes are Q-W-E (the following space is important). -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From rjbs-perl-abe at lists.manxome.org Wed Jun 21 14:29:39 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 21 Jun 2006 17:29:39 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <20060621210555.GB21840@neptune.faber.nom> References: <20060621210555.GB21840@neptune.faber.nom> Message-ID: <20060621212939.GH17061@zodiac.codesimply.com> * "Faber J. Fedor" [2006-06-21T17:05:55] > I'm putting together a vimrc files for some programemrs who are new to > Linux and vim. http://rjbs.manxome.org/vim/vimrc.txt -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060621/88269433/attachment.bin From rjbs-perl-abe at lists.manxome.org Wed Jun 21 14:29:39 2006 From: rjbs-perl-abe at lists.manxome.org (Ricardo SIGNES) Date: Wed, 21 Jun 2006 17:29:39 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <20060621210555.GB21840@neptune.faber.nom> References: <20060621210555.GB21840@neptune.faber.nom> Message-ID: <20060621212939.GH17061@zodiac.codesimply.com> * "Faber J. Fedor" [2006-06-21T17:05:55] > I'm putting together a vimrc files for some programemrs who are new to > Linux and vim. http://rjbs.manxome.org/vim/vimrc.txt -- rjbs -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060621/88269433/attachment-0001.bin From fiedlert at gmail.com Wed Jun 21 17:49:09 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Wed, 21 Jun 2006 20:49:09 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <20060621210555.GB21840@neptune.faber.nom> References: <20060621210555.GB21840@neptune.faber.nom> Message-ID: <814422ce0606211749v5710d9a1v4a3ca32c51585131@mail.gmail.com> Here are some of my favorites " kill the annoying beep set vb " comment out blocks " ma to mark beginning " put cursor at the end and hit F5 " code will be commented out map :'a,.s/^/#/gi^M:nohl^M " show matching brackets in Perl autocmd FileType perl set showmatch " check perl code with :make autocmd FileType perl set makeprg=perl\ -c\ %\ autocmd FileType perl set errorformat=%f:%l:%m autocmd FileType perl set autowrite " shells autocmd BufNewFile *.pm 0r ~/.vim/skeleton.pm autocmd BufNewFile *.pl 0r ~/.vim/skeleton.pl autocmd BufNewFile *.cgi 0r ~/.vim/skeleton.cgi autocmd BufNewFile *.sh 0r ~/.vim/skeleton.sh skeleton.pl would be something like #!/usr/bin/perl use strict; use warnings; # use diagnostics; # use Data:;Dumper; and whenevr I type vi .pl - I start with that skeleton... There are others, but those are some of my favorites. Ted On 6/21/06, Faber J. Fedor wrote: > I'm putting together a vimrc files for some programemrs who are new to > Linux and vim. > > What cool things are in your vimrc file that would impress a programmer? > > For example, I've got a macro that will insert a timestamp whenever > Time-stamp: <21 Jun 2006 05:04:44 PM Faber Fedor> is typed in insert > mode. Yeah, just like that. The keystrokes are Q-W-E (the following > space is important). > > > > -- > > Regards, > > Faber Fedor > President > Linux New Jersey, Inc. > 908-320-0357 > 800-706-0701 > > http://www.linuxnj.com > > > > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > -- "The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." -- Robert M Pirsig From faber at linuxnj.com Wed Jun 21 18:43:48 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Wed, 21 Jun 2006 21:43:48 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <20060621212939.GH17061@zodiac.codesimply.com> References: <20060621210555.GB21840@neptune.faber.nom> <20060621212939.GH17061@zodiac.codesimply.com> Message-ID: <20060622014348.GA22874@neptune.faber.nom> On 21/06/06 17:29 -0400, Ricardo SIGNES wrote: > * "Faber J. Fedor" [2006-06-21T17:05:55] > > I'm putting together a vimrc files for some programemrs who are new to > > Linux and vim. > > http://rjbs.manxome.org/vim/vimrc.txt Dude, I scarfed that years ago! :-) -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From faber at linuxnj.com Wed Jun 21 19:14:45 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Wed, 21 Jun 2006 22:14:45 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <814422ce0606211749v5710d9a1v4a3ca32c51585131@mail.gmail.com> References: <20060621210555.GB21840@neptune.faber.nom> <814422ce0606211749v5710d9a1v4a3ca32c51585131@mail.gmail.com> Message-ID: <20060622021445.GB22874@neptune.faber.nom> On 21/06/06 20:49 -0400, Ted Fiedler wrote: > " comment out blocks > " ma to mark beginning > " put cursor at the end and hit F5 > " code will be commented out > map :'a,.s/^/#/gi^M:nohl^M I like this one! > " show matching brackets in Perl > autocmd FileType perl set showmatch How is this different from %? > " check perl code with :make > autocmd FileType perl set makeprg=perl\ -c\ %\ > autocmd FileType perl set errorformat=%f:%l:%m > autocmd FileType perl set autowrite You just saved me some time! > and whenevr I type vi .pl - I start with that skeleton... That's cute. I'm going to start using that one. > There are others, but those are some of my favorites. Thanks! Anyone else? -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From john-abe at apt202.net Wed Jun 21 19:35:13 2006 From: john-abe at apt202.net (John Cappiello) Date: Wed, 21 Jun 2006 22:35:13 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <20060622021445.GB22874@neptune.faber.nom> References: <20060621210555.GB21840@neptune.faber.nom> <814422ce0606211749v5710d9a1v4a3ca32c51585131@mail.gmail.com> <20060622021445.GB22874@neptune.faber.nom> Message-ID: <20060622023512.GQ19362@apt202.net> On Wed, Jun 21, 2006 at 10:14:45PM -0400, Faber J. Fedor wrote: > Anyone else? Install Vim 7.0. It's got all sorts of new niceties. -- jcap From fiedlert at gmail.com Wed Jun 21 21:40:26 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Thu, 22 Jun 2006 00:40:26 -0400 Subject: [ABE.pm] cool vimrc ideas In-Reply-To: <20060622021445.GB22874@neptune.faber.nom> References: <20060621210555.GB21840@neptune.faber.nom> <814422ce0606211749v5710d9a1v4a3ca32c51585131@mail.gmail.com> <20060622021445.GB22874@neptune.faber.nom> Message-ID: <814422ce0606212140j15e44a80i4d87a9094be9a357@mail.gmail.com> > " comment out blocks > " ma to mark beginning > " put cursor at the end and hit F5 > " code will be commented out > map :'a,.s/^/#/gi^M:nohl^M conversely you can do map 'a,.s/^#//gi^M:nohl^M will remove blocks of code in the same manner - I use that for testing different blocks of code quickly. > > " show matching brackets in Perl > > autocmd FileType perl set showmatch > > How is this different from %? Hmmm.. forgot about that - it doesn't appear to be Ted -- "The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." -- Robert M Pirsig From faber at linuxnj.com Sat Jun 24 20:36:58 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Sat, 24 Jun 2006 23:36:58 -0400 Subject: [ABE.pm] Compile this Message-ID: <20060625033658.GA32023@neptune.faber.nom> Or interpret it, execute it, etc. http://home.cs.tum.edu/~mai/poly.sh.pl.tcl.cpp.bf.py.c.lhs.txt (Very little) Background here: http://blog.sykosopp.com/2006/02/26/one-file-to-rule-them-all/ -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From faber at linuxnj.com Tue Jun 27 07:53:59 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Tue, 27 Jun 2006 10:53:59 -0400 Subject: [ABE.pm] OOP refactoring Message-ID: <20060627145359.GA2051@neptune.faber.nom> If you have been following my saga, you'll remember that I'm writing a OO Perl report. The report is made up of a bunch of HTML tables. Each HTML tables is generated as a separate object. I ended up doing something like this in my main program: my $reportTable = ReportTable->new(); $reportTable->date($date); $reportTable->style('html'); $reportTable->printReportHeader(); my $newSectorTable = SectorExposureTable->new(); $newSectorTable->date($date); $newSectorTable->style('html'); $newSectorTable->debug(0); $newSectorTable->fetchData(); $newSectorTable->printTable(); my $newIndustryTable = IndustryExposureTable->new(); $newIndustryTable->date($date); $newIndustryTable->style('html'); $newIndustryTable->debug(0); $newIndustryTable->fetchData(); $newIndustryTable->printTable(); $reportTable->printReportFooter(); Note that SectorExposureTable and IndustryExposureTable are subclasses of ReportTable and execute a ReportTable contructor in their constructors. As you can see, I have to set the date for each table. Why? When I run SectorExposureTable->new that calls ReportTable->new which means I have an empty date field. Yes, I know, my design sucks which is why I'm refactoring the code. So I have two questions: 1. How do I get SectorExposureTable to inherit the data I've already set in ReportTable? 2. Instead of having my main program call all of these objects, I'm restructuring the code so ReportTable calls the objects. Do I literally have ReportTable call the objects or do I cut and paste the code from SectorExposureTable into ReportTable replacing the SectorExposureTable object code with ReportTable methods? While I eagerly await your replies, I'm goingto go muck with the code... -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From faber at linuxnj.com Tue Jun 27 08:44:13 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Tue, 27 Jun 2006 11:44:13 -0400 Subject: [ABE.pm] Data::Dumper and the debugger Message-ID: <20060627154413.GA2169@neptune.faber.nom> Rick, Duringthe last meeting, you mentioned using Data::Dumper whilst in the debugger. I can't figure out the syntax to use it. How would I dump my object $report whilst in the debugger? -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com From fiedlert at gmail.com Tue Jun 27 08:55:45 2006 From: fiedlert at gmail.com (Ted Fiedler) Date: Tue, 27 Jun 2006 11:55:45 -0400 Subject: [ABE.pm] Data::Dumper and the debugger In-Reply-To: <20060627154413.GA2169@neptune.faber.nom> References: <20060627154413.GA2169@neptune.faber.nom> Message-ID: <814422ce0606270855k59583c2el50ee39bd193a858a@mail.gmail.com> perl -d myprog.pl use Data::Dumper; p Dumper @var [ or ] print Dumper @var; should do the trick. Ted On 6/27/06, Faber J. Fedor wrote: > Rick, > > Duringthe last meeting, you mentioned using Data::Dumper whilst in the > debugger. I can't figure out the syntax to use it. How would I dump my > object $report whilst in the debugger? > > -- > > Regards, > > Faber Fedor > President > Linux New Jersey, Inc. > 908-320-0357 > 800-706-0701 > > http://www.linuxnj.com > > > > _______________________________________________ > ABE-pm mailing list > ABE-pm at pm.org > http://mail.pm.org/mailman/listinfo/abe-pm > -- "The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital computer or the gears of a cycle transmission as he does at the top of a mountain or in the petals of a flower." -- Robert M Pirsig From faber at linuxnj.com Tue Jun 27 15:03:23 2006 From: faber at linuxnj.com (Faber J. Fedor) Date: Tue, 27 Jun 2006 18:03:23 -0400 Subject: [ABE.pm] Data::Dumper and the debugger In-Reply-To: <814422ce0606270855k59583c2el50ee39bd193a858a@mail.gmail.com> References: <20060627154413.GA2169@neptune.faber.nom> <814422ce0606270855k59583c2el50ee39bd193a858a@mail.gmail.com> Message-ID: <20060627220323.GC2169@neptune.faber.nom> On 27/06/06 11:55 -0400, Ted Fiedler wrote: > perl -d myprog.pl > > use Data::Dumper; > p Dumper @var > > [ or ] > > print Dumper @var; Ah! I was missing the 'p'! thanks. -- Regards, Faber Fedor President Linux New Jersey, Inc. 908-320-0357 800-706-0701 http://www.linuxnj.com