From Peter at PSDT.com Mon May 24 12:19:43 2004 From: Peter at PSDT.com (Peter Scott) Date: Mon Aug 2 21:39:05 2004 Subject: [VPM] Change of mailing list Message-ID: <6.0.3.0.2.20040524101708.0249aae8@shell2.webquarry.com> The Victoria.pm mailing list was just moved and the software changed by the pm.org gods after the main list server was hacked. (There was no suggestion either way as to whether the address lists were copied.) I have changed various configuration parameters so that (I think) the list now behaves the same as before. You may have received an 'introductory' message. I verified that the addresses came across unscathed. You should not have to take any action. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From darren at DarrenDuncan.net Mon May 24 13:31:04 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Mon Aug 2 21:39:05 2004 Subject: [VPM] Change of mailing list In-Reply-To: <6.0.3.0.2.20040524101708.0249aae8@shell2.webquarry.com> References: <6.0.3.0.2.20040524101708.0249aae8@shell2.webquarry.com> Message-ID: At 10:19 AM -0700 5/24/04, Peter Scott wrote: >The Victoria.pm mailing list was just moved and the software changed >by the pm.org gods after the main list server was hacked. (There >was no suggestion either way as to whether the address lists were >copied.) I have changed various configuration parameters so that (I >think) the list now behaves the same as before. You may have >received an 'introductory' message. I verified that the addresses >came across unscathed. You should not have to take any action. It seems, though, that the message I sent at 11:38pm last night, following receipt of the welcome message, did not come back through the list. So either it was lost or delayed. It didn't bounce. -- Darren Duncan From abez at abez.ca Sat May 29 14:41:12 2004 From: abez at abez.ca (abez) Date: Mon Aug 2 21:39:05 2004 Subject: [VPM] Performing With perl Message-ID: perl will be used to help me control an instrument for a performance tonight around 6:00 PM Here is the info: http://industrial.org/prmartyr.html Third Annual Noise! Festival May 29, 2004 1923 Fernwood $10 all day / $3 vids / $8 bands DIY production house PR Martyr is proud to announce that the third annual Noise! festival will be taking place here in Victoria, B.C., Canada on Saturday, May 29, 2004. The festival is an all day event focussing on (surprise) noise based musics and media and will be featuring the talents of artists from Canada and the US creating sounds ranging from harsh digital noise to dark ambient to crazy performance art to outsider freakout and back again. Decent PA, video projection, merch table and classic video games. This is the real deal. sounds * Conure (Portland, OR, USA) * Sleeping With The Earth (Portland, OR, USA) * Impact Test Dummy (Seattle, WA, USA) * Failed Machinery (Vancouver, BC) * G42 (Vancouver, BC) * Burning Bush (Nanaimo, BC) * Grandpa Big Balls (Victoria, BC) * skruntskrunt (Victoria, BC) * Night Ape (Victoria, BC) * Bosworth (Victoria, BC) vids * "What is Circuit Bending?" documentary by Derek Sajbel * Lovid (video collage) * Recant (3 musical shorts) * Inhalant (live footage) This is an all ages event (though a pub is around the corner for those needing, ahem, refreshment). videos start at 2:30PM music starts at 5:30PM sharp (show over by 11PM) -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From darren at DarrenDuncan.net Sun May 30 21:50:57 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Mon Aug 2 21:39:05 2004 Subject: [VPM] Perl 6 Periodic Table of the Operators Message-ID: Mark Lentczner has just (on May 26/28) created a useful/humerous graphical diagram of the 100+ operators in the Perl 6 language, designed to look like the periodic table of atomic elements. It's well worth a look: http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html He announced it to perl6-language[at]perl.org on May 26th, and it was announced on Slashdot today. For those of you not reading either of those, enjoy. Further discussion: http://www.nntp.perl.org/group/perl.perl6.language -- Darren Duncan From Peter at PSDT.com Thu May 13 12:35:15 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] Victoria Perl Mongers meeting next week Message-ID: <6.0.3.0.2.20040513103112.02792f28@shell2.webquarry.com> Victoria.pm will meet at its now regular date, time, and place on Tuesday, May 18, 7pm, at UVic. Abram reserved CIT 120 as usual; email if you don't know how to get there. I will give the second half of my presentation on "Taming Legacy Perl", a practice run at a tutorial to be given at July's OSCON on dealing with inherited or old Perl code. Other topics to be covered as time permits; make requests for anything particular. (Courtesy copy to VLUG members by permission of the list manager. Victoria.pm's home page is .) Note: CIT has now been renamed to the Harry Hickman Building although the signs still say CIT until approximately September. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From Peter at PSDT.com Mon May 17 14:13:01 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] Victoria Perl Mongers meeting tomorrow Message-ID: <6.0.3.0.2.20040517112954.026d37f0@shell2.webquarry.com> Victoria.pm will meet at its now regular date, time, and place tomorrow, Tuesday, May 18, 7pm, at UVic. Abram reserved CIT 120 as usual; email if you don't know how to get there. I will give the second half of my presentation on "Taming Legacy Perl", a practice run at a tutorial to be given at July's OSCON on dealing with inherited or old Perl code. Other topics to be covered as time permits; make requests for anything particular. We could use a volunteer for a June topic. (Courtesy copy to VLUG members by permission of the list manager. Victoria.pm's home page is .) Note: CIT has now been renamed to the Harry Hickman Building although the signs still say CIT until approximately September. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From yf110 at victoria.tc.ca Wed May 19 01:14:19 2004 From: yf110 at victoria.tc.ca (Malcolm Dew-Jones) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] Victoria Perl Mongers meeting tomorrow In-Reply-To: <6.0.3.0.2.20040517112954.026d37f0@shell2.webquarry.com> References: <6.0.3.0.2.20040517112954.026d37f0@shell2.webquarry.com> Message-ID: On Mon, 17 May 2004, Peter Scott wrote: > ...I will give the > second half of my presentation on "Taming Legacy Perl", a practice run > at a tutorial to be given at July's OSCON on dealing with inherited or > old Perl code. > A good talk, and a couple of modules I ought to examine in more detail. thanks. From Peter at PSDT.com Wed May 19 17:02:34 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] Perl opportunities in L.A. Message-ID: <6.0.3.0.2.20040519145906.026315b8@shell2.webquarry.com> I just received an email from someone at TicketMaster in Los Angeles stating that they are looking for good Perl people (and already have some good ones, like Stas Bekman). While I don't want to lose any of you, I should point out that if any of you wouldn't mind living there (I realize that's a big if), it would be a fairly easy thing to do with a NAFTA TN visa. I'll provide contact information for anyone who's serious. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From cconstan at csc.UVic.CA Thu May 20 14:05:58 2004 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts Message-ID: <20040520190558.GC13417@csc> WARNING WILL ROBINSON --- NEWBIE QUESTION I'm trying to print out the value of an array reference. The reference is passed into a function as \@array. Now in that function I pass out $arrayRef to another function. It's in this final function I want to print out the value(s) of the array. I've tried @$arrayRef, $$arrayRef, $@$arrayRef, @$arrayRef[0] all to no avail. What did I miss? -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW B206, 721-8766 From abez at abez.ca Thu May 20 14:20:03 2004 From: abez at abez.ca (abez) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <20040520190558.GC13417@csc> Message-ID: $a = [ 1..10 ]; for (1..10) { print $a->[$_]; print $$a[$_]; } On Thu, 20 May 2004, Carl B. Constantine wrote: > WARNING WILL ROBINSON --- NEWBIE QUESTION > > I'm trying to print out the value of an array reference. The reference > is passed into a function as \@array. > > Now in that function I pass out $arrayRef to another function. It's in > this final function I want to print out the value(s) of the array. > > I've tried @$arrayRef, $$arrayRef, $@$arrayRef, @$arrayRef[0] all to no > avail. > > What did I miss? > > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez@abez.ca) ------------------------------------------ abez From yf110 at victoria.tc.ca Thu May 20 14:20:25 2004 From: yf110 at victoria.tc.ca (Malcolm Dew-Jones) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <20040520190558.GC13417@csc> References: <20040520190558.GC13417@csc> Message-ID: On Thu, 20 May 2004, Carl B. Constantine wrote: > WARNING WILL ROBINSON --- NEWBIE QUESTION > > I'm trying to print out the value of an array reference. The reference > is passed into a function as \@array. > > Now in that function I pass out $arrayRef to another function. It's in > this final function I want to print out the value(s) of the array. > > I've tried @$arrayRef, $$arrayRef, $@$arrayRef, @$arrayRef[0] all to no > avail. > > What did I miss? A small but complete example that illustrates the problem? @$arrayRef would normally work. @{$arrayRef} might be needed if it's part of something more complex. The following example does what it sounds like you want, so whatever is different is the problem my @array = qw(one two three four); sub func2 { my $arrayRef2 = shift; print "func2: @$arrayRef2 \n"; } sub func1 { my $arrayRef1 = shift; func2($arrayRef1); } func1( \@array ); It prints the contents of the original array. From Peter at PSDT.com Thu May 20 14:21:26 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <20040520190558.GC13417@csc> References: <20040520190558.GC13417@csc> Message-ID: <6.0.3.0.2.20040520121344.02571248@shell2.webquarry.com> At 12:05 PM 5/20/2004, Carl B. Constantine wrote: >WARNING WILL ROBINSON --- NEWBIE QUESTION > >I'm trying to print out the value of an array reference. ITYM you want the values of the array referred to by an arrayref. The value of an arrayref is useless. >The reference >is passed into a function as \@array. > >Now in that function I pass out $arrayRef to another function. It's in >this final function I want to print out the value(s) of the array. > >I've tried @$arrayRef, $$arrayRef, $@$arrayRef, @$arrayRef[0] all to no >avail. That first one should work, or it's not an arrayref. This is what happens when I do what you describe: % perl -Mstrict -wl my @array = qw(dog cat bird aardvark); foo(\@array); sub foo { my $arg = shift; bar($arg); } sub bar { my $arrayref = shift; print "@$arrayref"; } ^D dog cat bird aardvark -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From darren at DarrenDuncan.net Thu May 20 14:44:15 2004 From: darren at DarrenDuncan.net (Darren Duncan) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <20040520190558.GC13417@csc> References: <20040520190558.GC13417@csc> Message-ID: At 12:05 PM -0700 5/20/04, Carl B. Constantine wrote: >WARNING WILL ROBINSON --- NEWBIE QUESTION > >I'm trying to print out the value of an array reference. The reference >is passed into a function as \@array. > >Now in that function I pass out $arrayRef to another function. It's in >this final function I want to print out the value(s) of the array. > >I've tried @$arrayRef, $$arrayRef, $@$arrayRef, @$arrayRef[0] all to no >avail. > >What did I miss? Assuming you want the original values, then "@{$arrayRef}" can be used in exactly the same way as "@array"; "$arrayRef->[0]" or "${$arrayRef}[0]" (the first one is what I use) can be used the same way as "$array[0]". Note that Perl does have short hand syntax which allows you to leave out the {} when dereferencing the whole array, put putting it in ensures that scoping is correct (much like putting parenthesis around an expression for grouping), and keeping the {} makes the code more self-documenting. -- Darren Duncan From cconstan at csc.UVic.CA Thu May 20 15:49:18 2004 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <6.0.3.0.2.20040520121344.02571248@shell2.webquarry.com> References: <20040520190558.GC13417@csc> <6.0.3.0.2.20040520121344.02571248@shell2.webquarry.com> Message-ID: <20040520204918.GE13417@csc> *On Thu May 20, 2004 at 12:21:26PM -0700, Peter Scott (Peter@PSDT.com) wrote: > At 12:05 PM 5/20/2004, Carl B. Constantine wrote: > >WARNING WILL ROBINSON --- NEWBIE QUESTION > > > >I'm trying to print out the value of an array reference. > > ITYM you want the values of the array referred to by an arrayref. The > value of an arrayref is useless. Correct. > >I've tried @$arrayRef, $$arrayRef, $@$arrayRef, @$arrayRef[0] all to no > >avail. > > That first one should work, or it's not an arrayref. That's what I thought. > This is what happens when I do what you describe: > > % perl -Mstrict -wl > my @array = qw(dog cat bird aardvark); > foo(\@array); > sub foo { > my $arg = shift; > bar($arg); > } > sub bar { > my $arrayref = shift; > print "@$arrayref"; > } > ^D Well, what happens when I do it: @array = somefuncreturningarrayvalues(); foo(\@array) sub foo { my $arrayRef = @_; bar($arrayRef); } sub bar { my $array = @_; print "Array Values: @$array\n"; } ARRAY(HEXADDRESS) -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW B206, 721-8766 From Peter at PSDT.com Thu May 20 16:16:44 2004 From: Peter at PSDT.com (Peter Scott) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <20040520204918.GE13417@csc> References: <20040520190558.GC13417@csc> <6.0.3.0.2.20040520121344.02571248@shell2.webquarry.com> <20040520204918.GE13417@csc> Message-ID: <6.0.3.0.2.20040520141238.02592ea0@shell2.webquarry.com> At 01:49 PM 5/20/2004, Carl B. Constantine wrote: >*On Thu May 20, 2004 at 12:21:26PM -0700, Peter Scott (Peter@PSDT.com) wrote: > > At 12:05 PM 5/20/2004, Carl B. Constantine wrote: > > This is what happens when I do what you describe: > > > > % perl -Mstrict -wl > > my @array = qw(dog cat bird aardvark); > > foo(\@array); > > sub foo { > > my $arg = shift; > > bar($arg); > > } > > sub bar { > > my $arrayref = shift; > > print "@$arrayref"; > > } > > ^D > >Well, what happens when I do it: > >@array = somefuncreturningarrayvalues(); > >foo(\@array) > >sub foo { > my $arrayRef = @_; Left hand side = scalar. Right hand side = array. Therefore right hand side is in scalar context, and therefore $arrayRef will be set to the number of elements in @_. > bar($arrayRef); >} > >sub bar { > my $array = @_; > > print "Array Values: @$array\n"; >} >ARRAY(HEXADDRESS) No, it should be a run time error: Can't use string ("1") as an ARRAY ref while "strict refs" in use at - line 12. Without strict, there will be nothing printed in place of @$array. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ *** New! *** http://www.perlmedic.com/ From cconstan at csc.UVic.CA Thu May 20 16:32:37 2004 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] found the problem with the array ref Message-ID: <20040520213237.GF13417@csc> Ok, I found the problem print "@$arrayRef" does indeed work correctly. The issue is some of the code is written as a daemon and some as a library. I was modifying the library code in one spot and forgot to restart the daemon process so the library reloads. I thought I was doing it correctly. Thanks everyone for your help. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW B206, 721-8766 From cconstan at csc.UVic.CA Thu May 20 17:15:26 2004 From: cconstan at csc.UVic.CA (Carl B. Constantine) Date: Wed Aug 4 00:11:34 2004 Subject: [VPM] array refs driving me nuts In-Reply-To: <6.0.3.0.2.20040520141238.02592ea0@shell2.webquarry.com> References: <20040520190558.GC13417@csc> <6.0.3.0.2.20040520121344.02571248@shell2.webquarry.com> <20040520204918.GE13417@csc> <6.0.3.0.2.20040520141238.02592ea0@shell2.webquarry.com> Message-ID: <20040520221526.GG13417@csc> *On Thu May 20, 2004 at 02:16:44PM -0700, Peter Scott (Peter@PSDT.com) wrote: > > > >@array = somefuncreturningarrayvalues(); > > > >foo(\@array) > > > >sub foo { > > my $arrayRef = @_; > > Left hand side = scalar. > Right hand side = array. > > Therefore right hand side is in scalar context, and therefore $arrayRef > will be set to the number of elements in @_. yes. > > bar($arrayRef); > >} > > > >sub bar { > > my $array = @_; > > > > print "Array Values: @$array\n"; > >} > >ARRAY(HEXADDRESS) > > No, it should be a run time error: > > Can't use string ("1") as an ARRAY ref while "strict refs" in use at - line > 12. > > Without strict, there will be nothing printed in place of @$array. I do have strict turned on. I use it in all my perl code. But I was getting a value out as above. What happened, is I used a different form at one point (I think tired $$arrayRef first, then realized I should be using @$arrayRef) and forgot to restart the daemon that used the library I modified. Anyway, works now. -- Carl B. Constantine University of Victoria Programmer Analyst http://www.csc.uvic.ca UNIX System Administrator Victoria, BC, Canada cconstan@csc.uvic.ca ELW B206, 721-8766