From Peter.Loo at source.wolterskluwer.com Fri Sep 1 14:42:00 2006 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 1 Sep 2006 14:42:00 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <20060825170343.GA11427@fetter.org> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A01E61537@phxmail02.phx.ndchealth.com> Hellow there. Per Andy's recommendation, I went ahead and had DataTime.pm installed on our test node. It turned out that the date calculation is taking approximately 11 seconds for every 5,000 records. Is there something a bit faster? Here is my code: $counter = 0; while ( @cur = $sth->fetchrow() ) { if ($counter >= 5000) { printf(STDERR "$counter - %s", `date`); $counter = 0; } if ($prev[0] == $cur[0] && $prev[1] == $cur[1]) { ($pyear, $pmon, $pday) = split('-', $prev[7]); ($cyear, $cmon, $cday) = split('-', $cur[2]); $prev_cted = DateTime->new( year => $pyear, month => $pmon, day => $pday ); $cur_rxdte = DateTime->new( year => $cyear, month => $cmon, day => $cday ); ########################################################### # COMMENTS: Minus current rx_fill_dte with previous cted. # ########################################################### $dur = $prev_cted->subtract_datetime_absolute($cur_rxdte); $p_minus_c = $dur->in_units( 'days' ); if ($p_minus_c >= 0 || ($p_minus_c < 0 && $p_minus_c <= $cur[5])) { $prev_cted->add( days => $cur[4] ); $cur[7] = $prev_cted->ymd; $cur[6] = "C"; } elsif ($p_minus_c < 0 && $p_minus_c > $cur[5]) { $cur_rxdte->add( days => $cur[4] ); $cur[7] = $cur_rxdte->ymd; $cur[6] = "R"; } } @prev = @cur; $rec = join($delimiter, @cur); print PIPE "$rec\n"; $counter++; } $sth->finish; $dbh->disconnect(); close(PIPE); Peter -----Original Message----- From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org [mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or g] On Behalf Of David Fetter Sent: Friday, August 25, 2006 10:04 AM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Perl's to_date() equivalent On Fri, Aug 25, 2006 at 11:58:52AM -0500, Andy Lester wrote: > > On Aug 25, 2006, at 11:56 AM, David Fetter wrote: > > > Try Date::Manip from CPAN :) It's not the fastest date munging > > library there, but it's very flexible. > > I'd recommend DateTime as the standard at this point. Thanks for the update. :) My information was pretty old. Cheers, D -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From david at fetter.org Fri Sep 1 14:59:00 2006 From: david at fetter.org (David Fetter) Date: Fri, 1 Sep 2006 14:59:00 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A01E61537@phxmail02.phx.ndchealth.com> References: <20060825170343.GA11427@fetter.org> <8E3D502A002DA04FADBDED4CB4D94D3A01E61537@phxmail02.phx.ndchealth.com> Message-ID: <20060901215900.GT7270@fetter.org> On Fri, Sep 01, 2006 at 02:42:00PM -0700, Loo, Peter # PHX wrote: > > Hellow there. > > Per Andy's recommendation, I went ahead and had DataTime.pm > installed on our test node. It turned out that the date calculation > is taking approximately 11 seconds for every 5,000 records. Is > there something a bit faster? Here is my code: Are you sure you can't do this with the DBMS's facilities? It seems to me that Perl's are what you use when you don't have a DBMS date library available. Also, could you explain in english what the code is supposed to be doing? Cheers, D > $counter = 0; > while ( @cur = $sth->fetchrow() ) { > if ($counter >= 5000) { > printf(STDERR "$counter - %s", `date`); > $counter = 0; > } > if ($prev[0] == $cur[0] && $prev[1] == $cur[1]) { > ($pyear, $pmon, $pday) = split('-', $prev[7]); > ($cyear, $cmon, $cday) = split('-', $cur[2]); > $prev_cted = DateTime->new( year => $pyear, month => $pmon, day => > $pday ); > $cur_rxdte = DateTime->new( year => $cyear, month => $cmon, day => > $cday ); > ########################################################### > # COMMENTS: Minus current rx_fill_dte with previous cted. # > ########################################################### > $dur = $prev_cted->subtract_datetime_absolute($cur_rxdte); > $p_minus_c = $dur->in_units( 'days' ); > if ($p_minus_c >= 0 || ($p_minus_c < 0 && $p_minus_c <= $cur[5])) > { > $prev_cted->add( days => $cur[4] ); > $cur[7] = $prev_cted->ymd; > $cur[6] = "C"; > } > elsif ($p_minus_c < 0 && $p_minus_c > $cur[5]) { > $cur_rxdte->add( days => $cur[4] ); > $cur[7] = $cur_rxdte->ymd; > $cur[6] = "R"; > } > } > @prev = @cur; > $rec = join($delimiter, @cur); > print PIPE "$rec\n"; > $counter++; > } > > $sth->finish; > $dbh->disconnect(); > close(PIPE); > > > Peter > > -----Original Message----- > From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org > [mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or > g] On Behalf Of David Fetter > Sent: Friday, August 25, 2006 10:04 AM > To: San Francisco Perl Mongers User Group > Subject: Re: [sf-perl] Perl's to_date() equivalent > > On Fri, Aug 25, 2006 at 11:58:52AM -0500, Andy Lester wrote: > > > > On Aug 25, 2006, at 11:56 AM, David Fetter wrote: > > > > > Try Date::Manip from CPAN :) It's not the fastest date munging > > > library there, but it's very flexible. > > > > I'd recommend DateTime as the standard at this point. > > Thanks for the update. :) > > My information was pretty old. > > Cheers, > D > -- > David Fetter http://fetter.org/ > phone: +1 415 235 3778 AIM: dfetter666 > Skype: davidfetter > > Remember to vote! > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > > This E-mail message is for the sole use of the intended recipient(s) and > may contain confidential and privileged information. Any unauthorized > review, use, disclosure or distribution is prohibited. If you are not > the intended recipient, please contact the sender by reply E-mail, and > destroy all copies of the original message. > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From Peter.Loo at source.wolterskluwer.com Fri Sep 1 15:13:24 2006 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 1 Sep 2006 15:13:24 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <20060901215900.GT7270@fetter.org> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A01E61553@phxmail02.phx.ndchealth.com> Hi David, The problem is that the database is Netezza. Although Netezza will be coming out with its own internal language, equivalent to, PL/SQL, 4GL, etc..., it is currently not available. The logic is quite simple really. First I SELECT the required rows in the correct sort order. Then I calculate the dates within the records. The problem is that when I fetch in a row, I have to compare the date of the current row to a previous row then add days to the date accordingly. Also there is a column that contains grace period of which I also need to compare against the difference of the dates. Here is the logic in pseudo code: SELECT statement: ================= select distinct x.ptnt_gid, x.prdct_gid, x.rx_fill_dte, x.claim_gid, x.ovrd_days_sply_nbr, x.clfsn_grace_prd_nbr, 'N', x.rx_fill_dte + x.ovrd_days_sply_nbr from p_dlvrb_rx_claim_extract x, p_dlvrb_ptnt_list y where x.dlvrb_gid = y.dlvrb_gid and x.ptnt_gid = y.ptnt_gid order by x.ptnt_gid, x.prdct_gid, x.rx_fill_dte, x.claim_gid WHILE loop: =========== while (fetch) { if (previous cted - current rx_fill_dte) >= 0 or ((previous cted - current rx_fill_dte) < 0 and (previous cted - current rx_fill_dte) <= current clfsn_grace_prd_nbr) then current cted = previous cted + rx_fill_dte current class = "C" elsif (previous cted - current rx_fill_dte) < 0 and (previous cted - current rx_fill_dte) > current clfsn_grace_prd_nbr then current cted = rx_fill_dte + ovrd_days_sply_nbr current class = "R" else current cted = rx_fill_dte + ovrd_days_sply_nbr current class = "N" fi Peter -----Original Message----- From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org [mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or g] On Behalf Of David Fetter Sent: Friday, September 01, 2006 2:59 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Perl's to_date() equivalent On Fri, Sep 01, 2006 at 02:42:00PM -0700, Loo, Peter # PHX wrote: > > Hellow there. > > Per Andy's recommendation, I went ahead and had DataTime.pm installed > on our test node. It turned out that the date calculation is taking > approximately 11 seconds for every 5,000 records. Is there something > a bit faster? Here is my code: Are you sure you can't do this with the DBMS's facilities? It seems to me that Perl's are what you use when you don't have a DBMS date library available. Also, could you explain in english what the code is supposed to be doing? Cheers, D From josh at agliodbs.com Fri Sep 1 15:19:38 2006 From: josh at agliodbs.com (Josh Berkus) Date: Fri, 1 Sep 2006 15:19:38 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A01E61553@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A01E61553@phxmail02.phx.ndchealth.com> Message-ID: <200609011519.38929.josh@agliodbs.com> Peter, > The problem is that the database is Netezza. Although Netezza will be > coming out with its own internal language, equivalent to, PL/SQL, 4GL, > etc..., it is currently not available. But Netezza is based on PostgreSQL, where to_date() is a c-language built-in. Are you telling me that they don't support it? -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco From Peter.Loo at source.wolterskluwer.com Fri Sep 1 15:23:24 2006 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 1 Sep 2006 15:23:24 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <200609011519.38929.josh@agliodbs.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A01E61559@phxmail02.phx.ndchealth.com> Josh, Netezza does support to_date(), but the problem is I need to compare current row's date to the previous rows date. I suppose I could do: select a, b, c, d, e, f, rx_fill_dte - to_date(1980-01-01, 'YYYY-MM-DD') from some_table where some_conditions; Then using the calculated column to do the math. Peter -----Original Message----- From: Josh Berkus [mailto:josh at agliodbs.com] Sent: Friday, September 01, 2006 3:20 PM To: sanfrancisco-pm at pm.org Cc: Loo, Peter # PHX Subject: Re: [sf-perl] Perl's to_date() equivalent Peter, > The problem is that the database is Netezza. Although Netezza will be > coming out with its own internal language, equivalent to, PL/SQL, 4GL, > etc..., it is currently not available. But Netezza is based on PostgreSQL, where to_date() is a c-language built-in. Are you telling me that they don't support it? -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From josh at agliodbs.com Fri Sep 1 15:29:02 2006 From: josh at agliodbs.com (Josh Berkus) Date: Fri, 1 Sep 2006 15:29:02 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A01E61559@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A01E61559@phxmail02.phx.ndchealth.com> Message-ID: <200609011529.03258.josh@agliodbs.com> Peter, > Netezza does support to_date(), but the problem is I need to compare > current row's date to the previous rows date. I suppose I could do: Previous by date? That's a SQL problem, not a Perl problem. Albeit an really annoying one with a large database. Can you give us the schema of the table? Too bad Netezza doesn't support custom running aggregates. You could do this easily in mainstream PostgresQL (using PL/perl no less). -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco From Peter.Loo at source.wolterskluwer.com Fri Sep 1 15:31:02 2006 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 1 Sep 2006 15:31:02 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <200609011529.03258.josh@agliodbs.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A01E6155A@phxmail02.phx.ndchealth.com> Table "p_dlvrb_rx_claim_extract" Attribute | Type | Modifier | Default Value -------------------------------+---------------+----------+------------- -- dlvrb_gid | bigint | not null | drug_gid | bigint | not null | prdct_gid | bigint | not null | prctr_gid | bigint | | ds_phmcy_gid | bigint | not null | phmcy_zip_cde | character(5) | not null | plan_gid | bigint | | ptnt_gid | bigint | not null | claim_gid | bigint | not null | rx_fill_dte | date | not null | data_splr_cde | character(1) | | days_sply_nbr | integer | not null | ovrd_days_sply_nbr | integer | not null | drug_imptd_dspnd_mtrc_dec_qty | numeric(10,3) | not null | ptnt_clctd_amt_to_pay_amt | numeric(11,2) | | ptnt_co_pay_co_ins_amt | numeric(9,2) | | orgnl_drct_feed_ind | character(1) | | rx_pymt_typ_cde | character(1) | | zero_days_sply_ind | character(1) | | ptnt_hip_brth_yr_nbr | numeric(4,0) | | ptnt_gndr_cde | character(1) | | study_prdct_ind | character(1) | | sw_prdct_ind | character(1) | | clfsn_grace_prd_nbr | numeric(3,0) | | lot_grace_prd_nbr | numeric(3,0) | | cohrt_strt_dte | date | | cohrt_end_dte | date | | extnd_lkbck_strt_dte | date | | lkbck_prd_days_nbr | numeric(3,0) | | Distributed on hash: "ptnt_gid" Peter -----Original Message----- From: Josh Berkus [mailto:josh at agliodbs.com] Sent: Friday, September 01, 2006 3:29 PM To: Loo, Peter # PHX Cc: sanfrancisco-pm at pm.org Subject: Re: [sf-perl] Perl's to_date() equivalent Peter, > Netezza does support to_date(), but the problem is I need to compare > current row's date to the previous rows date. I suppose I could do: Previous by date? That's a SQL problem, not a Perl problem. Albeit an really annoying one with a large database. Can you give us the schema of the table? Too bad Netezza doesn't support custom running aggregates. You could do this easily in mainstream PostgresQL (using PL/perl no less). -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From josh at agliodbs.com Fri Sep 1 15:50:45 2006 From: josh at agliodbs.com (Josh Berkus) Date: Fri, 1 Sep 2006 15:50:45 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A01E6155A@phxmail02.phx.ndchealth.com> References: <8E3D502A002DA04FADBDED4CB4D94D3A01E6155A@phxmail02.phx.ndchealth.com> Message-ID: <200609011550.45559.josh@agliodbs.com> Peter, Hmmm ... mind joining us on irc.freenode.net, channel #postgresql? Interactive will help with this. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco From spidaman at arachna.com Fri Sep 1 15:51:11 2006 From: spidaman at arachna.com (spidaman at arachna.com) Date: Fri, 1 Sep 2006 15:51:11 -0700 (PDT) Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <8E3D502A002DA04FADBDED4CB4D94D3A01E61537@phxmail02.phx.ndchealth.com> Message-ID: On Fri, 1 Sep 2006, Loo, Peter # PHX wrote: > while ( @cur = $sth->fetchrow() ) { I think this is a 'DBI best practices' niggling detail. IIRC, this does a lot of copying, better to define the variables you want ("define" meaning use "my" ... you do 'use strict', don't you?) and bind the references with $sth->bind_columns(...). Particularly if you iterating over a big assed cursor. -Ian -- Ian Kallen | Yahoo/AIM: iankallen http://www.arachna.com/roller/page/spidaman From Peter.Loo at source.wolterskluwer.com Fri Sep 1 15:53:28 2006 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 1 Sep 2006 15:53:28 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: <200609011550.45559.josh@agliodbs.com> Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A01E61573@phxmail02.phx.ndchealth.com> No, I don't mind at all, but when I go to that link, I am asked to logon. Peter -----Original Message----- From: Josh Berkus [mailto:josh at agliodbs.com] Sent: Friday, September 01, 2006 3:51 PM To: Loo, Peter # PHX Cc: sanfrancisco-pm at pm.org Subject: Re: [sf-perl] Perl's to_date() equivalent Peter, Hmmm ... mind joining us on irc.freenode.net, channel #postgresql? Interactive will help with this. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From Peter.Loo at source.wolterskluwer.com Fri Sep 1 15:55:30 2006 From: Peter.Loo at source.wolterskluwer.com (Loo, Peter # PHX) Date: Fri, 1 Sep 2006 15:55:30 -0700 Subject: [sf-perl] Perl's to_date() equivalent In-Reply-To: Message-ID: <8E3D502A002DA04FADBDED4CB4D94D3A01E61575@phxmail02.phx.ndchealth.com> That is a wonderful idea Ian. No I did not use strict this time. I will change my code to $sth->bind_columns. Peter -----Original Message----- From: sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.org [mailto:sanfrancisco-pm-bounces+peter.loo=source.wolterskluwer.com at pm.or g] On Behalf Of spidaman at arachna.com Sent: Friday, September 01, 2006 3:51 PM To: San Francisco Perl Mongers User Group Subject: Re: [sf-perl] Perl's to_date() equivalent On Fri, 1 Sep 2006, Loo, Peter # PHX wrote: > while ( @cur = $sth->fetchrow() ) { I think this is a 'DBI best practices' niggling detail. IIRC, this does a lot of copying, better to define the variables you want ("define" meaning use "my" ... you do 'use strict', don't you?) and bind the references with $sth->bind_columns(...). Particularly if you iterating over a big assed cursor. -Ian -- Ian Kallen | Yahoo/AIM: iankallen http://www.arachna.com/roller/page/spidaman _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message. From david at fetter.org Thu Sep 7 18:19:34 2006 From: david at fetter.org (David Fetter) Date: Thu, 7 Sep 2006 18:19:34 -0700 Subject: [sf-perl] SFPUG Meeting: SQL on Streams Message-ID: <20060908011934.GC7921@fetter.org> Folks, Sailesh Krishnamurthi, will be talking about his work on Amalgamated Insight, a spinoff of the TelegraphCQ project at UC Berkeley. Queries running this way *actually* run for months or years instead of just seeming to ;) You'll discover out why this is a good thing. Where: iParadigms, Inc 1624 FRANKLIN Street, Suite 818 Oakland, CA 94612-2823 When: Tuesday, September 12, 2006 7:30pm RSVP: ASAP to david at fetter.org so you can get fed. Thanks very much to the folks at iParadigms for hosting this meeting. Cheers, Dave. -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From david at fetter.org Mon Sep 11 12:47:26 2006 From: david at fetter.org (David Fetter) Date: Mon, 11 Sep 2006 12:47:26 -0700 Subject: [sf-perl] [REMINDER] SFPUG Meeting: SQL on Streams In-Reply-To: <20060908011934.GC7921@fetter.org> References: <20060908011934.GC7921@fetter.org> Message-ID: <20060911194726.GB21581@fetter.org> Folks, Sailesh Krishnamurthi, will be talking about his work on Amalgamated Insight, a spinoff of the TelegraphCQ project at UC Berkeley. Queries running this way *actually* run for months or years instead of just seeming to ;) You'll discover out why this is a good thing. Where: iParadigms, Inc 1624 FRANKLIN Street, Suite 818 Oakland, CA 94612-2823 When: Tuesday, September 12, 2006 7:30pm RSVP: ASAP to david at fetter.org so you can get fed. Thanks very much to the folks at iParadigms for hosting this meeting. Cheers, Dave. -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From qw at sf.pm.org Tue Sep 19 04:57:12 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Tue, 19 Sep 2006 04:57:12 -0700 Subject: [sf-perl] Little Star and Perl, one week from today Message-ID: <20060919115712.GB20059@fu.funkspiel.org> Next Tuesday is our meeting day. I have talks planned for October and November, but September is a social meeting. So, I'd like to try something a little different: a visit to Little Star Pizza in the Haight. Little Star is supposed to be San Francisco's answer to Zachary's: a world-class stuffed/deep-dish pizza joint. I went to the PostgreSQL meeting last week (http://postgresql.meetup.com/1/?gj=sj6) and was reminded how good Zachary's is. Let's see how Little Star stacks up. RSVP: Not necessary; we'll order based on who shows up. Date: Tuesday, September 26 Time: 8:00 pm. Place: Little Star Pizza http://www.littlestarpizza.com/ 846 Divisadero (at McAllister) http://tinyurl.com/h3p82 Parking: The Haight is pretty hard to park in. If you must drive, you're probably better off parking in your favorite garage downtown, then taking public transit. The 5th and Mission Garage is a good bet. From BART: Get off at Civic Center, then go to McAllister and 7th and catch the 5 Fulton. Full details at http://tinyurl.com/qpkb5 -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Tue Sep 19 05:07:21 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Tue, 19 Sep 2006 05:07:21 -0700 Subject: [sf-perl] Upcoming meetings In-Reply-To: <20060919115712.GB20059@fu.funkspiel.org> References: <20060919115712.GB20059@fu.funkspiel.org> Message-ID: <20060919120721.GC20059@fu.funkspiel.org> On Tue, Sep 19, 2006 at 04:57:12AM -0700, Quinn Weaver wrote: > Next Tuesday is our meeting day. I have talks planned for October and > November, but September is a social meeting. Specifically, here's what's coming up: October 24: Jeff Barr of Amazon will talk about their web services API. November 28: Steve Fink will speak on "that thing on the floor in the Metreon." For those who haven't seen it, it's basically a video game projected onto the floor; many players can run around the "screen" kicking at the projected "objects", and the game reacts appropriately. Wicked cool. Turns out it's written in Perl, with XS and OpenGL. Steve will give us some juicy technical details. -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From Jeff.Thalhammer at barclaysglobal.com Tue Sep 19 17:25:23 2006 From: Jeff.Thalhammer at barclaysglobal.com (Thalhammer, Jeffrey BGI SF) Date: Tue, 19 Sep 2006 17:25:23 -0700 Subject: [sf-perl] Little Star and Perl, one week from today In-Reply-To: <20060919115712.GB20059@fu.funkspiel.org> Message-ID: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> Sweet! Little Star is right around the corner from my house. IMHO, the pizza is just as good as Zachary's, and they have some tasty salads too. MUNI lines 5, 24, and 31 are all nearby. http://www.littlestarpizza.com/ -Jeff -----Original Message----- From: sanfrancisco-pm-bounces+jeff.thalhammer=barclaysglobal.com at pm.org [mailto:sanfrancisco-pm-bounces+jeff.thalhammer=barclaysglobal.com at pm.or g] On Behalf Of Quinn Weaver Sent: Tuesday, September 19, 2006 4:57 AM To: sanfrancisco-pm at pm.org Subject: [sf-perl] Little Star and Perl, one week from today Next Tuesday is our meeting day. I have talks planned for October and November, but September is a social meeting. So, I'd like to try something a little different: a visit to Little Star Pizza in the Haight. Little Star is supposed to be San Francisco's answer to Zachary's: a world-class stuffed/deep-dish pizza joint. I went to the PostgreSQL meeting last week (http://postgresql.meetup.com/1/?gj=sj6) and was reminded how good Zachary's is. Let's see how Little Star stacks up. RSVP: Not necessary; we'll order based on who shows up. Date: Tuesday, September 26 Time: 8:00 pm. Place: Little Star Pizza http://www.littlestarpizza.com/ 846 Divisadero (at McAllister) http://tinyurl.com/h3p82 Parking: The Haight is pretty hard to park in. If you must drive, you're probably better off parking in your favorite garage downtown, then taking public transit. The 5th and Mission Garage is a good bet. From BART: Get off at Civic Center, then go to McAllister and 7th and catch the 5 Fulton. Full details at http://tinyurl.com/qpkb5 -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut _______________________________________________ SanFrancisco-pm mailing list SanFrancisco-pm at pm.org http://mail.pm.org/mailman/listinfo/sanfrancisco-pm -- This message and any attachments are confidential, proprietary, and may be privileged. If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege. If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf. All email sent to or from this address is subject to electronic storage and review by BGI. Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed. From josh at agliodbs.com Tue Sep 19 17:30:09 2006 From: josh at agliodbs.com (Josh Berkus) Date: Tue, 19 Sep 2006 17:30:09 -0700 Subject: [sf-perl] Little Star and Perl, one week from today In-Reply-To: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> Message-ID: <200609191730.09474.josh@agliodbs.com> Quinn, > Sweet! Little Star is right around the corner from my house. IMHO, the > pizza is just as good as Zachary's, and they have some tasty salads too. > MUNI lines 5, 24, and 31 are all nearby. Little Star! I am *so* there. First round of beer is on me! (assuming 12 drinkers or less) Better make a reservation though. They're small and get full. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco From david at fetter.org Tue Sep 19 22:58:30 2006 From: david at fetter.org (David Fetter) Date: Tue, 19 Sep 2006 22:58:30 -0700 Subject: [sf-perl] Little Star and Perl, one week from today In-Reply-To: <20060919115712.GB20059@fu.funkspiel.org> References: <20060919115712.GB20059@fu.funkspiel.org> Message-ID: <20060920055830.GD20367@fetter.org> On Tue, Sep 19, 2006 at 04:57:12AM -0700, Quinn Weaver wrote: > Next Tuesday is our meeting day. I have talks planned for October > and November, but September is a social meeting. > > So, I'd like to try something a little different: a visit to Little > Star Pizza in the Haight. Little Star is supposed to be San > Francisco's answer to Zachary's: a world-class stuffed/deep-dish > pizza joint. I went to the PostgreSQL meeting last week > (http://postgresql.meetup.com/1/?gj=sj6) and was reminded how good > Zachary's is. Let's see how Little Star stacks up. This sounds great :) Cheers, D -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From qw at sf.pm.org Thu Sep 21 18:58:47 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Thu, 21 Sep 2006 18:58:47 -0700 Subject: [sf-perl] Little Star and Perl, one week from today In-Reply-To: <200609191730.09474.josh@agliodbs.com> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> Message-ID: <20060922015847.GA44626@fu.funkspiel.org> On Tue, Sep 19, 2006 at 05:30:09PM -0700, Josh Berkus wrote: > Quinn, > > > Sweet! Little Star is right around the corner from my house. IMHO, the > > pizza is just as good as Zachary's, and they have some tasty salads too. > > MUNI lines 5, 24, and 31 are all nearby. > > Little Star! I am *so* there. First round of beer is on me! (assuming > 12 drinkers or less) > > Better make a reservation though. They're small and get full. Unfortunately, they don't take reservations. However, they said showing up before 7:00 should greatly increase our chances of getting a table. How about a 6:30 meeting? If that's too early for anyone, sing out (let's say before Saturday). I'll post again when the time is firm. Thanks, -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From rdm at cfcl.com Thu Sep 21 20:26:35 2006 From: rdm at cfcl.com (Rich Morin) Date: Thu, 21 Sep 2006 20:26:35 -0700 Subject: [sf-perl] will code (or write) for food... Message-ID: As I am finishing up a contract at Apple (updating the manual pages for Leopard), I will soon be in a position to take on other work. Please let me know if you have know of any opportunities that might have my name on them. I am particularly interested in the application and design of mechanized documentation tools, which can be effective in the generation and maintenance of detailed interface documentation, etc. I am also quite willing, however, to do writing, editing, course development, programming, etc. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From boss at gregerhaga.net Fri Sep 22 03:21:37 2006 From: boss at gregerhaga.net (Greger) Date: Fri, 22 Sep 2006 13:21:37 +0300 Subject: [sf-perl] will code (or write) for food... In-Reply-To: References: Message-ID: <20060922102012.M81233@gregerhaga.net> On Thu, 21 Sep 2006 20:26:35 -0700, Rich Morin wrote > As I am finishing up a contract at Apple (updating the manual > pages for Leopard), I will soon be in a position to take on > other work. Please let me know if you have know of any > opportunities that might have my name on them. > > I am particularly interested in the application and design of > mechanized documentation tools, which can be effective in the > generation and maintenance of detailed interface documentation, > etc. I am also quite willing, however, to do writing, editing, > course development, programming, etc. > > -r > -- > http://www.cfcl.com/rdm Rich Morin > http://www.cfcl.com/rdm/resume rdm at cfcl.com > http://www.cfcl.com/rdm/weblog +1 650-873-7841 > > Technical editing and writing, programming, and web development > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm Me too, I haven't figured out yet how to get past those blithering over-educated recruiters*S*. *grin* -- QxRSSReader v1.2.6a released (30-06-2006) PortScanner v1.2.2 ( 09-08-2006 ) http://www.gregerhaga.net/ There are no stupid questions, but there are stupid answers. From david at fetter.org Fri Sep 22 09:11:56 2006 From: david at fetter.org (David Fetter) Date: Fri, 22 Sep 2006 09:11:56 -0700 Subject: [sf-perl] will code (or write) for food... In-Reply-To: <20060922102012.M81233@gregerhaga.net> References: <20060922102012.M81233@gregerhaga.net> Message-ID: <20060922161156.GR3402@fetter.org> On Fri, Sep 22, 2006 at 01:21:37PM +0300, Greger wrote: > On Thu, 21 Sep 2006 20:26:35 -0700, Rich Morin wrote > > As I am finishing up a contract at Apple (updating the manual > > pages for Leopard), I will soon be in a position to take on other > > work. Please let me know if you have know of any opportunities > > that might have my name on them. > > > > I am particularly interested in the application and design of > > mechanized documentation tools, which can be effective in the > > generation and maintenance of detailed interface documentation, > > etc. I am also quite willing, however, to do writing, editing, > > course development, programming, etc. > > Me too, I haven't figured out yet how to get past those blithering > over-educated recruiters*S*. I know it's a strain, but keeping civil with recruiters, however silly they may sound, won't hurt you. Being nasty to them can. Cheers, D -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From ggarchar at zapmap.com Fri Sep 22 09:14:00 2006 From: ggarchar at zapmap.com (Gary Garchar) Date: Fri, 22 Sep 2006 09:14:00 -0700 Subject: [sf-perl] will code (or write) for food... In-Reply-To: <20060922102012.M81233@gregerhaga.net> References: <20060922102012.M81233@gregerhaga.net> Message-ID: <224d3c7285117356848f2e2a54e3f8a4@zapmap.com> > I haven't figured out yet how to get past those blithering > over-educated recruiters*S*. Make them part of your team, or forget entirely. Focus on what you do best and outsource the rest. Read "Go It Alone" by Bruce Judson: http://www.brucejudson.com/ The entire book is online. From cfcl at cfcl.com Fri Sep 22 21:00:04 2006 From: cfcl at cfcl.com (Rich and Vicki) Date: Fri, 22 Sep 2006 21:00:04 -0700 Subject: [sf-perl] Dim Sum planned for Sunday, September 24 Message-ID: Vicki and I haven't done Dim Sum in a while. We hope you can join us! Date: Sunday, September 24 Time: 10:15 am. N.B. - Doors open at 10:30. Please try to arrive by 10:15 OR make sure we know you are coming! We will go in and get a table at 10:30. Location: Hong Kong Flower Lounge (650) 692-6666 51 Millbrae Ave. at El Camino Real Millbrae, CA 3-story pinkish building with a green tile roof underground parking garage, street parking Directions: 1+ blocks from the Millbrae BART/Caltrain station (but finding the right train is YOUR problem :-) From 101, take "Millbrae Ave" exit west to ECR, cross ECR, pass restaurant and make a U turn at the next street (or park and walk back). From 280, take "Trousdale Ave" exit east to ECR, turn North on ECR and drive about 1/4 mile to Millbrae Ave. Turn left, pass restaurant and make a U turn at the next street (or park and walk back). http://maps.yahoo.com/py/maps.py?BFCat=&Pyt=Tmap&newFL=Use+Address+Below&addr=El+Camino+Real+and+Millbrae+Ave&csz=Millbrae%2C+CA&Country=us&Get%A0Map=Get+Map P.S. For those with vegetarian tendencies, we recognize that Dim Sum is not generally high in veg. content. But this place has greens, mushrooms, and such AND you can order any dish from the regular menu so you ought to be able to find a mixed vegetable plate if you want to be sociable. -- -- ZZz Vicki Brown zZ P.O. Box 1269 Rich Morin zz |\ _,,,---,,_ San Bruno, CA Bebop, Squirrel, /,`.-'`' -. ;-;;,_ 94066 USA Mezzaluna & Raven |,4- ) )-,_. ,\ ( `'-' http://www.cfcl.com/ '---''(_/--' `-'\_) +1-650-873-7842 From qw at sf.pm.org Mon Sep 25 07:58:42 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Mon, 25 Sep 2006 07:58:42 -0700 Subject: [sf-perl] Little Star is on, 6:30 Tuesday In-Reply-To: <20060922015847.GA44626@fu.funkspiel.org> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> <20060922015847.GA44626@fu.funkspiel.org> Message-ID: <20060925145842.GA79015@fu.funkspiel.org> On Thu, Sep 21, 2006 at 06:58:47PM -0700, Quinn Weaver wrote: > [...] > How about a 6:30 meeting? If that's too early for anyone, sing out > (let's say before Saturday). I'll post again when the time is firm. All right, there have been no objections, so we'll meet at 6:30. I've updated the web page (http://sf.pm.org/weblog). I'll be outside by 6:15 to meet people (wearing my blue Perl Monks T-shirt). Please try to arrive at 6:30 or before. If you arrive late, we'll try to make room for you, but Little Star has a policy of giving you a table only big enough for the people who are actually present. Thanks, and see you there! -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From rdm at cfcl.com Mon Sep 25 10:16:54 2006 From: rdm at cfcl.com (Rich Morin) Date: Mon, 25 Sep 2006 10:16:54 -0700 Subject: [sf-perl] Beer & Scripting SIG reminder Message-ID: The Beer & Scripting SIG (http://www.cfcl.com/rdm/bass) will take place Wednesday evening, 8/27. Be there or be elsewhere! In case you were wondering, the discussions at BASS gatherings are not, erm, scripted. Rather, they reflect the interests of whatever scripters happen to show up that evening. One recent gathering focused on databases (especially PostgreSQL); other gatherings have discussed the vagaries of doing scripting for a living, which languages folks like (and why), etc. Sometimes, folks bring in books that they have recently read, software that they want to show off, etc. The informal nature of the gatherings allows this, as long as it doesn't conflict with important things like ordering and eating food! Also note that the calendar of Bay Area Scripting Events is available and open to submissions (all your BASE are belong to us :-). * webcal://cfcl.com/pub_dav/BA_Scripting_Groups.ics * http://cfcl.com/pub_dav/BA_Scripting_Groups.ics and that the list of local scripting groups is online at SF Bay Area Scripting Groups http://www.cfcl.com/rdm/bass/groups.php -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From rdm at cfcl.com Mon Sep 25 10:28:43 2006 From: rdm at cfcl.com (Rich Morin) Date: Mon, 25 Sep 2006 10:28:43 -0700 Subject: [sf-perl] Beer & Scripting SIG reminder (resend) Message-ID: [ Fixed the day; botched the month! Sigh. -r ] The Beer & Scripting SIG (http://www.cfcl.com/rdm/bass) will take place Wednesday evening, 9/27. Be there or be elsewhere! In case you were wondering, the discussions at BASS gatherings are not, erm, scripted. Rather, they reflect the interests of whatever scripters happen to show up that evening. One recent gathering focused on databases (especially PostgreSQL); other gatherings have discussed the vagaries of doing scripting for a living, which languages folks like (and why), etc. Sometimes, folks bring in books that they have recently read, software that they want to show off, etc. The informal nature of the gatherings allows this, as long as it doesn't conflict with important things like ordering and eating food! Also note that the calendar of Bay Area Scripting Events is available and open to submissions (all your BASE are belong to us :-). * webcal://cfcl.com/pub_dav/BA_Scripting_Groups.ics * http://cfcl.com/pub_dav/BA_Scripting_Groups.ics and that the list of local scripting groups is online at SF Bay Area Scripting Groups http://www.cfcl.com/rdm/bass/groups.php -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From bwalz at paradigm-healthcare.com Mon Sep 25 11:34:23 2006 From: bwalz at paradigm-healthcare.com (Bill Walz) Date: Mon, 25 Sep 2006 11:34:23 -0700 Subject: [sf-perl] Perl App Install Location Message-ID: <1159209263.13929.18.camel@localhost.localdomain> I am interested in your comments/thoughts about where you install your custom Perl applications. I wrote and maintain a Apache2/Mod_Perl2/HTML::Mason web application that has a large Perl library. The library is also used on/by several different systems and processes that perform maintenance tasks, data imports, etc. Currently the application resides in /local with my Perl library in /local/site_perl. I use the system installed Perl and add "use lib qw(/local/site_perl);" to all of my scripts. I am now thinking about packaging up the library for installation into Perl's site_perl, i.e. Makefile.PL etc. This would add extra sanity checks into my release process (module prerequisite checking, etc) and make the release process more formal than a simple scp/untar. Besides the addition of having /usr/lib/perl5/site_perl/5.8.x directories hanging around what are your thoughts? Regards, Bill Walz From friedman at highwire.stanford.edu Mon Sep 25 11:54:38 2006 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Mon, 25 Sep 2006 11:54:38 -0700 Subject: [sf-perl] Perl App Install Location In-Reply-To: <1159209263.13929.18.camel@localhost.localdomain> References: <1159209263.13929.18.camel@localhost.localdomain> Message-ID: <70CF8332-753F-459C-AD9C-D98DABE0A20B@highwire.stanford.edu> My company made this decision the first time we upgraded perl itself out from under our custom libraries. Rather than spend the time to package our pure-perl stuff up as CPAN-style packages, we just moved it out of the local hierarchy and use PERL5LIB for each user that has to use it. That way we can upgrade perl itself without having to reinstall our custom code. (And we can have *different* local copies for each developer, even though it all runs on a shared server.) However, we "install" our custom code via shared NFS mounts. If you install code to individual machines using local disk, it's probably easier to package it up the standard way. -- Mike Friedman On Sep 25, 2006, at 11:34 AM, Bill Walz wrote: > I am interested in your comments/thoughts about where you install your > custom Perl applications. > > I wrote and maintain a Apache2/Mod_Perl2/HTML::Mason web application > that has a large Perl library. The library is also used on/by several > different systems and processes that perform maintenance tasks, data > imports, etc. > > Currently the application resides in /local with my Perl library > in /local/site_perl. I use the system installed Perl and add "use lib > qw(/local/site_perl);" to all of my scripts. > > I am now thinking about packaging up the library for installation into > Perl's site_perl, i.e. Makefile.PL etc. This would add extra sanity > checks into my release process (module prerequisite checking, etc) and > make the release process more formal than a simple scp/untar. > > Besides the addition of having /usr/lib/perl5/site_perl/5.8.x > directories hanging around what are your thoughts? > > Regards, > Bill Walz > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm --------------------------------------------------------------------- Michael Friedman HighWire Press Phone: 650-725-1974 Stanford University FAX: 270-721-8034 --------------------------------------------------------------------- From rdm at cfcl.com Tue Sep 26 07:23:46 2006 From: rdm at cfcl.com (Rich Morin) Date: Tue, 26 Sep 2006 07:23:46 -0700 Subject: [sf-perl] OT: Electric Vehicle Rally, Palo Alto, 9/30 Message-ID: WHEN Saturday, September 30, 2006 10:00 AM - 4:00 PM WHERE Palo Alto High School 50 Embarcadero Rd Palo Alto, CA, California 94301 CATEGORY Social DESCRIPTION The Electric Auto Association (EAA) has been organizing rallies for more than 30 years to help introduce electric vehicles to the public. The 2006 EV Rally at Palo Alto High School will include several production electric vehicles which will be on display for the public (with some available for test rides) as well as privately owned electric and other alt fuel vehicles which have been in regular use in the Bay Area for many years. http://upcoming.org/event/101726/ -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From qw at sf.pm.org Wed Sep 27 17:14:34 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Wed, 27 Sep 2006 17:14:34 -0700 Subject: [sf-perl] Little Star is on, 6:30 Tuesday In-Reply-To: <20060925145842.GA79015@fu.funkspiel.org> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> <20060922015847.GA44626@fu.funkspiel.org> <20060925145842.GA79015@fu.funkspiel.org> Message-ID: <20060928001434.GA98550@fu.funkspiel.org> Report back from last night: the Little Star trip was a success. The deep- dish pizza is excellent: similar to Zachary's, but a little more cheese-gooey, a little less dense, and with a lighter, crumblier crust made of cornbread. The thin pizza was also very good. They had a few good beers on tap, plus a per-glass wine list we didn't try. My only complaint was that the place was too loud. My not-so-secret agenda for this meeting was to find out if Zachary's was worth ordering for future meetings. It seems the verdict is yes. They don't deliver, so someone will have to pick them up, but that looks doable. :) -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Wed Sep 27 17:19:44 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Wed, 27 Sep 2006 17:19:44 -0700 Subject: [sf-perl] Little Star is on, 6:30 Tuesday In-Reply-To: <20060928001434.GA98550@fu.funkspiel.org> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> <20060922015847.GA44626@fu.funkspiel.org> <20060925145842.GA79015@fu.funkspiel.org> <20060928001434.GA98550@fu.funkspiel.org> Message-ID: <20060928001944.GB98550@fu.funkspiel.org> On Wed, Sep 27, 2006 at 05:14:34PM -0700, Quinn Weaver wrote: > Report back from last night: the Little Star trip was a success. > [...] > My not-so-secret agenda for this meeting was to find out if Zachary's $line =~ s{ Zachary's }{Little Star}smx; > was worth ordering for future meetings. -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From ds94103 at earthlink.net Wed Sep 27 18:21:28 2006 From: ds94103 at earthlink.net (David Scott) Date: Wed, 27 Sep 2006 18:21:28 -0700 Subject: [sf-perl] Little Star is on, 6:30 Tuesday In-Reply-To: <20060928001944.GB98550@fu.funkspiel.org> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> <20060922015847.GA44626@fu.funkspiel.org> <20060925145842.GA79015@fu.funkspiel.org> <20060928001434.GA98550@fu.funkspiel.org> <20060928001944.GB98550@fu.funkspiel.org> Message-ID: <451B2398.4060904@earthlink.net> Important to note that Little Star just opened a second location on Valencia at 15th in San Francisco. Parking is still an issue, but it's only 2 blocks from Bart. You won't find them on line; the phone is 415-551-7827. David Quinn Weaver wrote: > On Wed, Sep 27, 2006 at 05:14:34PM -0700, Quinn Weaver wrote: > >> Report back from last night: the Little Star trip was a success. >> > > >> [...] >> > > >> My not-so-secret agenda for this meeting was to find out if Zachary's >> > > $line =~ s{ Zachary's }{Little Star}smx; > > >> was worth ordering for future meetings. >> > > -- > qw (Quinn Weaver); #President, San Francisco Perl Mongers > =for information, visit http://sf.pm.org/weblog =cut > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > From rdm at cfcl.com Wed Sep 27 18:47:27 2006 From: rdm at cfcl.com (Rich Morin) Date: Wed, 27 Sep 2006 18:47:27 -0700 Subject: [sf-perl] Little Star is on, 6:30 Tuesday In-Reply-To: <451B2398.4060904@earthlink.net> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> <20060922015847.GA44626@fu.funkspiel.org> <20060925145842.GA79015@fu.funkspiel.org> <20060928001434.GA98550@fu.funkspiel.org> <20060928001944.GB98550@fu.funkspiel.org> <451B2398.4060904@earthlink.net> Message-ID: At 6:21 PM -0700 9/27/06, David Scott wrote: > Important to note that Little Star just opened a second location on > Valencia at 15th in San Francisco. Parking is still an issue, but it's > only 2 blocks from Bart. You won't find them on line; the phone is > 415-551-7827. +1 -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From bwalz at paradigm-healthcare.com Thu Sep 28 11:18:50 2006 From: bwalz at paradigm-healthcare.com (Bill Walz) Date: Thu, 28 Sep 2006 11:18:50 -0700 Subject: [sf-perl] Perl App Install Location In-Reply-To: <70CF8332-753F-459C-AD9C-D98DABE0A20B@highwire.stanford.edu> References: <1159209263.13929.18.camel@localhost.localdomain> <70CF8332-753F-459C-AD9C-D98DABE0A20B@highwire.stanford.edu> Message-ID: <1159467530.31051.3.camel@localhost.localdomain> Thank you for your response. I just upgraded a development machine from Fedora Core 4, to Core 5 and after looking in /usr/lib/perl5 I found 7 versions of Perl. So for the time being I will be keeping the library in its own location. -Bill On Mon, 2006-09-25 at 11:54 -0700, Michael Friedman wrote: > My company made this decision the first time we upgraded perl itself > out from under our custom libraries. Rather than spend the time to > package our pure-perl stuff up as CPAN-style packages, we just moved > it out of the local hierarchy and use PERL5LIB for each user that has > to use it. > > That way we can upgrade perl itself without having to reinstall our > custom code. (And we can have *different* local copies for each > developer, even though it all runs on a shared server.) > > However, we "install" our custom code via shared NFS mounts. If you > install code to individual machines using local disk, it's probably > easier to package it up the standard way. > > -- Mike Friedman > > On Sep 25, 2006, at 11:34 AM, Bill Walz wrote: > > > I am interested in your comments/thoughts about where you install your > > custom Perl applications. > > > > I wrote and maintain a Apache2/Mod_Perl2/HTML::Mason web application > > that has a large Perl library. The library is also used on/by several > > different systems and processes that perform maintenance tasks, data > > imports, etc. > > > > Currently the application resides in /local with my Perl library > > in /local/site_perl. I use the system installed Perl and add "use lib > > qw(/local/site_perl);" to all of my scripts. > > > > I am now thinking about packaging up the library for installation into > > Perl's site_perl, i.e. Makefile.PL etc. This would add extra sanity > > checks into my release process (module prerequisite checking, etc) and > > make the release process more formal than a simple scp/untar. > > > > Besides the addition of having /usr/lib/perl5/site_perl/5.8.x > > directories hanging around what are your thoughts? > > > > Regards, > > Bill Walz > > > > > > _______________________________________________ > > SanFrancisco-pm mailing list > > SanFrancisco-pm at pm.org > > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm > > --------------------------------------------------------------------- > Michael Friedman HighWire Press > Phone: 650-725-1974 Stanford University > FAX: 270-721-8034 > --------------------------------------------------------------------- > > > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm From rdm at cfcl.com Thu Sep 28 12:08:55 2006 From: rdm at cfcl.com (Rich Morin) Date: Thu, 28 Sep 2006 12:08:55 -0700 Subject: [sf-perl] passing array and hash references Message-ID: Clues, comments, suggestions? -r #!/usr/bin/env perl # # parm_test - test parameter passing methods # # Assume that you have a large body of code that was written # in Perl 4, using typeglobs to pass arrays and hashes into # functions. You want to kill off this ancient usage, moving # to a method that complies with "use strict". However, code # changes take effort and have associated risks. So, what is # the "minimal cost" strategy for achieving your goals? # # Written by Rich Morin, rdm at cfcl.com, 2006.09 use warnings; { my (@array, %hash); # Testbed: For each test function, assign some values, # call the function, and print the (possibly # updated) values. $array[42] = 'a_val'; $hash{'42'} = 'h_val'; t_tg(\@array, \%hash); # uses typeglobs print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; $array[42] = 'a_val'; $hash{'42'} = 'h_val'; t_ia(\@array, \%hash); # uses implicit arrows print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; $array[42] = 'a_val'; $hash{'42'} = 'h_val'; t_ea(\@array, \%hash); # uses explicit arrows print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; $array[42] = 'a_val'; $hash{'42'} = 'h_val'; t_dr(\@array, \%hash); # uses dereferencing print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; } # t_tg - test use of typeglobs # # Use of typeglobs to accept array and hash references is a # Perl 4 hack. It does not work under "use strict". # sub t_tg { (*array, *hash) = @_; print "\nt_tg:\n"; print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; $array[42] = 'a_tg'; # Modifies passed parameter, $hash{'42'} = 'h_tg'; # but fails "use strict". } # t_ia - test use of implicit arrows # # As I read Programming Perl (3rd. ed), these are equivalent: # # $$arrayref[2] $$hashref{'x'} # $arrayref->[2] $hashref->{'x'} # # So, it should be possible to bring in references as function # parameters and then treat them as if they were arrays or # hashes. And, indeed, it works. Unfortunately, it does not # comply with "use strict": # # Variable "@array" is not imported at parm_test line 81. # Variable "%hash" is not imported at parm_test line 82. # ... # sub t_ia { my ($array, $hash) = @_; print "\nt_ia:\n"; print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; $array[42] = 'a_ia'; # Modifies passed parameter, $hash{'42'} = 'h_ia'; # but fails "use strict". } use strict; # t_ea - test use of explicit arrows # # Bringing in references and using them with explicit arrow # notation works and complies with "use strict". However, it # requires editing quite a bit of code. # sub t_ea { my ($array, $hash) = @_; print "\nt_ea:\n"; print " array: ", $array->[42], "\n"; print " hash: ", $hash->{'42'}, "\n"; $array->[42] = 'a_ea'; # Modifies passed parameter. $hash->{'42'} = 'h_ea'; # Ditto. } # t_dr - test use of dereferencing # # It's possible to bring in references, then dereference them # and assign the result to arrays or hashes. This complies # with "use strict", but it has two practical limitations. If # the data structure is large, the overhead of copying it may # be unacceptable. Worse, changes made to the copy will not # affect the callers' data, so the changed code might not act # in the same manner as the original code did. # sub t_dr { my ($r_a, $r_h) = @_; my (@array, %hash); @array = @$r_a; %hash = %$r_h; print "\nt_dr:\n"; print " array: ", $array[42], "\n"; print " hash: ", $hash{'42'}, "\n"; $array[42] = 'a_dr'; # Modifies local data. $hash{'42'} = 'h_dr'; # ditto } -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From david at fetter.org Thu Sep 28 12:18:06 2006 From: david at fetter.org (David Fetter) Date: Thu, 28 Sep 2006 12:18:06 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: Message-ID: <20060928191806.GF22129@fetter.org> On Thu, Sep 28, 2006 at 12:08:55PM -0700, Rich Morin wrote: > Clues, comments, suggestions? Um, what is it that you want the above on? I generally pass references into functions, and increasingly just one reference to a hash (named parameters) per Perl Best Practices. :) Cheers, D > -r > > > #!/usr/bin/env perl > # > # parm_test - test parameter passing methods > # > # Assume that you have a large body of code that was written > # in Perl 4, using typeglobs to pass arrays and hashes into > # functions. You want to kill off this ancient usage, moving > # to a method that complies with "use strict". However, code > # changes take effort and have associated risks. So, what is > # the "minimal cost" strategy for achieving your goals? > # > # Written by Rich Morin, rdm at cfcl.com, 2006.09 > > > use warnings; > > > { > my (@array, %hash); > > # Testbed: For each test function, assign some values, > # call the function, and print the (possibly > # updated) values. > > $array[42] = 'a_val'; > $hash{'42'} = 'h_val'; > t_tg(\@array, \%hash); # uses typeglobs > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_val'; > $hash{'42'} = 'h_val'; > t_ia(\@array, \%hash); # uses implicit arrows > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_val'; > $hash{'42'} = 'h_val'; > t_ea(\@array, \%hash); # uses explicit arrows > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_val'; > $hash{'42'} = 'h_val'; > t_dr(\@array, \%hash); # uses dereferencing > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > } > > > # t_tg - test use of typeglobs > # > # Use of typeglobs to accept array and hash references is a > # Perl 4 hack. It does not work under "use strict". > # > sub t_tg { > > (*array, *hash) = @_; > > print "\nt_tg:\n"; > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_tg'; # Modifies passed parameter, > $hash{'42'} = 'h_tg'; # but fails "use strict". > } > > > # t_ia - test use of implicit arrows > # > # As I read Programming Perl (3rd. ed), these are equivalent: > # > # $$arrayref[2] $$hashref{'x'} > # $arrayref->[2] $hashref->{'x'} > # > # So, it should be possible to bring in references as function > # parameters and then treat them as if they were arrays or > # hashes. And, indeed, it works. Unfortunately, it does not > # comply with "use strict": > # > # Variable "@array" is not imported at parm_test line 81. > # Variable "%hash" is not imported at parm_test line 82. > # ... > # > sub t_ia { > > my ($array, $hash) = @_; > > print "\nt_ia:\n"; > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_ia'; # Modifies passed parameter, > $hash{'42'} = 'h_ia'; # but fails "use strict". > } > > > use strict; > > > # t_ea - test use of explicit arrows > # > # Bringing in references and using them with explicit arrow > # notation works and complies with "use strict". However, it > # requires editing quite a bit of code. > # > sub t_ea { > > my ($array, $hash) = @_; > > print "\nt_ea:\n"; > print " array: ", $array->[42], "\n"; > print " hash: ", $hash->{'42'}, "\n"; > > $array->[42] = 'a_ea'; # Modifies passed parameter. > $hash->{'42'} = 'h_ea'; # Ditto. > } > > > # t_dr - test use of dereferencing > # > # It's possible to bring in references, then dereference them > # and assign the result to arrays or hashes. This complies > # with "use strict", but it has two practical limitations. If > # the data structure is large, the overhead of copying it may > # be unacceptable. Worse, changes made to the copy will not > # affect the callers' data, so the changed code might not act > # in the same manner as the original code did. > # > sub t_dr { > > my ($r_a, $r_h) = @_; > > my (@array, %hash); > > @array = @$r_a; > %hash = %$r_h; > > print "\nt_dr:\n"; > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_dr'; # Modifies local data. > $hash{'42'} = 'h_dr'; # ditto > } > -- > http://www.cfcl.com/rdm Rich Morin > http://www.cfcl.com/rdm/resume rdm at cfcl.com > http://www.cfcl.com/rdm/weblog +1 650-873-7841 > > Technical editing and writing, programming, and web development > _______________________________________________ > SanFrancisco-pm mailing list > SanFrancisco-pm at pm.org > http://mail.pm.org/mailman/listinfo/sanfrancisco-pm -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From rdm at cfcl.com Thu Sep 28 13:08:13 2006 From: rdm at cfcl.com (Rich Morin) Date: Thu, 28 Sep 2006 13:08:13 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <20060928191806.GF22129@fetter.org> References: <20060928191806.GF22129@fetter.org> Message-ID: > At 12:18 PM -0700 9/28/06, David Fetter wrote: >> On Thu, Sep 28, 2006 at 12:08:55PM -0700, Rich Morin wrote: >>> Clues, comments, suggestions? >> >> Um, what is it that you want the above on? I >> generally pass references into functions, and >> increasingly just one reference to a hash (named >> parameters) per Perl Best Practices. :) I rather thought this paragraph laid out the objective: > # Assume that you have a large body of code that was written > # in Perl 4, using typeglobs to pass arrays and hashes into > # functions. You want to kill off this ancient usage, moving > # to a method that complies with "use strict". However, code > # changes take effort and have associated risks. So, what is > # the "minimal cost" strategy for achieving your goals? If the problem were "how should I code something from scratch", using a single parameter hash might be an appropriate suggestion. However, if you are tackling a "large body of code", converting it all to use this technique may not be feasible (let alone safe). So, what IS the appropriate fix? My code example shows several alternatives; is any of them the clear winner? If so, why? If not, what other approach(es) should be considered (and why)? -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From david at fetter.org Thu Sep 28 16:55:41 2006 From: david at fetter.org (David Fetter) Date: Thu, 28 Sep 2006 16:55:41 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: <20060928191806.GF22129@fetter.org> Message-ID: <20060928235541.GN22129@fetter.org> On Thu, Sep 28, 2006 at 01:08:13PM -0700, Rich Morin wrote: > > At 12:18 PM -0700 9/28/06, David Fetter wrote: > >> On Thu, Sep 28, 2006 at 12:08:55PM -0700, Rich Morin wrote: > >>> Clues, comments, suggestions? > >> > >> Um, what is it that you want the above on? I > >> generally pass references into functions, and > >> increasingly just one reference to a hash (named > >> parameters) per Perl Best Practices. :) > > I rather thought this paragraph laid out the objective: > > > # Assume that you have a large body of code that was written > > # in Perl 4, using typeglobs to pass arrays and hashes into > > # functions. You want to kill off this ancient usage, moving > > # to a method that complies with "use strict". However, code > > # changes take effort and have associated risks. So, what is > > # the "minimal cost" strategy for achieving your goals? D'oh. My bad. > If the problem were "how should I code something from scratch", > using a single parameter hash might be an appropriate suggestion. > However, if you are tackling a "large body of code", converting it > all to use this technique may not be feasible (let alone safe). > > So, what IS the appropriate fix? My code example shows several > alternatives; is any of them the clear winner? If so, why? If not, > what other approach(es) should be considered (and why)? At some point, a body of perl4 code is going to need invasive changes on a large scale, just as C89 or Fortran66 code would. Those changes will get larger and more expensive the longer it remains unmaintained. I wish I had some kind of silver bullet here, but I suspect that anything short of a rewrite for perl5.8x is going to be more expensive than just doing the maintenance this code hasn't had. Cheers, D -- David Fetter http://fetter.org/ phone: +1 415 235 3778 AIM: dfetter666 Skype: davidfetter Remember to vote! From rdm at cfcl.com Thu Sep 28 17:05:06 2006 From: rdm at cfcl.com (Rich Morin) Date: Thu, 28 Sep 2006 17:05:06 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <20060928235541.GN22129@fetter.org> References: <20060928191806.GF22129@fetter.org> <20060928235541.GN22129@fetter.org> Message-ID: At 4:55 PM -0700 9/28/06, David Fetter wrote: > At some point, a body of perl4 code is going to need > invasive changes on a large scale, ... You're preaching to the choir here. However, the question at hand has to do with a specific transformation (typeglob to ???). Should I infer that you would simply accept the pain of changing all the *foo's to $foo's and adding "->" to all the places where $foo is now being used? -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From dick at cfcl.com Thu Sep 28 17:38:25 2006 From: dick at cfcl.com (Richard Karpinski) Date: Thu, 28 Sep 2006 17:38:25 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: <20060928191806.GF22129@fetter.org> <20060928235541.GN22129@fetter.org> Message-ID: <03E97505-D10B-4AFB-A8F8-F53F2FF5C9FF@cfcl.com> It would suffice to have a compiler do that for you, would it not? I have a transformational attribute grammar compiler which could do that in a page of code or less. It was a major project of the Tiny Basic guy, Tom Pittman, author of "The Art of Compiler Design", after he got his Ph.D. in CS at Santa Cruz. Want it? Dick On 2006, Sep 28, , at 17:05, Rich Morin wrote: > You're preaching to the choir here. However, the question > at hand has to do with a specific transformation (typeglob > to ???). Should I infer that you would simply accept the > pain of changing all the *foo's to $foo's and adding "->" > to all the places where $foo is now being used? From rdm at cfcl.com Thu Sep 28 17:49:17 2006 From: rdm at cfcl.com (Rich Morin) Date: Thu, 28 Sep 2006 17:49:17 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <03E97505-D10B-4AFB-A8F8-F53F2FF5C9FF@cfcl.com> References: <20060928191806.GF22129@fetter.org> <20060928235541.GN22129@fetter.org> <03E97505-D10B-4AFB-A8F8-F53F2FF5C9FF@cfcl.com> Message-ID: At 5:38 PM -0700 9/28/06, Richard Karpinski wrote: > I have a transformational attribute grammar compiler > which could do that in a page of code or less. ... Yep, and it could probably be coded up in a page of Perl. Problem is, introducing changes (whether manually or via programs) always carries some risk. How sure am I that: * the new syntax will be functionally equivalent in all possible cases (including buggy code that currently works only by happenstance :-) * the program won't foul up the editing process, putting arrows in places where they don't belong * "use script" will catch anything that's worng If I'm not _entirely_ sure of these, the conservative approach is to do minimal changes. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From qw at sf.pm.org Thu Sep 28 21:00:14 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Thu, 28 Sep 2006 21:00:14 -0700 Subject: [sf-perl] office chairs In-Reply-To: <20060530141713.GB59923@fu.funkspiel.org> References: <20060530141713.GB59923@fu.funkspiel.org> Message-ID: <20060929040014.GA7781@fu.funkspiel.org> On Tue, May 30, 2006 at 07:17:13AM -0700, Quinn Weaver wrote: > [...] > While we're on the topic, I am thinking of buying a new desk. > I tend to switch back and forth between a desktop and a laptop > for ergonomic reasons. I think my best bet is to get something > that lets adjust monitor height instantly (and ideally keyboard > height too), so what I really need a desk that consists of two > planes, each of which can be moved up or down easily. > > Does anyone know of such a beast, offhand? Finally got around to buying one. I chose the Tradewinds SOHO workstation: http://www.backdesigns.com/AB1921000Store/product1.asp?SID=1&Product_ID=128 Finding a better price is left as an exercise for the reader (I bought mine at a brick-and-mortar store after trying out various stuff). In the original thread, Rich was asking about chairs. Interestingly, I found a chair I liked too, but I couldn't justify spending the money on it: https://www.backdesigns.com/AB1921000Store/product1.asp?SID=1&Product_ID=51 It looks completely bizarre, but it's very comfortable. It really keeps your spine straight and your feet comfortably planted--and, yes, it is much like riding posture. -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Thu Sep 28 23:10:06 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Thu, 28 Sep 2006 23:10:06 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: Message-ID: <20060929061005.GB7781@fu.funkspiel.org> On Thu, Sep 28, 2006 at 12:08:55PM -0700, Rich Morin wrote: > Clues, comments, suggestions? > [...] Rich, I have a novel solution to your problem. It combines the minimal code changes of the dereferencing approach with the semantics of references. Also, it complies with warnings and strictures. It accomplishes this using aliases, via the CPAN module Data::Alias: #!/usr/bin/perl use warnings; use strict; use Data::Alias; use Data::Dumper; { my @array = qw( 1 2 3 ); my %hash = ( a => 4, b => 5, c => 6, ); print "Values before mutation:\n"; print Data::Dumper->Dump( [ \@array ], "array" ); print Data::Dumper->Dump( [ \%hash ], "hash" ); print "\n"; t_alias (\@array, \%hash); print "Values after mutation:\n"; print Data::Dumper->Dump( [ \@array ], [ "array" ]); print Data::Dumper->Dump( [ \%hash ], [ "hash" ]); print "\n"; } sub t_alias { my ($array_ref, $hash_ref) = @_; alias my @array = @$array_ref; # Doesn't copy; just aliases. alias my %hash = %$hash_ref; # ditto $array[2] = 'a_dr'; # Modifies original data, not a local copy! $hash{c} = 'h_dr'; # ditto } Compare this to your code: > # t_dr - test use of dereferencing > # > # It's possible to bring in references, then dereference them > # and assign the result to arrays or hashes. This complies > # with "use strict", but it has two practical limitations. If > # the data structure is large, the overhead of copying it may > # be unacceptable. Not a problem if you use aliases. :) > Worse, changes made to the copy will not > # affect the callers' data, so the changed code might not act > # in the same manner as the original code did. Also not a problem if you use aliases. :) > # > sub t_dr { > > my ($r_a, $r_h) = @_; > > my (@array, %hash); > > @array = @$r_a; > %hash = %$r_h; > > print "\nt_dr:\n"; > print " array: ", $array[42], "\n"; > print " hash: ", $hash{'42'}, "\n"; > > $array[42] = 'a_dr'; # Modifies local data. > $hash{'42'} = 'h_dr'; # ditto > } I think this solution hits the sweet spot. It requires that you modify only the subroutine call t_alias (\@array, \%hash); # Use references, not globs. and the first few lines of the sub: sub t_alias { my ($array_ref, $hash_ref) = @_; alias my @array = @$array_ref; # Doesn't copy; just aliases. alias my %hash = %$hash_ref; # ditto From there on out, your sub can use @array and %hash just as if they had been passed in as globs, including side-effect semantics. There's no need to insert arrows for dereferencing or otherwise modify the sub body. Does this make sense? -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From rdm at cfcl.com Fri Sep 29 00:18:45 2006 From: rdm at cfcl.com (Rich Morin) Date: Fri, 29 Sep 2006 00:18:45 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <20060929061005.GB7781@fu.funkspiel.org> References: <20060929061005.GB7781@fu.funkspiel.org> Message-ID: At 11:10 PM -0700 9/28/06, Quinn Weaver wrote: > Rich, I have a novel solution to your problem. It combines > the minimal code changes of the dereferencing approach with > the semantics of references. Also, it complies with > warnings and strictures. My subscription to this list keeps on paying for itself... Thanks, Quinn (as well as the Man With Too Many Initials :-). > It requires that you modify only the subroutine call > > t_alias (\@array, \%hash); # Use references, not globs. I don't see that this requires any change to the calling code. Although the _receiving_ code no longer uses typeglobs, the _calling_ code uses the same syntax it did before: t_tg(\@array, \%hash); This is great stuff, Quinn! Now, before I go dancing in the streets, are there any caveats about performance, safety, etc? FWIW, the IMPLEMENTATION and KNOWN ISSUES sections of the docs are slightly scary, but indicate that this is pretty robust: http://search.cpan.org/~xmath/Data-Alias-1.0/lib/Data/Alias.pm -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From qw at sf.pm.org Fri Sep 29 00:34:22 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Fri, 29 Sep 2006 00:34:22 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: <20060929061005.GB7781@fu.funkspiel.org> Message-ID: <20060929073422.GA8667@fu.funkspiel.org> On Fri, Sep 29, 2006 at 12:18:45AM -0700, Rich Morin wrote: > At 11:10 PM -0700 9/28/06, Quinn Weaver wrote: > > Rich, I have a novel solution to your problem. It combines > > the minimal code changes of the dereferencing approach with > > the semantics of references. Also, it complies with > > warnings and strictures. > > My subscription to this list keeps on paying for itself... > Thanks, Quinn (as well as the Man With Too Many Initials :-). > > > > It requires that you modify only the subroutine call > > > > t_alias (\@array, \%hash); # Use references, not globs. > > > I don't see that this requires any change to the calling code. > Although the _receiving_ code no longer uses typeglobs, the > _calling_ code uses the same syntax it did before: > > t_tg(\@array, \%hash); Ah. I was thinking the call looked like this: t_tg(*array, *hash); I guess my Perl 4 skills are rusty. ;) > This is great stuff, Quinn! Glad you like it. :) > Now, before I go dancing in the > streets, are there any caveats about performance, safety, etc? I don't know; I've never used it in the wild. I just read about it in _Perl Best Practices_, and your post jogged my memory. I hope it helps! -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Fri Sep 29 00:50:50 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Fri, 29 Sep 2006 00:50:50 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <20060929073422.GA8667@fu.funkspiel.org> References: <20060929061005.GB7781@fu.funkspiel.org> <20060929073422.GA8667@fu.funkspiel.org> Message-ID: <20060929075050.GA8958@fu.funkspiel.org> On Fri, Sep 29, 2006 at 12:34:22AM -0700, Quinn Weaver wrote: > [about Data::Alias] > I just read about it > in _Perl Best Practices_, and your post jogged my memory. The use Damian suggests for it, BTW, is for modifying elements in loops: # Damian's code, not mine for my $agent_num (0..$#operatives) { alias my $agent = $operatives[$agent_num]; if ($on_disavowed_list{$agent}) { $agent = "[DISAVOWED]"; # Changes the copy in @operatives --QDW } } The larger point he's making is that you should "extract" $agent into an alias rather than doing something like this: for my $agent_num (0..$#operatives) { if ($on_disavowed_list{$operatives[$agent_num]}) { $operatives[$agent_num] = "[DISAVOWED]"; # Too much array subscripting! } # Hard to read. --QDW } -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From qw at sf.pm.org Fri Sep 29 00:53:17 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Fri, 29 Sep 2006 00:53:17 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <20060929075050.GA8958@fu.funkspiel.org> References: <20060929061005.GB7781@fu.funkspiel.org> <20060929073422.GA8667@fu.funkspiel.org> <20060929075050.GA8958@fu.funkspiel.org> Message-ID: <20060929075317.GB8958@fu.funkspiel.org> On Fri, Sep 29, 2006 at 12:50:50AM -0700, Quinn Weaver wrote: > On Fri, Sep 29, 2006 at 12:34:22AM -0700, Quinn Weaver wrote: > > > [about Data::Alias] > > > I just read about it > > in _Perl Best Practices_, and your post jogged my memory. > > The use Damian suggests for it, BTW, is for modifying elements in loops: > > # Damian's code, not mine > [...] And I am quite glad I looked up that example, because a footnote on that page says you should use Lexical::Alias instead of Data::Alias if you're on a Perl older than 5.8.1--which I'm guessing the codebase in question is. ;) -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From matt at cloudfactory.org Fri Sep 29 09:24:37 2006 From: matt at cloudfactory.org (Matthew Lanier) Date: Fri, 29 Sep 2006 09:24:37 -0700 (PDT) Subject: [sf-perl] passing array and hash references In-Reply-To: References: <20060929061005.GB7781@fu.funkspiel.org> Message-ID: On Fri, 29 Sep 2006, Rich Morin wrote: > At 11:10 PM -0700 9/28/06, Quinn Weaver wrote: > My subscription to this list keeps on paying for itself... > Thanks, Quinn (as well as the Man With Too Many Initials :-). :-) mdpksl From rdm at cfcl.com Fri Sep 29 09:17:43 2006 From: rdm at cfcl.com (Rich Morin) Date: Fri, 29 Sep 2006 09:17:43 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: <20060929075317.GB8958@fu.funkspiel.org> References: <20060929061005.GB7781@fu.funkspiel.org> <20060929073422.GA8667@fu.funkspiel.org> <20060929075050.GA8958@fu.funkspiel.org> <20060929075317.GB8958@fu.funkspiel.org> Message-ID: At 12:53 AM -0700 9/29/06, Quinn Weaver wrote: > And I am quite glad I looked up that example, because a > footnote on that page says you should use Lexical::Alias > instead of Data::Alias if you're on a Perl older than > 5.8.1--which I'm guessing the codebase in question is. ;) Fortunately, although the codebase is old, it is running under a recent version of Perl. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From qw at sf.pm.org Fri Sep 29 11:42:36 2006 From: qw at sf.pm.org (Quinn Weaver) Date: Fri, 29 Sep 2006 11:42:36 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: <20060928191806.GF22129@fetter.org> <20060928235541.GN22129@fetter.org> <03E97505-D10B-4AFB-A8F8-F53F2FF5C9FF@cfcl.com> Message-ID: <20060929184236.GB15705@fu.funkspiel.org> On Thu, Sep 28, 2006 at 05:49:17PM -0700, Rich Morin wrote: > At 5:38 PM -0700 9/28/06, Richard Karpinski wrote: > > I have a transformational attribute grammar compiler > > which could do that in a page of code or less. It was a major > > project of the Tiny Basic guy, Tom Pittman, author of > > "The Art of Compiler Design", after he got his Ph.D. > > in CS at Santa Cruz. Want it I for one am interested in this code. (I'm curious about how it stands up against PPI and camlp4/ocamllex.) Where is it? -- qw (Quinn Weaver); #President, San Francisco Perl Mongers =for information, visit http://sf.pm.org/weblog =cut From rdm at cfcl.com Fri Sep 29 14:03:33 2006 From: rdm at cfcl.com (Rich Morin) Date: Fri, 29 Sep 2006 14:03:33 -0700 Subject: [sf-perl] passing array and hash references In-Reply-To: References: Message-ID: Quinn's Excellent Hack allows us to alias an incoming reference as either an array or a hash. However, this begs the question of whether it can be used to do both at once, as a typeglob can. For that matter, can a reference be used in two different ways? So, I wrote a bit more test code. [2] The executive summary (as I suspected) is that only a typeglob can be used in two (or more) different ways. So, if the Perl 4 code is doing this, some Real Surgery (TM) will be required [1] on both the calling and called code. And, to ward off David's expected response, Real Surgery _should_ be done in this case! My current musings, FWIW, have moved on to the question of how to mechanically recognize use of typeglob parameters, generate the aliasing code, etc. Part of the problem lies in determining whether the reference needs to be aliased to an array or a hash. It would be nice to determine this, based on the uses that the called code makes of the passed variable, but this may be hard to do in a reliable fashion. However, the function call(s) should be fairly simple (and reliable) to parse. My suspicion, in any case, is that some human examination and editing will be required, at least for oddball cases. However, given that other manual effort will be needed (e.g., to add "my" statements), this may not add greatly to the overall workload. -r [1] barring another rabbit from Quinn... [2] here's the code and the output: =================================================================== % cat pt2a #!/usr/bin/env perl # # pt2a - test parameter passing methods (further) # # Written by Rich Morin, rdm at cfcl.com, 2006.09 use warnings; { my (@array, %hash); # Testbed: Assign some values, then call each function # twice (with an arrayref, then with a hashref). $foo[42] = 'a_val'; $foo{'42'} = 'h_val'; t_2a(\@foo); # Pass an arrayref. t_2a(\%foo); # Pass a hashref. } # t_2a - bring in a ref, via a typeglob # # Given the typeglob *foo, Perl is able to extract and use # both its array (@foo) and hash (%foo) portions. # sub t_2a { (*foo) = @_; print "\nt_2a:\n"; print " array: ", $foo[42], "\n"; print " hash: ", $foo{'42'}, "\n"; } % pt2a t_2a: array: a_val hash: h_val t_2a: array: a_val hash: h_val =================================================================== % cat pt2b #!/usr/bin/env perl # # pt2b - test parameter passing methods (further) # # Written by Rich Morin, rdm at cfcl.com, 2006.09 use warnings; { my (@array, %hash); # Testbed: Assign some values, then call each function # twice (with an arrayref, then with a hashref). $foo[42] = 'a_val'; $foo{'42'} = 'h_val'; t_2b(\@foo); # Pass an arrayref. t_2b(\%foo); # Pass a hashref. } # t_2b - bring in and use as a reference # # The ref approach gets confused when we try this. # # sub t_2b { my ($foo) = @_; print "\nt_2b:\n"; print " array: ", $foo->[42], "\n"; print " hash: ", $foo->{'42'}, "\n"; } % pt2b t_2b: array: a_val Can't coerce array into hash at pt2b line 34. =================================================================== % cat pt2c #!/usr/bin/env perl # # pt2c - test parameter passing methods (further) # # Written by Rich Morin, rdm at cfcl.com, 2006.09 use warnings; use Data::Alias; { my (@array, %hash); # Testbed: Assign some values, then call each function # twice (with an arrayref, then with a hashref). $foo[42] = 'a_val'; $foo{'42'} = 'h_val'; t_2c(\@foo); # Pass an arrayref. t_2c(\%foo); # Pass a hashref. } # t_2c - bring in a ref, via an alias # # The alias approach gets confused when we try this. # sub t_2c { my ($foo) = @_; alias my @foo = @$foo; alias my %foo = %$foo; print "\nt_2c:\n"; print " array: ", $foo[42], "\n"; print " hash: ", $foo{'42'}, "\n"; } % pt2c Odd number of elements in anonymous hash at pt2c line 35. Use of uninitialized value in list assignment at pt2c line 35. t_2c: array: a_val Use of uninitialized value in print at pt2c line 39. hash: Not an ARRAY reference at pt2c line 34. =================================================================== -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development From matt at cloudfactory.org Fri Sep 29 19:26:11 2006 From: matt at cloudfactory.org (Matthew Lanier) Date: Fri, 29 Sep 2006 19:26:11 -0700 (PDT) Subject: [sf-perl] Dump Perl ? (fwd) Message-ID: any takers? m@ -- ---------- Forwarded message ---------- Date: Fri, 29 Sep 2006 16:43:23 -0700 Subject: Dump Perl ? Hiya, Got a function that parses data structures. For debugging and stuff. How do I find/print the "name" of the data structure? parseStuff($array_ref, $hash_ref1, $hashref2); sub parseStuff { use Data::Dumper; foreach my $structure(@_) { print "you're looking at a data structure named [?]\n"; print "and it looks like: " . Dumper($structure) . "\n"; } } And then I want it to tell me "array_ref" and spew its contents, then "hash__ref1", etc., for an arbitrary number of arbitrarily named data structures. TIA, -Ben From andy at petdance.com Fri Sep 29 19:29:01 2006 From: andy at petdance.com (Andy Lester) Date: Fri, 29 Sep 2006 21:29:01 -0500 Subject: [sf-perl] Dump Perl ? (fwd) In-Reply-To: References: Message-ID: <70CA0A9B-4CB0-4C7F-B98B-96967B50EB41@petdance.com> On Sep 29, 2006, at 9:26 PM, Matthew Lanier wrote: > How do I find/print the "name" of the data structure? http://search.cpan.org/~ovid/Data-Dumper-Names-0.02/ -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From andy at petdance.com Fri Sep 29 19:29:01 2006 From: andy at petdance.com (Andy Lester) Date: Fri, 29 Sep 2006 21:29:01 -0500 Subject: [sf-perl] Dump Perl ? (fwd) In-Reply-To: References: Message-ID: <70CA0A9B-4CB0-4C7F-B98B-96967B50EB41@petdance.com> On Sep 29, 2006, at 9:26 PM, Matthew Lanier wrote: > How do I find/print the "name" of the data structure? http://search.cpan.org/~ovid/Data-Dumper-Names-0.02/ -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From rdm at cfcl.com Sat Sep 30 11:31:38 2006 From: rdm at cfcl.com (Rich Morin) Date: Sat, 30 Sep 2006 11:31:38 -0700 Subject: [sf-perl] Little Star is on, 6:30 Tuesday In-Reply-To: <20060928001944.GB98550@fu.funkspiel.org> References: <3A2096A63456DC469D46178CA9F8309F01497A0D@calnte2k035.insidelive.net> <200609191730.09474.josh@agliodbs.com> <20060922015847.GA44626@fu.funkspiel.org> <20060925145842.GA79015@fu.funkspiel.org> <20060928001434.GA98550@fu.funkspiel.org> <20060928001944.GB98550@fu.funkspiel.org> Message-ID: V&I visited the Valencia at 15th branch of Little Star on Thursday. The pizza was excellent and the venue is a LOT larger (2.5x ?) and a bit brighter. Still noisy, if only because of the booming bass from the "music". We had thought that parking might be a problem, but we found a place on 14th, just the other side of Mission. And, of course, there's excellent BART and Muni access. -r -- http://www.cfcl.com/rdm Rich Morin http://www.cfcl.com/rdm/resume rdm at cfcl.com http://www.cfcl.com/rdm/weblog +1 650-873-7841 Technical editing and writing, programming, and web development