From daniel at rimspace.net Sun Jul 3 19:09:54 2011 From: daniel at rimspace.net (Daniel Pittman) Date: Sun, 3 Jul 2011 19:09:54 -0700 Subject: [Melbourne-pm] Perlbrew, CPAN modules, and scripts. Message-ID: Dear Lazyweb, I wondered if anyone here used Perlbrew, and might be able to save me having to go digging into the bowels of a whole lot of the CPAN installation stack to work out why all my modules are absolutely convinced they should be installing any scripts to `/usr/local/bin` rather than, say, my selected Perl's bin under the Perlbrew root. Everything else seems to be working: modules install to the right places, and everything works, except that HTML::TreeBuilder (and, I think, a pile of other modules) want to use the wrong location. (The sitebin dir is right, vendorbin is empty, and the core bits are right.) Hints? I know that module uses Module::Build, so I wonder if it is something I (or Perlbrew) am missing? Thanks, Daniel -- ? Made with 100 percent post-consumer electrons From jarich at perltraining.com.au Mon Jul 4 15:12:08 2011 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Mon, 04 Jul 2011 17:12:08 -0500 Subject: [Melbourne-pm] Perlbrew, CPAN modules, and scripts. In-Reply-To: References: Message-ID: <4E123AB8.4030206@perltraining.com.au> On 03/07/11 21:09, Daniel Pittman wrote: > I wondered if anyone here used Perlbrew, and might be able to save me > having to go digging into the bowels of a whole lot of the CPAN > installation stack to work out why all my modules are absolutely > convinced they should be installing any scripts to `/usr/local/bin` > rather than, say, my selected Perl's bin under the Perlbrew root. > > Everything else seems to be working: modules install to the right > places, and everything works, except that HTML::TreeBuilder (and, I > think, a pile of other modules) want to use the wrong location. (The > sitebin dir is right, vendorbin is empty, and the core bits are > right.) > > Hints? I know that module uses Module::Build, so I wonder if it is > something I (or Perlbrew) am missing? > I can't say *why* you're experiencing what you are, but you might find that using local::lib will set the environment variables you need so that things consistently behave. (http://search.cpan.org/perldoc?local::lib) If it does, it will probably show you which environment variables (which have their parallels in the cpan config settings). Eg: export PERL_MB_OPT='--install_base /home/username/perl5' export PERL_MM_OPT='INSTALL_BASE=/home/username/perl5' All the best, J From benhare at gmail.com Mon Jul 4 16:53:30 2011 From: benhare at gmail.com (Ben Hare) Date: Tue, 5 Jul 2011 09:53:30 +1000 Subject: [Melbourne-pm] Perlbrew, CPAN modules, and scripts. In-Reply-To: References: Message-ID: hey Daniel, i assume this would be old news to you but you have edited "~/.cpan/CPAN/MyConfig.pm"? i haven't used perlbrew but if you're installing modules via cpan into say your home directory, i've never had any problem once setting the right args to make and Build in there. that should be the only place you need to make changes under .cpan. mbuild_install_build_command, make_arg, mbuild_install_argmake_install_arg, mbuildpl_arg etc. haven't had to do for while but they're the sort of config params that will modify install paths. cheers, Ben. On 4 July 2011 12:09, Daniel Pittman wrote: > Dear Lazyweb, > > I wondered if anyone here used Perlbrew, and might be able to save me > having to go digging into the bowels of a whole lot of the CPAN > installation stack to work out why all my modules are absolutely > convinced they should be installing any scripts to `/usr/local/bin` > rather than, say, my selected Perl's bin under the Perlbrew root. > > Everything else seems to be working: modules install to the right > places, and everything works, except that HTML::TreeBuilder (and, I > think, a pile of other modules) want to use the wrong location. ?(The > sitebin dir is right, vendorbin is empty, and the core bits are > right.) > > Hints? ?I know that module uses Module::Build, so I wonder if it is > something I (or Perlbrew) am missing? > > Thanks, > ? ?Daniel > -- > ? Made with 100 percent post-consumer electrons > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From daniel at rimspace.net Tue Jul 5 19:55:00 2011 From: daniel at rimspace.net (Daniel Pittman) Date: Tue, 5 Jul 2011 19:55:00 -0700 Subject: [Melbourne-pm] Perlbrew, CPAN modules, and scripts. In-Reply-To: <4E123AB8.4030206@perltraining.com.au> References: <4E123AB8.4030206@perltraining.com.au> Message-ID: On Mon, Jul 4, 2011 at 15:12, Jacinta Richardson wrote: > On 03/07/11 21:09, Daniel Pittman wrote: >> >> I wondered if anyone here used Perlbrew, and might be able to save me >> having to go digging into the bowels of a whole lot of the CPAN >> installation stack to work out why all my modules are absolutely >> convinced they should be installing any scripts to `/usr/local/bin` >> rather than, say, my selected Perl's bin under the Perlbrew root. >> >> Everything else seems to be working: modules install to the right >> places, and everything works, except that HTML::TreeBuilder (and, I >> think, a pile of other modules) want to use the wrong location. ?(The >> sitebin dir is right, vendorbin is empty, and the core bits are >> right.) >> >> Hints? ?I know that module uses Module::Build, so I wonder if it is >> something I (or Perlbrew) am missing? > > I can't say *why* you're experiencing what you are, but you might find that > using local::lib will set the environment variables you need so that things > consistently behave. ?(http://search.cpan.org/perldoc?local::lib) Ah! I finally found it, and the answer is that the problem lies with the fool driving. Turns out that Module::Build supports a configuration file which, way back when, I had configured to install things into /usr/local/bin. Removing that makes stuff work the way it should, which is awesome. Daniel -- ? Puppet Labs Developer ? http://puppetlabs.com ? Daniel Pittman ? Contact me via gtalk, email, or phone: +1 (503) 893-2285 ? Made with 100 percent post-consumer electrons From toby.corkindale at strategicdata.com.au Sun Jul 10 18:42:03 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Mon, 11 Jul 2011 11:42:03 +1000 Subject: [Melbourne-pm] July Perlmongers meeting - Wednesday 13 July Message-ID: <4E1A54EB.8000609@strategicdata.com.au> Hello Perl-mongers, The next Melbourne meeting will be held on Wednesday the 13th of July, aka this Wednesday. The meeting will be held at: Strategic Data Level 2, 51-55 Johnston street Fitzroy We will be seeing three talks: * Alfie John on MySQL::Replication. * Stephen Edmonds on FUSE and Perl. * Matt Sharpe on IPv6 in Perl. Some drinks and refreshments will be provided. I'll try and get the proceedings recorded as requested, if the speakers give their permission. Cheers Toby From scottp at dd.com.au Mon Jul 11 16:49:54 2011 From: scottp at dd.com.au (Scott Penrose) Date: Tue, 12 Jul 2011 09:49:54 +1000 Subject: [Melbourne-pm] OSDC Treasufer Message-ID: <38BEE0E4-A0EA-4E2D-A168-55149B301945@dd.com.au> Good morning Melbourne Perl Mongers. We are planning on moving our AGM to match the conference each year. However until that time we need to have an AGM now. We have volunteers for all positions except the treasurer. Unfortunately another officer can't also be treasurer. We were looking for someone to help out until the end of the year (at the conference). The role is very simple. All that is needed is a simple spreadsheet showing the transactions in and out, of which there are not many. Most of the conference expenses and income are large lumps (e.g. Paying for the venue). I would really appreciate a volunteer, and I am happy to help out with any work that is required. If you are interested, please contact me. Thanks Scott From toby.corkindale at strategicdata.com.au Tue Jul 12 18:00:54 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 13 Jul 2011 11:00:54 +1000 Subject: [Melbourne-pm] Reminder - Melbourne Perl Mongers is tonight! Message-ID: <4E1CEE46.3090907@strategicdata.com.au> From alfiejohn at gmail.com Wed Jul 13 15:58:41 2011 From: alfiejohn at gmail.com (Alfie John) Date: Thu, 14 Jul 2011 08:58:41 +1000 Subject: [Melbourne-pm] MySQL::Replication v0.0.0 and slides Message-ID: Hi guys, I wasn't going to push MySQL::Replication to CPAN until the documentation was done (some of it is there but is rough, but mostly missing). But after speaking to Matt (R) last night, he said he was happy to see the even without the documentation. After emailing him, I thought others might be interested so I tried to upload a "pre-release" on CPAN but for some reason pause.perl.org seems down for me... so you can temporarily get the code at: http://h4c.kr/mysql-replication-0.0.0.tar.gz But I'll be moving it to GitHub hopefully this weekend. You can find my talk at: http://www.slideshare.net/alfiejohn/mysqlreplication-perl-mongers-201107 I know it looks a bit big at 255 slides... but I tried to go for that Lessig presentation approach so it should take under 5 minutes to go through it. Alfie -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Thu Jul 14 01:26:50 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 14 Jul 2011 18:26:50 +1000 Subject: [Melbourne-pm] Perl and FUSE - the video Message-ID: <4E1EA84A.9020107@strategicdata.com.au> The first video from last night's meeting is available now: http://vimeo.com/26413660 The second one will take longer; Vimeo has a daily upload limit.. Toby From scottp at dd.com.au Thu Jul 14 20:04:24 2011 From: scottp at dd.com.au (Scott Penrose) Date: Fri, 15 Jul 2011 13:04:24 +1000 Subject: [Melbourne-pm] Skill matching Message-ID: <88D2DBAA-70A9-40F2-AEB6-BEACFFC0BC59@dd.com.au> Howdy Anyone know of any databases out on the net for matching technical skills. E.g. if I type in ".net" I would also get "dotnet" ? Scooter From toby.corkindale at strategicdata.com.au Thu Jul 14 23:59:31 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Fri, 15 Jul 2011 16:59:31 +1000 Subject: [Melbourne-pm] Perl and FUSE - the video In-Reply-To: <4E1EA84A.9020107@strategicdata.com.au> References: <4E1EA84A.9020107@strategicdata.com.au> Message-ID: <4E1FE553.1090300@strategicdata.com.au> On 14/07/11 18:26, Toby Corkindale wrote: > The second one will take longer; Vimeo has a daily upload limit.. I misunderstood.. It's a *weekly* upload limit! After more experimentation, I really didn't need to encode the first video at the bitrate I used.. Alfie's talk is a lot longer and I can get it under 500 MB for half an hour and it still looks fine. However I probably can't upload it until next Thursday, because I blew my limit yesterday. Bother :/ Toby From toby.corkindale at strategicdata.com.au Sun Jul 17 22:16:39 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Mon, 18 Jul 2011 15:16:39 +1000 Subject: [Melbourne-pm] Alfie's MySQL::Replication talk - videos Message-ID: <4E23C1B7.2070205@strategicdata.com.au> I couldn't be bothered waiting for Vimeo's upload limit to reset. Sorry Vimeo, you lose out to old Youtube.. I had to split the video into two parts to fit in Youtube's format. Part 1: The main talk http://www.youtube.com/watch?v=lk-2XE00fqY Part 2: Questions and Answers http://www.youtube.com/watch?v=oDcsM8n72OU Cheers, Toby From alfiejohn at gmail.com Mon Jul 18 05:01:39 2011 From: alfiejohn at gmail.com (Alfie John) Date: Mon, 18 Jul 2011 22:01:39 +1000 Subject: [Melbourne-pm] Alfie's MySQL::Replication talk - videos In-Reply-To: <4E23C1B7.2070205@strategicdata.com.au> References: <4E23C1B7.2070205@strategicdata.com.au> Message-ID: Thanks for that Toby. Maybe YouTubing the meetings could be a regular thing? Alfie On Mon, Jul 18, 2011 at 3:16 PM, Toby Corkindale < toby.corkindale at strategicdata.com.au> wrote: > I couldn't be bothered waiting for Vimeo's upload limit to reset. Sorry > Vimeo, you lose out to old Youtube.. > > I had to split the video into two parts to fit in Youtube's format. > Part 1: The main talk > http://www.youtube.com/watch?**v=lk-2XE00fqY > Part 2: Questions and Answers > http://www.youtube.com/watch?**v=oDcsM8n72OU > > Cheers, > Toby > ______________________________**_________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/**listinfo/melbourne-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Mon Jul 18 17:26:18 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 19 Jul 2011 10:26:18 +1000 Subject: [Melbourne-pm] Alfie's MySQL::Replication talk - videos In-Reply-To: References: <4E23C1B7.2070205@strategicdata.com.au> Message-ID: <4E24CF2A.5040306@strategicdata.com.au> On 18/07/11 22:01, Alfie John wrote: > Thanks for that Toby. Maybe YouTubing the meetings could be a regular thing? if people are happy for that to happen, it can be arranged. My old DV cam doesn't do a very good job of filming screens though, as you can see. Perhaps we should install some screen-capture software? (Or people could upload to slideshare?) The DV cam method works well if you're doing the more traditional route of the person talking in front of the screen though. > On Mon, Jul 18, 2011 at 3:16 PM, Toby Corkindale > > wrote: > > I couldn't be bothered waiting for Vimeo's upload limit to reset. > Sorry Vimeo, you lose out to old Youtube.. > > I had to split the video into two parts to fit in Youtube's format. > Part 1: The main talk > http://www.youtube.com/watch?__v=lk-2XE00fqY > > Part 2: Questions and Answers > http://www.youtube.com/watch?__v=oDcsM8n72OU > > > Cheers, > Toby > _________________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/__listinfo/melbourne-pm > > > -- .signature From jarich at perltraining.com.au Thu Jul 21 14:49:53 2011 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 21 Jul 2011 14:49:53 -0700 Subject: [Melbourne-pm] OSDC Treasurer In-Reply-To: <38BEE0E4-A0EA-4E2D-A168-55149B301945@dd.com.au> References: <38BEE0E4-A0EA-4E2D-A168-55149B301945@dd.com.au> Message-ID: <4E289F01.4000307@perltraining.com.au> > We are planning on moving our AGM to match the conference each year. > However until that time we need to have an AGM now. > > We have volunteers for all positions except the treasurer. Unfortunately another officer can't also be treasurer. > > We were looking for someone to help out until the end of the year (at the conference). > That seems a little odd. If you're going to have the AGM now, surely all the positions would be up for nomination etc? Certainly it's good to elicit volunteers, but that's often part of the nomination process. J From scottp at dd.com.au Thu Jul 21 19:47:48 2011 From: scottp at dd.com.au (Scott Penrose) Date: Fri, 22 Jul 2011 12:47:48 +1000 Subject: [Melbourne-pm] OSDC Treasurer In-Reply-To: <4E289F01.4000307@perltraining.com.au> References: <38BEE0E4-A0EA-4E2D-A168-55149B301945@dd.com.au> <4E289F01.4000307@perltraining.com.au> Message-ID: <9E73C616-23E6-4D85-83CB-6A78859DB60C@dd.com.au> On 22/07/2011, at 7:49 AM, Jacinta Richardson wrote: > That seems a little odd. If you're going to have the AGM now, surely all the positions would be up for nomination etc? Certainly it's good to elicit volunteers, but that's often part of the nomination process. Yes that is what I mean, I mean I had no one nominate for treasurer :-) Sorry I didn't make it very clear. Done now, I have had Andrew Pam volunteer. Obviously if someone else does it goes to vote, but mostly I am concerned about getting minimum numbers rather than worrying about getting extras. On that note, we have to have a minimum of I think 7 people on the night. Currently there is some dispute about who is members and not, since we didn't have forms, and some people say we should...etc. But I will be happy and imagine we would get no disputes if we had it during either Melbourne PM or PHP user group nights. Therefore would it be ok if we took 10 minutes at the start of September Perl Mongers? Basically the process is: - Present financials - Approve any previous minutes - If a position is short nominations open that to the floor (I think we will have all these covered) - If more than one person nominated for a position then vote. - Motion to change AGM & Financial year to align with conference. So it should not take long. Thanks Scott P.S. Jacinta, we do remote meeting, mostly email, we would love to have you involved again some time, either this year or in the future. The Executive is pretty low stress compared to conference. From ts at meme.com.au Sat Jul 23 01:29:39 2011 From: ts at meme.com.au (Tony Smith) Date: Sat, 23 Jul 2011 18:29:39 +1000 Subject: [Melbourne-pm] Fwd: [Golly-test] golly with Perl 5.14? References: Message-ID: This is way out of my depth but I have a vested interest in helping find the answer. Begin forwarded message: > From: Tom Rokicki > Date: 23 July 2011 10:53:42 AM AEST > To: golly test list , eric at brouhaha.com > Subject: Re: [Golly-test] golly with Perl 5.14? > Reply-To: golly test list > > This looks like a problem with Perl 5.14. > > The web page at > > http://perldoc.perl.org/perlembed.html > > which is the main embedding documentation for Perl 5.14 has this > *precise* code. > > We could take out that line but that eliminates the ability to dynamically > load Perl extensions (is my understanding), which we do not want to do. > > We need to locate a Perl expert to comment on this . . . > > -tom > > On Fri, Jul 22, 2011 at 12:39 PM, Eric Smith wrote: >> Has anyone successfully compiled golly with Perl 5.14? It works fine in >> Fedora with Perl 5.12, but Fedora 16 is moving to Perl 5.14, and that >> breaks the build, due to macros expanding to include PL_thr_key, which >> is no longer defined. >> >> The build log can be seen at: >> >> http://koji.fedoraproject.org/koji/getfile?taskID=3222183&name=build.log >> >> The Fedora bug is at: >> https://bugzilla.redhat.com/show_bug.cgi?id=717675 >> >> I know only enough Perl to be dangerous, and nothing about the innards, >> so I don't think I can figure out how to deal with this on my own. >> >> Thanks! >> Eric >> > _______________________________________________ > Golly-test mailing list > Golly-test at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/golly-test Tony Smith Complex Systems Analyst Melbourne, Australia http://www.ynotds.com/ Giving thanks to the space, time, energy, matter and other lives that have allowed me to tell my lies on this old and damp ball of rock. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tconnors at astro.swin.edu.au Sat Jul 23 22:18:19 2011 From: tconnors at astro.swin.edu.au (Tim Connors) Date: Sun, 24 Jul 2011 15:18:19 +1000 (EST) Subject: [Melbourne-pm] Perl and FUSE - the video In-Reply-To: <4E1EA84A.9020107@strategicdata.com.au> References: <4E1EA84A.9020107@strategicdata.com.au> Message-ID: On Thu, 14 Jul 2011, Toby Corkindale wrote: > The first video from last night's meeting is available now: > http://vimeo.com/26413660 > > The second one will take longer; Vimeo has a daily upload limit.. So, can put up the source? :) -- Tim Connors From tjc at wintrmute.net Sat Jul 23 22:56:20 2011 From: tjc at wintrmute.net (Toby Wintermute) Date: Sun, 24 Jul 2011 15:56:20 +1000 Subject: [Melbourne-pm] Perl and FUSE - the video In-Reply-To: References: <4E1EA84A.9020107@strategicdata.com.au> Message-ID: On 24 July 2011 15:18, Tim Connors wrote: > On Thu, 14 Jul 2011, Toby Corkindale wrote: > >> The first video from last night's meeting is available now: >> http://vimeo.com/26413660 >> >> The second one will take longer; Vimeo has a daily upload limit.. > > So, can put up the source? :) Ah, I just uploaded it to Youtube instead, and then re-uploaded this video there too, for consistency. Toby -- Turning and turning in the widening gyre The falcon cannot hear the falconer Things fall apart; the center cannot hold Mere anarchy is loosed upon the world From tconnors at astro.swin.edu.au Sun Jul 24 19:33:33 2011 From: tconnors at astro.swin.edu.au (Tim Connors) Date: Mon, 25 Jul 2011 12:33:33 +1000 (EST) Subject: [Melbourne-pm] Perl and FUSE - the video In-Reply-To: References: <4E1EA84A.9020107@strategicdata.com.au> Message-ID: On Sun, 24 Jul 2011, Toby Wintermute wrote: > On 24 July 2011 15:18, Tim Connors wrote: >> On Thu, 14 Jul 2011, Toby Corkindale wrote: >> >>> The first video from last night's meeting is available now: >>> http://vimeo.com/26413660 >>> >>> The second one will take longer; Vimeo has a daily upload limit.. >> >> So, can put up the source? :) > > Ah, I just uploaded it to Youtube instead, and then re-uploaded this > video there too, for consistency. Sorry, I meant the fuse converter sourcecode. -- Tim Connors From melbourne-pm at popcorn.cx Mon Jul 25 16:32:55 2011 From: melbourne-pm at popcorn.cx (Stephen Edmonds) Date: Tue, 26 Jul 2011 09:32:55 +1000 Subject: [Melbourne-pm] Perl and FUSE - the video In-Reply-To: References: <4E1EA84A.9020107@strategicdata.com.au> Message-ID: Ahh, that would be a question for me... I do plan to release the fuse wrapper, however I want to clean it up at least a bit before I release it. Finding time for that is proving difficult, but it will happen. Thanks, Stephen On 25 July 2011 12:33, Tim Connors wrote: > On Sun, 24 Jul 2011, Toby Wintermute wrote: > >> On 24 July 2011 15:18, Tim Connors wrote: >>> >>> On Thu, 14 Jul 2011, Toby Corkindale wrote: >>> >>>> The first video from last night's meeting is available now: >>>> http://vimeo.com/26413660 >>>> >>>> The second one will take longer; Vimeo has a daily upload limit.. >>> >>> So, can put up the source? :) >> >> Ah, I just uploaded it to Youtube instead, and then re-uploaded this >> video there too, for consistency. > > Sorry, I meant the fuse converter sourcecode. > > -- > Tim Connors > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > From mathew.blair.robertson at gmail.com Mon Jul 25 23:07:55 2011 From: mathew.blair.robertson at gmail.com (Mathew Robertson) Date: Tue, 26 Jul 2011 16:07:55 +1000 Subject: [Melbourne-pm] quirky behaviour of 'local'... Message-ID: Hi all, As a result of some hacking on some code, I identified some quirky behaviour with regards to 'local'... I have whittled the problem down to it simplest form - see below. Basically speaking, I would have expected the inner-array-variable to become localised to block scope. Is there something that I am missing here? regards, Mathew Robertson #!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Data::Dumper; $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; our %HANDLERS; # This block, as expected, de-localises %HANDLERS at block scope. $HANDLERS{a} = sub {}; $HANDLERS{b} = sub {}; print Dumper(\%HANDLERS); { local %HANDLERS = %HANDLERS; $HANDLERS{c} = 't'; print Dumper(\%HANDLERS); } print Dumper(\%HANDLERS); print "-" x 50 . $/; # Unexpectedly, no de-localising of %HANDLERS at block scope. # I would have expected $HANDLERS{c} to be localised. $HANDLERS{c} = ['t']; print Dumper(\%HANDLERS); { # local %HANDLERS = %HANDLERS; local $HANDLERS{c} = $HANDLERS{c}; # local @{$HANDLERS{c}} = @{$HANDLERS{c}}; push @{$HANDLERS{c}}, 'u'; print Dumper(\%HANDLERS); } print Dumper(\%HANDLERS); -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Mon Jul 25 23:27:23 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 26 Jul 2011 16:27:23 +1000 Subject: [Melbourne-pm] quirky behaviour of 'local'... In-Reply-To: References: Message-ID: <4E2E5E4B.20706@strategicdata.com.au> On 26/07/11 16:07, Mathew Robertson wrote: > Hi all, > > As a result of some hacking on some code, I identified some quirky > behaviour with regards to 'local'... I have whittled the problem down > to it simplest form - see below. > > Basically speaking, I would have expected the inner-array-variable to > become localised to block scope. Is there something that I am missing here? What is happening here is a quirk of how Perl does multi-level data structures.. $HANDLERS{c} contains a reference to an array. When you localise $HANDLERS{c} you are localising the value of that reference.. not the actual data in the referenced thing. You can achieve the result you're looking for with this mess: use Storable qw(dclone); { # local $HANDLERS{c} = $HANDLERS{c}; local $HANDLERS{c} = dclone($HANDLERS{c}); push @{$HANDLERS{c}}, 'u'; print Dumper(\%HANDLERS); } > #!/usr/bin/perl > use strict; > use warnings FATAL => 'all'; > use Data::Dumper; $Data::Dumper::Indent = 1; $Data::Dumper::Sortkeys = 1; > our %HANDLERS; > > # This block, as expected, de-localises %HANDLERS at block scope. > > $HANDLERS{a} = sub {}; > $HANDLERS{b} = sub {}; > print Dumper(\%HANDLERS); > { > local %HANDLERS = %HANDLERS; > $HANDLERS{c} = 't'; > print Dumper(\%HANDLERS); > } > print Dumper(\%HANDLERS); > > print "-" x 50 . $/; > > # Unexpectedly, no de-localising of %HANDLERS at block scope. > # I would have expected $HANDLERS{c} to be localised. > > $HANDLERS{c} = ['t']; > > print Dumper(\%HANDLERS); > { > # local %HANDLERS = %HANDLERS; > local $HANDLERS{c} = $HANDLERS{c}; > # local @{$HANDLERS{c}} = @{$HANDLERS{c}}; > push @{$HANDLERS{c}}, 'u'; > print Dumper(\%HANDLERS); > } > print Dumper(\%HANDLERS); > > > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm -- .signature From mathew.blair.robertson at gmail.com Tue Jul 26 00:00:54 2011 From: mathew.blair.robertson at gmail.com (Mathew Robertson) Date: Tue, 26 Jul 2011 17:00:54 +1000 Subject: [Melbourne-pm] quirky behaviour of 'local'... In-Reply-To: <4E2E5E4B.20706@strategicdata.com.au> References: <4E2E5E4B.20706@strategicdata.com.au> Message-ID: On 26 July 2011 16:27, Toby Corkindale wrote: > On 26/07/11 16:07, Mathew Robertson wrote: > >> Hi all, >> >> As a result of some hacking on some code, I identified some quirky >> behaviour with regards to 'local'... I have whittled the problem down >> to it simplest form - see below. >> >> Basically speaking, I would have expected the inner-array-variable to >> become localised to block scope. Is there something that I am missing >> here? >> > > What is happening here is a quirk of how Perl does multi-level data > structures.. > > $HANDLERS{c} contains a reference to an array. > When you localise $HANDLERS{c} you are localising the value of that > reference.. not the actual data in the referenced thing. > Indeed that looks to be the case... which is why in the posted example, I also attempted to the use the localised dereferenced array (commented out), but to no avail as I am probably localising the array ref. > You can achieve the result you're looking for with this mess: > > use Storable qw(dclone); > { > # local $HANDLERS{c} = $HANDLERS{c}; > local $HANDLERS{c} = dclone($HANDLERS{c}); > > push @{$HANDLERS{c}}, 'u'; > print Dumper(\%HANDLERS); > } > Not directly related the original question, but somewhat relevant I guess.... How does Storable::dclone compare to Clone::clone ? regards, Mathew -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Tue Jul 26 00:20:34 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 26 Jul 2011 17:20:34 +1000 Subject: [Melbourne-pm] Fwd: [Golly-test] golly with Perl 5.14? In-Reply-To: References: Message-ID: <4E2E6AC2.6090705@strategicdata.com.au> On 23/07/11 18:29, Tony Smith wrote: > This is way out of my depth but I have a vested interest in helping find > the answer. Hi Tony, A simple, quick-fix is to patch wxperl.cpp to add one line, like so: --- a/wxperl.cpp +++ b/wxperl.cpp @@ -77,6 +77,7 @@ #undef gid_t #include +#define PERL_GLOBAL_STRUCT #include #include This seems to do the job for me; I don't know if it's the correct way to solve it or not though.. I hope this helps, -Toby >> *From: *Tom Rokicki > >> *Date: *23 July 2011 10:53:42 AM AEST >> *To: *golly test list > >, eric at brouhaha.com >> >> *Subject: **Re: [Golly-test] golly with Perl 5.14?* >> *Reply-To: *golly test list > > >> >> This looks like a problem with Perl 5.14. >> >> The web page at >> >> http://perldoc.perl.org/perlembed.html >> >> which is the main embedding documentation for Perl 5.14 has this >> *precise* code. >> >> We could take out that line but that eliminates the ability to dynamically >> load Perl extensions (is my understanding), which we do not want to do. >> >> We need to locate a Perl expert to comment on this . . . >> >> -tom >> >> On Fri, Jul 22, 2011 at 12:39 PM, Eric Smith > > wrote: >>> Has anyone successfully compiled golly with Perl 5.14? It works fine in >>> Fedora with Perl 5.12, but Fedora 16 is moving to Perl 5.14, and that >>> breaks the build, due to macros expanding to include PL_thr_key, which >>> is no longer defined. >>> >>> The build log can be seen at: >>> >>> http://koji.fedoraproject.org/koji/getfile?taskID=3222183&name=build.log >>> >>> >>> The Fedora bug is at: >>> https://bugzilla.redhat.com/show_bug.cgi?id=717675 >>> >>> I know only enough Perl to be dangerous, and nothing about the innards, >>> so I don't think I can figure out how to deal with this on my own. >>> >>> Thanks! >>> Eric From thogard at abnormal.com Wed Jul 27 05:30:02 2011 From: thogard at abnormal.com (Tim Hogard) Date: Wed, 27 Jul 2011 12:30:02 +0000 (UTC) Subject: [Melbourne-pm] Error checks without packages Message-ID: <201107271230.p6RCU2v3038605@v.abnormal.com> I have this bit of code and the disk partition /usr/local/tmp is full: #!/usr/bin/perl $SIG{PIPE} = sub { die "\nSigPIPE!\n" }; open(OUT,">/usr/local/tmp/x$$") or print "cant open $? $!\n"; print "err $?\n"; print OUT "foo $$ \n" or print "cant print out $? $!\n"; print "err $?\n"; close OUT or print "cant close $? $!\n"; print "err $?\n"; $ ./close_test err 0 err 0 cant close 0 No space left on device err 0 If I add select(OUT); $|=1; # set to unbuffered output select(STDOUT); Even before the open I get: $ ./close_test err 0 cant print out 0 No space left on device err 0 cant close 0 No space left on device err 0 That helps, but it would be best to know as soon as I open the file so I can put the entire output in a different file on a different partition. The unix "open" system call reports "no space" only when the directory entry can't be extended and has nothing to do with how much space is left on the disk. I could rewind but I'm opening for append since there is small chance two processes could write the same file at the same time. I can't flush without loading the IO package (which I don't want to). Does anyone have any other ideas? -tim http://web.abnormal.com From brong at fastmail.fm Wed Jul 27 05:46:44 2011 From: brong at fastmail.fm (Bron Gondwana) Date: Wed, 27 Jul 2011 14:46:44 +0200 Subject: [Melbourne-pm] Error checks without packages In-Reply-To: <201107271230.p6RCU2v3038605@v.abnormal.com> References: <201107271230.p6RCU2v3038605@v.abnormal.com> Message-ID: On Wed, 27 Jul 2011 14:30:02 +0200, Tim Hogard wrote: > I have this bit of code and the disk partition /usr/local/tmp is full: [...] > I can't flush without loading the IO package (which I don't want > to). Why not? > Does anyone have any other ideas? Erm... monitor your disks and take evasive action before they get full? Bron. -- Using Opera's revolutionary email client: http://www.opera.com/mail/ From david.warring at gmail.com Wed Jul 27 15:44:41 2011 From: david.warring at gmail.com (David Warring) Date: Thu, 28 Jul 2011 08:44:41 +1000 Subject: [Melbourne-pm] quirky behaviour of 'local'... In-Reply-To: References: <4E2E5E4B.20706@strategicdata.com.au> Message-ID: > > > Not directly related the original question, but somewhat relevant I > guess.... How does Storable::dclone compare to Clone::clone ? > > regards, > Mathew > I'll just mention a gotcha for anyone working under Taint mode. Although module mentions it, Clone preserves tainting of nested data, Storable::dclone doesn't. See attached test. - David -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: clone-tainting.t Type: application/x-troff Size: 352 bytes Desc: not available URL: From T.Hunt at bom.gov.au Wed Jul 27 16:20:29 2011 From: T.Hunt at bom.gov.au (Timothy Hunt) Date: Thu, 28 Jul 2011 09:20:29 +1000 Subject: [Melbourne-pm] "Current" Perl [uncl] Message-ID: <7548A47B0E2E8643BE38DBBD8FD9CA1AD549DDB11D@BOM-VMBX-HO.bom.gov.au> I just got a mail from Red Hat which included: "As part of your Red Hat subscription, you are invited to share your ideas and use cases for new features that may be included in Red Hat Enterprise Linux 7. Here's your opportunity to tell Red Hat what you want and how you would use it." I have to use the Perl that's built-in to RHEL, so assuming that (by the time RHEL7 comes out) they are up to 5.12, what features should I nominate for back-porting? RHEL5 -> Perl 5.8.8 RHEL6 -> Perl 5.10.1 Cheers, Tim. -- Tim Hunt ph +61 3 9669 4094 From alfiejohn at gmail.com Wed Jul 27 16:24:46 2011 From: alfiejohn at gmail.com (Alfie John) Date: Thu, 28 Jul 2011 09:24:46 +1000 Subject: [Melbourne-pm] Error checks without packages In-Reply-To: <201107271230.p6RCU2v3038605@v.abnormal.com> References: <201107271230.p6RCU2v3038605@v.abnormal.com> Message-ID: <20110727232446.GB25703@linode1.alfiejohn.com> On Wed, Jul 27, 2011 at 12:30:02PM +0000, Tim Hogard wrote: > That helps, but it would be best to know as soon as I open the file > so I can put the entire output in a different file on a different > partition. The unix "open" system call reports "no space" only > when the directory entry can't be extended and has nothing to do > with how much space is left on the disk. > > I could rewind but I'm opening for append since there is small > chance two processes could write the same file at the same time. > > I can't flush without loading the IO package (which I don't want > to). > > Does anyone have any other ideas? Try syswrite(). Alfie > > -tim > http://web.abnormal.com > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From toby.corkindale at strategicdata.com.au Wed Jul 27 17:48:33 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 28 Jul 2011 10:48:33 +1000 Subject: [Melbourne-pm] "Current" Perl [uncl] In-Reply-To: <7548A47B0E2E8643BE38DBBD8FD9CA1AD549DDB11D@BOM-VMBX-HO.bom.gov.au> References: <7548A47B0E2E8643BE38DBBD8FD9CA1AD549DDB11D@BOM-VMBX-HO.bom.gov.au> Message-ID: <4E30B1E1.8000302@strategicdata.com.au> On 28/07/11 09:20, Timothy Hunt wrote: > I just got a mail from Red Hat which included: > > "As part of your Red Hat subscription, you are invited to share your ideas and use cases for new features that may be included in Red Hat Enterprise Linux 7. Here's your opportunity to tell Red Hat what you want and how you would use it." > > I have to use the Perl that's built-in to RHEL, so assuming that (by the time RHEL7 comes out) they are up to 5.12, what features should I nominate for back-porting? > > RHEL5 -> Perl 5.8.8 > RHEL6 -> Perl 5.10.1 It would be nice if they could skip straight to 5.14.x, since it'll have definitely been stable for some time by then, and it includes a lot of nice ipv6 and unicode updates. From sam at nipl.net Wed Jul 27 19:14:47 2011 From: sam at nipl.net (Sam Watkins) Date: Thu, 28 Jul 2011 12:14:47 +1000 Subject: [Melbourne-pm] Error checks without packages In-Reply-To: <201107271230.p6RCU2v3038605@v.abnormal.com> References: <201107271230.p6RCU2v3038605@v.abnormal.com> Message-ID: <20110728021447.GE782@opal.ai.ki> Tim Hogard wrote: > cant print out 0 No space left on device I think stdio will lose data if there is an IO error on write, which is not good. Or does it stay in the (opaque) buffer? If so, perhaps freopen could save the data. I think perl has access to freopen via open() or something. It 'should' be possible to copy off the existing file somewhere else, then retry writing the stdio buffer. Two processes writing at the same time will stuff up that plan. I suggest use a single 'logging' process which manages this complexity, if you really want to do it, and get your other processes to log through it. If you really want reliable write, I suggest writing to several remote systems on the network which will both save the data. Bonus: ack is faster than sync, and can be handled asynchronously! Write / find a perl module to 'portably' check for low disk space condition? It might be nice if 'disk full' caused a process to stop and wait for help rather than to die. Sam From jarich at perltraining.com.au Thu Jul 28 15:27:39 2011 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 28 Jul 2011 15:27:39 -0700 Subject: [Melbourne-pm] Error checks without packages In-Reply-To: <201107271230.p6RCU2v3038605@v.abnormal.com> References: <201107271230.p6RCU2v3038605@v.abnormal.com> Message-ID: <4E31E25B.8070900@perltraining.com.au> On 27/07/11 05:30, Tim Hogard wrote: > I have this bit of code and the disk partition /usr/local/tmp is full: > #!/usr/bin/perl > > $SIG{PIPE} = sub { die "\nSigPIPE!\n" }; > > open(OUT,">/usr/local/tmp/x$$") or print "cant open $? $!\n"; > print "err $?\n"; > > print OUT "foo $$ \n" or print "cant print out $? $!\n"; > > print "err $?\n"; > close OUT or print "cant close $? $!\n"; > print "err $?\n"; > $? doesn't get set during file operations. Are you targetting a version of Perl that is more than 11 years old? If not, you might prefer to write this like: Perl 5.6+ #!/usr/bin/perl use strict; use warnings; use IO::Handle; use autodie; # (Perl 5.8.0+) open my $fh, ">", "/usr/local/tmp/x$$"; # Check your errors if you're not using autodie $fh->autoflush(); print {$fh} "...." or die "Failed to print: $!"; close $fh; # Check error if you're not using autodie Or Perl 5.14.1+ #!/usr/bin/perl use v5.14; use warnings; use autodie; open my $fh, ">", "/usr/local/tmp/x$$"; # Check your errors if you're not using autodie $fh->autoflush(); print {$fh} "...." or die "Failed to print: $!"; close $fh; # Check error if you're not using autodie > That helps, but it would be best to know as soon as I open the file > so I can put the entire output in a different file on a different > partition. The unix "open" system call reports "no space" only > when the directory entry can't be extended and has nothing to do > with how much space is left on the disk. > The problem is that Perl is not your operating system, and Perl cannot tell in advance how much data you're going to try to write to disk. If any. As such, it cannot catch this when you open the file. What if there's 1gb of space available. But you want to only write 100k. That should be okay, right? But what if you want to write 3gb? Sure, if the disk is completely full you want to know in advance, but if that's the case you have bigger problems.... I imagine you'd have to ask your operating system. Perl's open() is not the right tool here. > I could rewind but I'm opening for append since there is small > chance two processes could write the same file at the same time. > The better solution is probably locking. Unless it doesn't matter if multiple processes mix their data. > I can't flush without loading the IO package (which I don't want > to). > The IO::Handle package is harmless. I'm really not sure why you'd be trying to avoid it. > Does anyone have any other ideas? Look into asking the operating system how full that partition is, rather than trying to repurpose tools that aren't made for it. Also, look into modernising your Perl syntax to reduce future maintenance pain. J From toby.corkindale at strategicdata.com.au Thu Jul 28 18:57:20 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Fri, 29 Jul 2011 11:57:20 +1000 Subject: [Melbourne-pm] Talks for next meeting - 10th August Message-ID: <4E321380.1010302@strategicdata.com.au> Hello everyone, I'm wondering if anyone has some talks they'd like to give at the upcoming August Perl Mongers meeting? Cheers, Toby From mathew.blair.robertson at gmail.com Sun Jul 31 17:06:19 2011 From: mathew.blair.robertson at gmail.com (Mathew Robertson) Date: Mon, 1 Aug 2011 10:06:19 +1000 Subject: [Melbourne-pm] Error checks without packages In-Reply-To: <4E31E25B.8070900@perltraining.com.au> References: <201107271230.p6RCU2v3038605@v.abnormal.com> <4E31E25B.8070900@perltraining.com.au> Message-ID: On 29 July 2011 08:27, Jacinta Richardson wrote: > On 27/07/11 05:30, Tim Hogard wrote: > >> I have this bit of code and the disk partition /usr/local/tmp is full: >> #!/usr/bin/perl >> >> $SIG{PIPE} = sub { die "\nSigPIPE!\n" }; >> >> open(OUT,">/usr/local/tmp/x$$"**) or print "cant open $? $!\n"; >> print "err $?\n"; >> >> print OUT "foo $$ \n" or print "cant print out $? $!\n"; >> >> print "err $?\n"; >> close OUT or print "cant close $? $!\n"; >> print "err $?\n"; >> >> $? doesn't get set during file operations. > > Are you targetting a version of Perl that is more than 11 years old? If > not, you might prefer to write this like: > > Perl 5.6+ > > #!/usr/bin/perl > use strict; > use warnings; > use IO::Handle; > use autodie; # (Perl 5.8.0+) > > open my $fh, ">", "/usr/local/tmp/x$$"; # Check your errors if > you're not using autodie > > $fh->autoflush(); > > print {$fh} "...." or die "Failed to print: $!"; > > close $fh; # Check error if you're not using autodie > > > > Or Perl 5.14.1+ > > #!/usr/bin/perl > use v5.14; > use warnings; > use autodie; > > open my $fh, ">", "/usr/local/tmp/x$$"; # Check your errors if > you're not using autodie > > $fh->autoflush(); > print {$fh} "...." or die "Failed to print: $!"; > > close $fh; # Check error if you're not using autodie > > > That helps, but it would be best to know as soon as I open the file >> so I can put the entire output in a different file on a different >> partition. The unix "open" system call reports "no space" only >> when the directory entry can't be extended and has nothing to do >> with how much space is left on the disk. >> >> > The problem is that Perl is not your operating system, and Perl cannot tell > in advance how much data you're going to try to write to disk. If any. As > such, it cannot catch this when you open the file. What if there's 1gb of > space available. But you want to only write 100k. That should be okay, > right? But what if you want to write 3gb? Sure, if the disk is completely > full you want to know in advance, but if that's the case you have bigger > problems.... I imagine you'd have to ask your operating system. Perl's > open() is not the right tool here. > And then there is the sparse-file capability. > > I could rewind but I'm opening for append since there is small >> chance two processes could write the same file at the same time. >> >> > The better solution is probably locking. Unless it doesn't matter if > multiple processes mix their data. > > I can't flush without loading the IO package (which I don't want >> to). >> >> The IO::Handle package is harmless. I'm really not sure why you'd be > trying to avoid it. > > Does anyone have any other ideas? >> > > Look into asking the operating system how full that partition is, rather > than trying to repurpose tools that aren't made for it. Also, look into > modernising your Perl syntax to reduce future maintenance pain. > > > J > Isn't Perl's IO (from v5.7) almost completely reliant on "PerlIO"... aka, which means that open() is using PerlIO anyway? So including any IO package has minimal overhead (making the choice of "should I load an IO package?" largely irrelevant)? regards, Mathew Robertson -------------- next part -------------- An HTML attachment was scrubbed... URL: