From alfiejohn at gmail.com Sun Dec 2 21:15:24 2007 From: alfiejohn at gmail.com (Alfie John) Date: Mon, 3 Dec 2007 16:15:24 +1100 Subject: [Melbourne-pm] Next meeting - Wednesday 12th @REA Message-ID: Hi (), I invite you all to the next Melbourne Perl Mongers: When: Wednesday 12th, December 2007, 6:30pm Where: REA ( 678 Victoria Street, Richmond - next to Victoria Gardens SC ) Who: All are welcome What: - Kirrily will be giving a talk on packaging Perl applications - Drinks at the Terminus Hotel __END__ From rick at measham.id.au Fri Dec 7 15:28:56 2007 From: rick at measham.id.au (Rick Measham) Date: Sat, 08 Dec 2007 10:28:56 +1100 Subject: [Melbourne-pm] Recruitment Hall of Shame: Exhibit #000021 Message-ID: <4759D738.1060204@measham.id.au> http://it.seek.com.au/users/apply/index.ascx?Sequence=67&PageNumber=1&JobID=11293648&cid=jobmail No idea how universal seek's URLs are, so here's the advert's text: ======================================================================= Perl Technologies Systems Administrator - South Hampton Location. This is a large online advertising company looking for an IT Perl Technologies Systems Administrator/Operator. You need; * 1 year minimum experience * Display good understanding of Perl Technologies Systems. * Have good communication skill * Have strong computer skills if you fit the above criteria then i would recommend you apply for this great opportunity this is a permanent position offering an excellent salary package. Apply now by clicking the link below. ======================================================================= OK, so what do we have here? Something called a Perl Technologies Systems Administrator. I can't find any systems called 'Perl Technologies' that would require an administrator, so I guess I can't display a good understanding. (There is a US company, but they don't make 'systems') So I guess that counts me out of the 1 year experience. But what's with the last dot point? Strong computer skills? Who writes this crap? The only comment I will make on the lack of capital letters is to add to the exhibit the pr?cis that came in seek's email: > Are u IT Qualified? Do u have an understanding in Perl Technologies? Are you looking for employment with a large repretable company? f so then read on If YOU are the EMPLOYER who hired these people to find someone: GO SOMEWHERE ELSE. Cheers! Rick Measham -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3241 bytes Desc: S/MIME Cryptographic Signature Url : http://mail.pm.org/pipermail/melbourne-pm/attachments/20071208/c2ee57c1/attachment.bin From skud at infotrope.net Fri Dec 7 17:08:08 2007 From: skud at infotrope.net (Kirrily Robert) Date: Sat, 8 Dec 2007 12:08:08 +1100 Subject: [Melbourne-pm] Recruitment Hall of Shame: Exhibit #000021 In-Reply-To: <4759D738.1060204@measham.id.au> References: <4759D738.1060204@measham.id.au> Message-ID: On Dec 8, 2007 10:28 AM, Rick Measham wrote: > http://it.seek.com.au/users/apply/index.ascx?Sequence=67&PageNumber=1&JobID=11293648&cid=jobmail > > > No idea how universal seek's URLs are, so here's the advert's text: > > ======================================================================= > Perl Technologies Systems Administrator - South Hampton Location. > > This is a large online advertising company looking for an IT Perl > Technologies Systems Administrator/Operator. > > You need; > * 1 year minimum experience > * Display good understanding of Perl Technologies Systems. > * Have good communication skill > * Have strong computer skills ... and ... > > Are u IT Qualified? Do u have an understanding in Perl Technologies? Are you looking for employment with a large repretable company? f so then read on > > If YOU are the EMPLOYER who hired these people to find someone: GO > SOMEWHERE ELSE. I bet this is the same mob that I wrote about months ago at http://infotrope.net/blog/2007/07/31/how-not-to-write-a-perl-job-ad/ ... there can't be that many clueless Perl advertising shops in Hampton, but this one looks like it's gone *downhill*. Wow. K. -- Kirrily Robert skud at infotrope.net http://infotrope.net From rick at measham.id.au Fri Dec 7 17:42:36 2007 From: rick at measham.id.au (Rick Measham) Date: Sat, 08 Dec 2007 12:42:36 +1100 Subject: [Melbourne-pm] Recruitment Hall of Shame: Exhibit #000021 In-Reply-To: References: <4759D738.1060204@measham.id.au> Message-ID: <4759F68C.2060704@measham.id.au> Kirrily Robert wrote: > I bet this is the same mob that I wrote about months ago at > http://infotrope.net/blog/2007/07/31/how-not-to-write-a-perl-job-ad/ Your post back then inspired my Hall of Shame. I'd forgotten that your original entrant was from Hampton. I imagine you're right: it will be the same company. Unfortunately for "Sth Hampton Pty Ltd" their lack of care in marketing the role probably reflects the working conditions. Cheers! Rick Measham -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3241 bytes Desc: S/MIME Cryptographic Signature Url : http://mail.pm.org/pipermail/melbourne-pm/attachments/20071208/4aaa4225/attachment.bin From rick at measham.id.au Fri Dec 7 18:04:53 2007 From: rick at measham.id.au (Rick Measham) Date: Sat, 08 Dec 2007 13:04:53 +1100 Subject: [Melbourne-pm] Recruitment Hall of Shame: Exhibit #000021 In-Reply-To: <4759F68C.2060704@measham.id.au> References: <4759D738.1060204@measham.id.au> <4759F68C.2060704@measham.id.au> Message-ID: <4759FBC5.4020806@measham.id.au> Rick Measham wrote: > Unfortunately for "Sth Hampton Pty Ltd" their lack of > care in marketing the role probably reflects the working conditions. I also meant to say: It definitely reflects onto any other Hampton-area perl shops. If I was looking for a job and found something in Hapton, I'd probably avoid it. (OK, so I live out the back of Werribee so Hampton is probably already off the cards!) Cheers! Rick Measham -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3241 bytes Desc: S/MIME Cryptographic Signature Url : http://mail.pm.org/pipermail/melbourne-pm/attachments/20071208/d0dfe2f1/attachment.bin From tconnors at astro.swin.edu.au Sun Dec 9 16:49:38 2007 From: tconnors at astro.swin.edu.au (Tim Connors) Date: Mon, 10 Dec 2007 11:49:38 +1100 (EST) Subject: [Melbourne-pm] DateTime::new Message-ID: I've got code that makes extensive use of DateTime::new via DateTime->from_epoch() and DateTime::Format::Strptime->parse_datetime() I've recently noticed a rather large regression in speed of these calls (factors of many). I don't think it's the actual modules, since I hadn't touched CPAN in quite some time, and I recall having upgraded my distribution's perl in the past to version 5.8.8 I think (from somewhere around 5.8.0), balking at the speed of these calls, downgrading back to whereever it came from and seeing the speed go back to a good healthy speed again. However, looks like the distribution (centos 4 == redhat enterprise 4) has forced an upgrade of perl to 5.8.8 this time, and I get the slow DateTime calls again. Would anyone have any idea as to what might have changed? The results of dprofpp -u -p: 55.9 24.11 30.600 17409 0.0014 0.0018 DateTime::new 7.67 3.306 3.478 17908 0.0002 0.0002 Params::Validate::_validate 7.15 3.079 33.580 8686 0.0004 0.0039 DateTime::Format::Strptime::parse_ datetime ... (and I believe the DateTime::new is coming almost exclusively from DateTime::Format::Strptime::parse_datetime in this case, so it must be initialising it twice for whatever reason) I've tried with a floating timezone, UTC, GMT, local and they're all equally slow. I tried stepping through with perl -d, and it's not obvious yet to me where the expensive calls are done (I need to work out how to tell DProf to dig down into the calls DateTime makes). The most obvious location would be Time::Local::timegm_nocheck, since everything prior to that is just trivial manipulations of the supplied string. Both versions of the following test out as quick: DateTime 0.36 0.41 DROLSKY/DateTime-0.41.tar.gz DateTime::Format::Strptime 1.0700 1.0702 RICKM/DateTime-Format-Strptime-1.0702.tgz DateTime::Locale 0.34 0.35 DROLSKY/DateTime-Locale-0.35.tar.gz DateTime::TimeZone 0.62 0.70 DROLSKY/DateTime-TimeZone-0.70.tar.gz Any ideas of where to go from here? -- Tim Connors From toby.corkindale at rea-group.com Sun Dec 9 17:05:34 2007 From: toby.corkindale at rea-group.com (Toby Corkindale) Date: Mon, 10 Dec 2007 12:05:34 +1100 Subject: [Melbourne-pm] DateTime::new In-Reply-To: References: Message-ID: <475C90DE.9030207@rea-group.com> Tim Connors wrote: > I've got code that makes extensive use of DateTime::new via > DateTime->from_epoch() and > DateTime::Format::Strptime->parse_datetime() > > I've recently noticed a rather large regression in speed of these calls > (factors of many). I don't think it's the actual modules, since I hadn't > touched CPAN in quite some time, and I recall having upgraded my > distribution's perl in the past to version 5.8.8 I think (from somewhere > around 5.8.0), balking at the speed of these calls, downgrading back to > whereever it came from and seeing the speed go back to a good healthy > speed again. > > However, looks like the distribution (centos 4 == redhat enterprise 4) has > forced an upgrade of perl to 5.8.8 this time, and I get the slow DateTime > calls again. > > Would anyone have any idea as to what might have changed? Yep, that'd be the backported bugfix for the bless/overload issue that CentOS/RHEL has. Expect modules that use those heavily to take HUGE performance hits. Some Catalyst/DBIx::Class apps I wrote are almost unusable on those two distributions as a result :( You can roll your own vanilla Perl.. Or else Ubuntu/Debian/Gentoo seem to have non-borked Perl in their distros.. Toby -- Toby Corkindale Software developer From tconnors at astro.swin.edu.au Sun Dec 9 17:20:28 2007 From: tconnors at astro.swin.edu.au (Tim Connors) Date: Mon, 10 Dec 2007 12:20:28 +1100 (EST) Subject: [Melbourne-pm] DateTime::new In-Reply-To: <475C90DE.9030207@rea-group.com> References: <475C90DE.9030207@rea-group.com> Message-ID: On Mon, 10 Dec 2007, Toby Corkindale wrote: > Tim Connors wrote: > > I've got code that makes extensive use of DateTime::new via > > DateTime->from_epoch() and > > DateTime::Format::Strptime->parse_datetime() Looks like it is actually in DateTime::new rather than any routines it calls -- supplying -S to dprofpp shows: DateTime::new x 548 11.99s = (11.71 + 0.28)s DateTime::DefaultLocale x 548 0.00s DateTime::Locale::load x 548 0.09s = (0.04 + 0.05)s Params::Validate::_validate_pos x 548 0.05s DateTime::TimeZone::new x 548 0.04s = (0.02 + 0.02)s DateTime::TimeZone::UTC::new x 548 0.00s Params::Validate::_validate x 548 0.02s DateTime::_calc_local_rd x 548 0.01s = (0.00 + 0.02)s DateTime::TimeZone::UTC::is_utc x 548 0.00s DateTime::_calc_local_components x 548 0.02s = (0.02 + 0.00)s DateTime::_rd2ymd x 548 0.00s DateTime::_seconds_as_components x 548 0.00s DateTime::_calc_utc_rd x 548 0.02s = (0.01 + 0.01)s DateTime::TimeZone::UTC::is_utc x 548 0.01s DateTime::_normalize_tai_seconds x 548 0.00s DateTime::_handle_offset_modifier x 548 0.00s = (0.00 + 0.00)s DateTime::TimeZone::is_floating x 548 0.00s DateTime::_offset_for_local_datetime x 548 0.00s = (0.00 + 0.00)s DateTime::TimeZone::UTC::offset_for_local_datetime x 548 0.00s DateTime::_month_length x 548 0.00s = (0.00 + 0.00)s DateTime::_is_leap_year x 548 0.00s DateTime::_normalize_nanoseconds x 548 0.00s DateTime::_time_as_seconds x 548 0.00s DateTime::_ymd2rd x 548 0.00s Params::Validate::_validate x 548 0.12s = (0.12 + 0.01)s DateTime::__ANON__ x 2740 0.01s ie, only of those 11.99s are due to subroutines. Nice tool, dprofpp is :) > > I've recently noticed a rather large regression in speed of these calls > > (factors of many). I don't think it's the actual modules, since I hadn't > > touched CPAN in quite some time, and I recall having upgraded my > > distribution's perl in the past to version 5.8.8 I think (from somewhere > > around 5.8.0), balking at the speed of these calls, downgrading back to > > whereever it came from and seeing the speed go back to a good healthy > > speed again. > > > > However, looks like the distribution (centos 4 == redhat enterprise 4) has > > forced an upgrade of perl to 5.8.8 this time, and I get the slow DateTime > > calls again. > > > > Would anyone have any idea as to what might have changed? > > Yep, that'd be the backported bugfix for the bless/overload issue that > CentOS/RHEL has. > Expect modules that use those heavily to take HUGE performance hits. Gah, if I didn't already have enough reason to thouroughly dislike having to use CentOS and RHEL instead of Debian, at work. > Some Catalyst/DBIx::Class apps I wrote are almost unusable on those two > distributions as a result :( > > You can roll your own vanilla Perl.. Or else Ubuntu/Debian/Gentoo seem > to have non-borked Perl in their distros.. My google fu isn't working for me -- have you got a pointer to this bless issue? -- Tim Connors From toby.corkindale at rea-group.com Sun Dec 9 18:14:43 2007 From: toby.corkindale at rea-group.com (Toby Corkindale) Date: Mon, 10 Dec 2007 13:14:43 +1100 Subject: [Melbourne-pm] DateTime::new In-Reply-To: References: <475C90DE.9030207@rea-group.com> Message-ID: <475CA113.9070501@rea-group.com> Tim Connors wrote: > On Mon, 10 Dec 2007, Toby Corkindale wrote: > >> Tim Connors wrote: >>> I've got code that makes extensive use of DateTime::new via >>> DateTime->from_epoch() and >>> DateTime::Format::Strptime->parse_datetime() > > Looks like it is actually in DateTime::new rather than any routines it > calls -- supplying -S to dprofpp shows: [snip] > > ie, only of those 11.99s are due to subroutines. > > Nice tool, dprofpp is :) It's possible it's unrelated, although you mentioned that 'grading perl fixed the problem, so I was thinking it'd be in the interpreter, and wasn't thinking of the modules that are included too might have changed.. Since there's some interest, I've included more info on the patch issue below. >>> I've recently noticed a rather large regression in speed of these calls >>> (factors of many). I don't think it's the actual modules, since I hadn't >>> touched CPAN in quite some time, and I recall having upgraded my >>> distribution's perl in the past to version 5.8.8 I think (from somewhere >>> around 5.8.0), balking at the speed of these calls, downgrading back to >>> whereever it came from and seeing the speed go back to a good healthy >>> speed again. >>> >>> However, looks like the distribution (centos 4 == redhat enterprise 4) has >>> forced an upgrade of perl to 5.8.8 this time, and I get the slow DateTime >>> calls again. >>> >>> Would anyone have any idea as to what might have changed? >> Yep, that'd be the backported bugfix for the bless/overload issue that >> CentOS/RHEL has. >> Expect modules that use those heavily to take HUGE performance hits. > > Gah, if I didn't already have enough reason to thouroughly dislike having > to use CentOS and RHEL instead of Debian, at work. > >> Some Catalyst/DBIx::Class apps I wrote are almost unusable on those two >> distributions as a result :( >> >> You can roll your own vanilla Perl.. Or else Ubuntu/Debian/Gentoo seem >> to have non-borked Perl in their distros.. > > My google fu isn't working for me -- have you got a pointer to this bless > issue? I have more details archived at home, but I think this was the one: https://bugzilla.redhat.com/show_bug.cgi?id=253728 which was related to: http://rt.perl.org/rt3//Public/Bug/Display.html?id=34925 Looks like it's been solved on recent Fedora versions, at least. Try out this test on a few systems: -------cut to overloadtest.pl--------- #!/usr/bin/perl use overload q(<) => sub {}; my %h; for (my $i=0; $i<50000; $i++) { $h{$i} = bless [ ] => 'main'; print STDERR '.' if $i % 1000 == 0; } ------------------------------------ Then run: time ./overloadtest.pl You'll notice an order of magnitude difference. For comparisons sake, these are values from a couple of machines with good Perl interpreters, one is quite recent and fast, the other is a few years old. If you get results like half a minute, on a machine that's not antique, then you should think about moving away from those RPMs :) [modern machine]$ time ./overloadtest.pl .................................................. real 0m0.112s user 0m0.088s sys 0m0.020s [old machine]$ time ./overload.pl .................................................. real 0m0.192s user 0m0.180s sys 0m0.000s Toby -- Toby Corkindale Software developer From jarich at perltraining.com.au Tue Dec 11 18:14:40 2007 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 12 Dec 2007 13:14:40 +1100 Subject: [Melbourne-pm] Tonight's meeting - Wednesday 12th @REA In-Reply-To: References: Message-ID: <475F4410.6040207@perltraining.com.au> Next week is also Perl's 20th birthday. Who's bringing cake tonight? J Alfie John wrote: > Hi (), > > I invite you all to the next Melbourne Perl Mongers: > > When: Wednesday 12th, December 2007, 6:30pm > Where: REA ( 678 Victoria Street, Richmond - next to Victoria Gardens SC ) > Who: All are welcome > What: > - Kirrily will be giving a talk on packaging Perl applications > - Drinks at the Terminus Hotel > > __END__ > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From scottp at dd.com.au Tue Dec 11 18:42:00 2007 From: scottp at dd.com.au (Scott Penrose) Date: Wed, 12 Dec 2007 13:42:00 +1100 Subject: [Melbourne-pm] Tonight's meeting - Wednesday 12th @REA In-Reply-To: <475F4410.6040207@perltraining.com.au> References: <475F4410.6040207@perltraining.com.au> Message-ID: <6596A2F7-61F1-4531-88AF-57658649CA8C@dd.com.au> Hey Guys Sorry I am not going to be there again tonight, still my night to look after Teha. Maybe things will change next year :-) Have a great night, and HAPPY BIRTHDAY Perl Scooter On 12/12/2007, at 1:14 PM, Jacinta Richardson wrote: > Next week is also Perl's 20th birthday. Who's bringing cake tonight? > > J > > Alfie John wrote: >> Hi (), >> >> I invite you all to the next Melbourne Perl Mongers: >> >> When: Wednesday 12th, December 2007, 6:30pm >> Where: REA ( 678 Victoria Street, Richmond - next to Victoria >> Gardens SC ) >> Who: All are welcome >> What: >> - Kirrily will be giving a talk on packaging Perl applications >> - Drinks at the Terminus Hotel >> >> __END__ >> _______________________________________________ >> Melbourne-pm mailing list >> Melbourne-pm at pm.org >> http://mail.pm.org/mailman/listinfo/melbourne-pm >> > > -- > ("`-''-/").___..--''"`-._ | Jacinta Richardson | > `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | > (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | > _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | > (il),-'' (li),' ((!.-' | www.perltraining.com.au | > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From jarich at perltraining.com.au Tue Dec 11 19:37:44 2007 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 12 Dec 2007 14:37:44 +1100 Subject: [Melbourne-pm] Linux.conf.au Open Day - 2nd February 2008 Message-ID: <475F5788.8030006@perltraining.com.au> Dear Melbourne PM members, Next year from January 28th - February 2nd, Melbourne will host one of the world's best FOSS conferences: Linux.conf.au. On the last day, Saturday February 2nd we will be running an Open Day for the general public to showcase open source. The 2007 open day had a fantastic line-up of displays including: - Virtual Reality - Blender 3D - One Laptop Per Child - MythTV - Linux Gaming (for more see: http://www.linux.org.au/conf/2007/OpenDay.html) To make this day more fabulous, I would like to invite your group to host a community table. There are only three requirements: - Every demo must have Open Source involved. - Your stand must be accessible to the general public. - You need to supply your own computers, flyers and people. In return, we'll supply you with tables, chairs, power sources, wireless (hopefully) and visitors. With luck you can raise the profile of your user group (and get some more members) while increasing the attendees' awareness of Open Source. If your group would be interested in having a stand, please let me know by eithe r responding to this email or contacting openday at mel8ourne.org If you'd like to attend or if you know anyone who might like to attend please register (it's free) at: http://linux.conf.au/programme/open-day Everyone is welcome and I encourage you to bring your friends and family. All the best, Jacinta From ts at meme.com.au Tue Dec 11 20:49:01 2007 From: ts at meme.com.au (Tony Smith) Date: Wed, 12 Dec 2007 15:49:01 +1100 Subject: [Melbourne-pm] Tonight's meeting - Wednesday 12th @REA In-Reply-To: <475F4410.6040207@perltraining.com.au> References: <475F4410.6040207@perltraining.com.au> Message-ID: On 12/12/2007, at 1:14 PM, Jacinta Richardson wrote: > Next week is also Perl's 20th birthday. Who's bringing cake tonight? Not me. I've already done my turn on the cake roster for 2007. Hope you get more there tonight than I did, but I won't be one since another seasonal obligation has priority. But I also wanted to stick my nose in to mention to those not fortunate enough to get there that OSDC 2007 was so good it even helped me get over my ancient dislike of Brisbane. > J > > Alfie John wrote: >> Hi (), >> >> I invite you all to the next Melbourne Perl Mongers: >> >> When: Wednesday 12th, December 2007, 6:30pm >> Where: REA ( 678 Victoria Street, Richmond - next to Victoria >> Gardens SC ) >> Who: All are welcome >> What: >> - Kirrily will be giving a talk on packaging Perl applications >> - Drinks at the Terminus Hotel >> >> __END__ Before next time can we please have some well advertised arrangements for late entry for those who get delayed in unfamiliar traffic. Tony Smith 0405 499 718 TransForum Developer http://www.transforum.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071212/bc9ca248/attachment.html From alec.clews at gmail.com Wed Dec 12 12:26:47 2007 From: alec.clews at gmail.com (Alec Clews) Date: Thu, 13 Dec 2007 07:26:47 +1100 Subject: [Melbourne-pm] Meeting 12/Nov/07 Message-ID: <3c2b63c00712121226v63fcb2c2uc099d2d2edb292c9@mail.gmail.com> After yesterday's meeting some thanks are in order: 1) Kirrily for the presentation on building modules for distribution 2) Josh and Realestate.com for the use of their offices and help 3) Jacinta and Paul for bringing birthday cake and plates -- very nice 4) Alfie for sending out the notice Happy Summer Religious and Secular festivals to everyone. -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C blog:http://alecthegeek.wordpress.com/ From scottp at dd.com.au Wed Dec 12 13:55:22 2007 From: scottp at dd.com.au (Scott Penrose) Date: Thu, 13 Dec 2007 08:55:22 +1100 Subject: [Melbourne-pm] Meeting 12/Nov/07 In-Reply-To: <3c2b63c00712121226v63fcb2c2uc099d2d2edb292c9@mail.gmail.com> References: <3c2b63c00712121226v63fcb2c2uc099d2d2edb292c9@mail.gmail.com> Message-ID: That sounds excellent - thanks for the that Alec - and thanks to all who made PM great this year. Since we didn't get a picnic social meeting this month - and we usually don't have a PM meeting in January, how about a Beech or other Picnic event some time in January ? Scooter On 13/12/2007, at 7:26 AM, Alec Clews wrote: > After yesterday's meeting some thanks are in order: > > 1) Kirrily for the presentation on building modules for distribution > 2) Josh and Realestate.com for the use of their offices and help > 3) Jacinta and Paul for bringing birthday cake and plates -- very nice > 4) Alfie for sending out the notice > > Happy Summer Religious and Secular festivals to everyone. > > > > -- > Alec Clews > Personal Melbourne, Australia. > Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C > blog:http://alecthegeek.wordpress.com/ > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From toby.corkindale at rea-group.com Wed Dec 12 15:59:48 2007 From: toby.corkindale at rea-group.com (Toby Corkindale) Date: Thu, 13 Dec 2007 10:59:48 +1100 Subject: [Melbourne-pm] Perl 5.10 for normal people Message-ID: <476075F4.4070109@rea-group.com> So Perl 5.10 is about to be released. What does that mean for me? http://www.slideshare.net/rjbs/perl-510-for-people-who-arent-totally-insane/ -- Toby Corkindale Software developer From mathew.robertson at netratings.com.au Thu Dec 13 17:44:41 2007 From: mathew.robertson at netratings.com.au (Mathew Robertson) Date: Fri, 14 Dec 2007 12:44:41 +1100 Subject: [Melbourne-pm] retry() Message-ID: <4761E009.6090301@netratings.com.au> Hi folks, This morning I cam across an interesting a problem I was having with die'ing socket handles. ie: this was the original code: my $result = get_xxx(yyy); where get_xxx was a wrapper to eventually a socket call - but the socket would sometimes fail. Now since I wanted simply to retry the get_xxx(), a number of solutions are possible: - rewrite each get_xxx with retry code - re-implement each get_xxx (where the xxx is some specific function) to implement retries - write a "super wrapper" which implemented the retries. - something else... Eventually I decided to write a source filter - here is the syntax I ended up with: my $result = retry { get_xxx(yyy) }; with an optional argument for the number of retries. I didn't find anything equivalent on CPAN - particularly its simplicity and genericity - so I thought I might post it here to see what others think. It includes an example too. regards, Mathew Robertson ################################### package Retry; use strict; use warnings; use Exporter 'import'; use Filter::Simple; our @EXPORT_OK = 'retry'; our $DEBUG = 0; our $RETRIES = 0; sub retry { my $count = $RETRIES; $count = $_[1] if (@_ > 1); $count ++; my $code = (@_ > 0) ? $_[0] : $_; my $result; while ($count) { $result = eval { &$code(); }; last unless ($@); print STDERR "...retrying... $/" if $DEBUG; $count --; } die $@ if $@; return $result; } my $p = __PACKAGE__; FILTER { if (s/retry\s+{(.*?)}\s*,\s*(\d+)/${p}::retry( sub { $1 }, $2 )/s){ print "TWO ARG $/" if $DEBUG; } elsif (s/retry\s+{(.*?)}/${p}::retry( sub { $1 } )/s) { print "ONE ARG $/" if $DEBUG; } }; 1; ################################### #!/usr/bin/perl use strict; use warnings (FATAL => 'all'); use Retry; our $global = 0; my $x = retry { $global++; die "\$global < 3" if ($global < 3); $global; }, 5; print $x.$/; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071214/076def55/attachment.html From mir at pax.apana.org.au Sun Dec 16 03:40:21 2007 From: mir at pax.apana.org.au (Mirko Fluher) Date: Sun, 16 Dec 2007 22:40:21 +1100 Subject: [Melbourne-pm] Unix / Perl Message-ID: <20071216114021.GA15381@pax.apana.org.au> Could someone help with this mixture of Unix and Perl. foreach $_ (`tree -isuDRf /dir1/fileserver/dir2/documents`) { next if(/^\/dir1/); ($line1, $line2) = /(.*?)\/dir1\/fileserver\/dir2\/documents(\/.*$)/; $line1 =~ tr/[]//d; $_ = $line1; ($userid, $size, $month, $day, $year) = /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/; print "$userid,$size,$month,$day,$year,$line2\n"; } # to run this prog. # ./make_index_docu_csv.pl|sort +1 -rnt, > /dir1/fileserver/dir2/documents/documents_index.csv I would like to have the whole thing in perl ... the problem I have at the moment is that 'tree' truncates userid .. :( I have some perl handing directories and files but and bits. Having problem getting userid, size time together; not to mention the sorting. Sorry if this is poor perl... I am not a professional. thanks if you can point to a good direction. -- Mirko Fluher http://pax.apana.org.au Computers are useless. They can only give you answers. - Pablo Picasso From shlomif at iglu.org.il Sun Dec 16 12:47:16 2007 From: shlomif at iglu.org.il (Shlomi Fish) Date: Sun, 16 Dec 2007 22:47:16 +0200 Subject: [Melbourne-pm] Unix / Perl In-Reply-To: <20071216114021.GA15381@pax.apana.org.au> References: <20071216114021.GA15381@pax.apana.org.au> Message-ID: <200712162247.16481.shlomif@iglu.org.il> On Sunday 16 December 2007, Mirko Fluher wrote: > Could someone help with this mixture of Unix and Perl. > > foreach $_ (`tree -isuDRf /dir1/fileserver/dir2/documents`) > { > next if(/^\/dir1/); > ($line1, $line2) = > /(.*?)\/dir1\/fileserver\/dir2\/documents(\/.*$)/; $line1 =~ tr/[]//d; > $_ = $line1; > ($userid, $size, $month, $day, $year) = > /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/; print > "$userid,$size,$month,$day,$year,$line2\n"; > } > # to run this prog. > # ./make_index_docu_csv.pl|sort +1 -rnt, > > /dir1/fileserver/dir2/documents/documents_index.csv > > I would like to have the whole thing in perl ... the problem I have at the > moment is that 'tree' truncates userid .. :( > I have some perl handing directories and files but and bits. Having problem > getting userid, size time together; not to mention the sorting. > > Sorry if this is poor perl... I am not a professional. > thanks if you can point to a good direction. Instead of reading the output of "tree", you should use File::Find ( perldoc File::Find ) or one of its newer and better non-core alternatives: * http://search.cpan.org/dist/File-Find-Object/ * http://search.cpan.org/dist/File-Next/ This should make your job much easier. Regards, Shlomi Fish --------------------------------------------------------------------- Shlomi Fish shlomif at iglu.org.il Homepage: http://www.shlomifish.org/ I'm not an actor - I just play one on T.V. From ddick at aapt.net.au Sun Dec 16 12:56:00 2007 From: ddick at aapt.net.au (David Dick) Date: Mon, 17 Dec 2007 07:56:00 +1100 Subject: [Melbourne-pm] Unix / Perl In-Reply-To: <20071216114021.GA15381@pax.apana.org.au> References: <20071216114021.GA15381@pax.apana.org.au> Message-ID: <476590E0.9010805@aapt.net.au> Mirko Fluher wrote: > Could someone help with this mixture of Unix and Perl. > foreach $_ (`tree -isuDRf /dir1/fileserver/dir2/documents`) > { > next if(/^\/dir1/); > ($line1, $line2) = /(.*?)\/dir1\/fileserver\/dir2\/documents(\/.*$)/; > $line1 =~ tr/[]//d; > $_ = $line1; > ($userid, $size, $month, $day, $year) = /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/; > print "$userid,$size,$month,$day,$year,$line2\n"; > } > # to run this prog. > # ./make_index_docu_csv.pl|sort +1 -rnt, > /dir1/fileserver/dir2/documents/documents_index.csv > > I would like to have the whole thing in perl ... the problem I have at the moment is that 'tree' > truncates userid .. :( > I have some perl handing directories and files but and bits. Having problem getting userid, size time > together; not to mention the sorting. > > Sorry if this is poor perl... I am not a professional. > thanks if you can point to a good direction. > > This attempt uses some of the modules you might need mirko. Best of luck. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: tmp.pl Url: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071217/186c8fc1/attachment.pl From cas at taz.net.au Sun Dec 16 12:46:42 2007 From: cas at taz.net.au (Craig Sanders) Date: Mon, 17 Dec 2007 07:46:42 +1100 Subject: [Melbourne-pm] Unix / Perl In-Reply-To: <20071216114021.GA15381@pax.apana.org.au> References: <20071216114021.GA15381@pax.apana.org.au> Message-ID: <20071216204642.GA11568@taz.net.au> On Sun, Dec 16, 2007 at 10:40:21PM +1100, Mirko Fluher wrote: > Could someone help with this mixture of Unix and Perl. > > foreach $_ (`tree -isuDRf /dir1/fileserver/dir2/documents`) > { > next if(/^\/dir1/); > ($line1, $line2) = /(.*?)\/dir1\/fileserver\/dir2\/documents(\/.*$)/; > $line1 =~ tr/[]//d; > $_ = $line1; > ($userid, $size, $month, $day, $year) = /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/; > print "$userid,$size,$month,$day,$year,$line2\n"; > } > # to run this prog. > # ./make_index_docu_csv.pl|sort +1 -rnt, > /dir1/fileserver/dir2/documents/documents_index.csv > > I would like to have the whole thing in perl ... the problem I have at the moment is that 'tree' > truncates userid .. :( you could use IO::All - it has directory recursion and file-statting abilities. start from something like: ---cut here--- #! /usr/bin/perl use strict; use IO::All use Date::Format; my $dir = io('/dir1/fileserver/dir2/documents'); foreach (sort {$b->size <=> $a->size} $dir->All) { my $username = getpwuid($_->uid); my $date = time2str('%Y-%m-%d', $_->mtime); printf "%s,%s,%s,%s\n", $username, $_->size, $date, $_->name } ---cut here--- Note: i have used YYYY-MM-DD as the date output format. this ISO format is unambiguous, and it is the only format which sorts correctly. if you really want "mm,dd,yyyy" (not recommended) then change the format string given to time2str. better yet, if you use one of the CSV modules (see next paragraph) then extract the month, day, year into separate variables and print them as separate fields. you probably also want to use DBD::CSV or Text::CSV_XS instead of just a simple printf to make sure you produce correctly formatted CSV output rather than just comma-separated (which will work in most cases, but not if there are commas in any of the filenames) there's a very valuable lesson about perl here: there will almost always be a perl module in CPAN to do exactly what you need....and it will do it properly, rather than implementing your own quick-and-dirty partial solution. craig -- craig sanders BOFH excuse #33: piezo-electric interference From cas at taz.net.au Sun Dec 16 13:46:46 2007 From: cas at taz.net.au (Craig Sanders) Date: Mon, 17 Dec 2007 08:46:46 +1100 Subject: [Melbourne-pm] Unix / Perl In-Reply-To: <20071216204642.GA11568@taz.net.au> References: <20071216114021.GA15381@pax.apana.org.au> <20071216204642.GA11568@taz.net.au> Message-ID: <20071216214645.GB11568@taz.net.au> On Mon, Dec 17, 2007 at 07:46:42AM +1100, Craig Sanders wrote: > start from something like: > > ---cut here--- > #! /usr/bin/perl > > use strict; > > use IO::All > use Date::Format; > > my $dir = io('/dir1/fileserver/dir2/documents'); > > foreach (sort {$b->size <=> $a->size} $dir->All) { > my $username = getpwuid($_->uid); > my $date = time2str('%Y-%m-%d', $_->mtime); > > printf "%s,%s,%s,%s\n", $username, $_->size, $date, $_->name > } > > ---cut here--- oops, when cutting and pasting from my test script, i missed a semicolon after use 'IO::All'. and, for completeness, after the printf and final '}', too. and it doesn't hurt to turn on warnings, too. the script should look like this, instead. ---cut here--- #! /usr/bin/perl -w use strict; use IO::All; use Date::Format; my $dir = io('/dir1/fileserver/dir2/documents'); foreach (sort {$b->size <=> $a->size} $dir->All) { my $username = getpwuid($_->uid); my $date = time2str('%Y-%m-%d', $_->mtime); printf "%s,%s,%s,%s\n", $username, $_->size, $date, $_->name; }; ---cut here--- craig -- craig sanders "The hell with the prime directive! Let's kill something!" From brendon.oliver at gmail.com Sun Dec 16 13:51:15 2007 From: brendon.oliver at gmail.com (Brendon Oliver) Date: Mon, 17 Dec 2007 08:51:15 +1100 Subject: [Melbourne-pm] Looking for suggestions Message-ID: <200712170851.15530.brendon.oliver@gmail.com> > there's a very valuable lesson about perl here: there will almost always > be a perl module in CPAN to do exactly what you need....and it will do > it properly, rather than implementing your own quick-and-dirty partial > solution. .. and speaking of which, I was poking around cpan a bit over the weekend looking for a module to help me but no luck, so I'm hoping someone might have a suggestion or two before I go off and write something of my own: What I'm after is something to help solve word puzzles like Scrabble, Boggle, crosswords, etc. What I'm thinking of is something that I can feed, say /usr/share/dict/*, then give it a string (or list) of random letters and a maximum word length. Said module would then process possible permutations of the letters and return a list of valid "words" from the dictionary, containing only those letters and no longer than the max word length. Ability to accept a meta-character (eg. * or ?) to indicate a wildcard letter (matches anything) would be a bonus. ie. given say ouxz*se and max length 5, would give house, mouse, rouse, etc. as possible words. Thoughts anyone? cheers, - b. -- I'd just as soon kiss a Wookie. -- Princess Leia Organa 08:40:09 up 7 days, 2:11, 8 users, load average: 0.18, 1.10, 1.57 From steve.sabljak at gmail.com Sun Dec 16 14:06:20 2007 From: steve.sabljak at gmail.com (Steve Sabljak) Date: Mon, 17 Dec 2007 09:06:20 +1100 Subject: [Melbourne-pm] Looking for suggestions In-Reply-To: <200712170851.15530.brendon.oliver@gmail.com> References: <200712170851.15530.brendon.oliver@gmail.com> Message-ID: <81c28d920712161406o16512253p102f9fa505594fef@mail.gmail.com> On Dec 17, 2007 8:51 AM, Brendon Oliver wrote: > > there's a very valuable lesson about perl here: there will almost always > > be a perl module in CPAN to do exactly what you need....and it will do > > it properly, rather than implementing your own quick-and-dirty partial > > solution. > > .. and speaking of which, I was poking around cpan a bit over the weekend > looking for a module to help me but no luck, so I'm hoping someone might have > a suggestion or two before I go off and write something of my own: > > What I'm after is something to help solve word puzzles like Scrabble, Boggle, > crosswords, etc. What I'm thinking of is something that I can feed, > say /usr/share/dict/*, then give it a string (or list) of random letters and > a maximum word length. Said module would then process possible permutations > of the letters and return a list of valid "words" from the dictionary, > containing only those letters and no longer than the max word length. > Ability to accept a meta-character (eg. * or ?) to indicate a wildcard letter > (matches anything) would be a bonus. ie. given say ouxz*se and max length 5, > would give house, mouse, rouse, etc. as possible words. > Would Games::Scrabble, Games::Literati, or Games::Boggle not do the trick? Or are you looking for something more general? cheers, Steve From guy at alchemy.com.au Sun Dec 16 14:08:27 2007 From: guy at alchemy.com.au (Guy Morton) Date: Mon, 17 Dec 2007 09:08:27 +1100 Subject: [Melbourne-pm] Looking for suggestions In-Reply-To: <200712170851.15530.brendon.oliver@gmail.com> References: <200712170851.15530.brendon.oliver@gmail.com> Message-ID: <1E66CF54-166A-4BFF-B48D-77B568D1EFD2@alchemy.com.au> here's a thought - you shouldn't cheat. :-) On 17/12/2007, at 8:51 AM, Brendon Oliver wrote: >> there's a very valuable lesson about perl here: there will almost >> always >> be a perl module in CPAN to do exactly what you need....and it >> will do >> it properly, rather than implementing your own quick-and-dirty >> partial >> solution. > > .. and speaking of which, I was poking around cpan a bit over the > weekend > looking for a module to help me but no luck, so I'm hoping someone > might have > a suggestion or two before I go off and write something of my own: > > What I'm after is something to help solve word puzzles like > Scrabble, Boggle, > crosswords, etc. What I'm thinking of is something that I can feed, > say /usr/share/dict/*, then give it a string (or list) of random > letters and > a maximum word length. Said module would then process possible > permutations > of the letters and return a list of valid "words" from the dictionary, > containing only those letters and no longer than the max word length. > Ability to accept a meta-character (eg. * or ?) to indicate a > wildcard letter > (matches anything) would be a bonus. ie. given say ouxz*se and max > length 5, > would give house, mouse, rouse, etc. as possible words. > > > Thoughts anyone? > > cheers, > > - b. > > > > -- > I'd just as soon kiss a Wookie. > -- Princess Leia Organa > > 08:40:09 up 7 days, 2:11, 8 users, load average: 0.18, 1.10, 1.57 > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From brendon.oliver at gmail.com Sun Dec 16 14:19:39 2007 From: brendon.oliver at gmail.com (Brendon Oliver) Date: Mon, 17 Dec 2007 09:19:39 +1100 Subject: [Melbourne-pm] Looking for suggestions In-Reply-To: <81c28d920712161406o16512253p102f9fa505594fef@mail.gmail.com> References: <200712170851.15530.brendon.oliver@gmail.com> <81c28d920712161406o16512253p102f9fa505594fef@mail.gmail.com> Message-ID: <200712170919.39368.brendon.oliver@gmail.com> On Monday 17 December 2007 09:06:20 Steve Sabljak wrote: > Would Games::Scrabble, Games::Literati, or Games::Boggle not do the trick? > Or are you looking for something more general? bah! I must have been looking in the wrong places - just using the links on the search.cpan.org home page... never occurred to me to just search for Games::*, I was looking at text searching & such. Thanks for the suggestion, I'll have a look at those as a starting point. Cheers, - Brendon -- There are running jobs. Why don't you go chase them? 09:17:08 up 7 days, 2:48, 8 users, load average: 0.43, 0.32, 0.55 From list at bereft.net Sun Dec 16 16:01:03 2007 From: list at bereft.net (Brad Bowman) Date: Mon, 17 Dec 2007 11:01:03 +1100 Subject: [Melbourne-pm] Looking for suggestions In-Reply-To: <200712171006.27401.brendon.oliver@gmail.com> References: <200712170851.15530.brendon.oliver@gmail.com> <4765ABCE.5080901@bereft.net> <200712171006.27401.brendon.oliver@gmail.com> Message-ID: <4765BC3F.5000302@bereft.net> (Oops, fell off list) Brendon Oliver wrote: > On Monday 17 December 2007 09:50:54 you wrote: >>> What I'm after is something to help solve word puzzles like Scrabble, >>> Boggle, crosswords, etc. What I'm thinking of is something that I can >>> feed, say /usr/share/dict/*, then give it a string (or list) of random >>> letters and a maximum word length. >> [..] >> >>> Thoughts anyone? >> I use "an", possibly the least googleable computer program ever: >> >> alias puzzle='an -m9 -w -d $HOME/words/yawl-0.3.2/word.list' > > Thanks for the suggestion. I don't suppose you have a link to 'an' do you? http://fatphil.org/words/an.html -- Furthermore, when experiencing a rush of blood to the head, if one puts spittle on the upper part of one's ear, it will soon go away. -- Hagakure http://bereft.net/hagakure/ From Andrew.Hogben at rowben.com.au Tue Dec 18 18:24:20 2007 From: Andrew.Hogben at rowben.com.au (Andrew Hogben) Date: Wed, 19 Dec 2007 13:24:20 +1100 Subject: [Melbourne-pm] 2 x 3+ month contracts for Perl developers. Message-ID: Hello Melbourne Perl Mongers, I have an opportunity for 2 x 3+ month contracts for Perl developers. This role is working with a great group of people and is an exciting project. Definitely potential to extend. Please find details below. Thank you, Andrew Hogben. Perl Programmer / Scripting 3+ Month Contract * 3+ Month Contract * Project Ready to GO! * Perl Development Our client has received a recent request to increase contractor head count in order to complete one of their priority projects throughout 2008. Ready to go ASAP (January start), this position is simply put as a Perl Programmer. Even though this is a contracting role, the working culture of this organisation is fantastic and one that will welcome you as an addition to the team. To be successful in this role your background will consist of: * Minimum of 3 years IT experience * Perl scripting / programming skills * Solid scripting skills * Understanding of Unix * Excellent Communication skills Given the size of the project, there is a likely opportunity to extend beyond the initial 3 month period. For further information regarding this contract position, please send your resume to Andrew Hogben at andrew.hogben at rowben.com.au or click apply now. Kind Regards, Andrew Hogben Principal Consultant Ph: +61 3 8320 7582 M: +61 402 373 750 Rowben Consulting Level 2, 546 Collins St Melbourne Vic 3000 Rowben Consulting | Connecting People With Success Sponsor my cycling challenge from Melbourne to Sydney for the Cancer Council at http://www.rideforcancer.com.au/ This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message. Finally, the recipient should check this email and any attachments for the presence of viruses. Rowben Consulting accepts no liability for any damage caused by any virus transmitted by this email. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071219/eba2cc6c/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 17029 bytes Desc: att25d03.jpg Url : http://mail.pm.org/pipermail/melbourne-pm/attachments/20071219/eba2cc6c/attachment-0001.jpe From cas at taz.net.au Wed Dec 19 17:52:16 2007 From: cas at taz.net.au (Craig Sanders) Date: Thu, 20 Dec 2007 12:52:16 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <20071220002051.GA4673@pax.apana.org.au> References: <20071217082135.GB11556@taz.net.au> <20071217090951.GA25780@pax.apana.org.au> <20071217124111.GC11556@taz.net.au> <20071218115917.GA4611@pax.apana.org.au> <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> Message-ID: <20071220015216.GF8095@taz.net.au> cc-ed back to melb-pm. On Thu, Dec 20, 2007 at 11:20:51AM +1100, Mirko Fluher wrote: > This is what I have so far .... > > #!/usr/bin/perl > > use Date::Format; > > my $dirname = '/home/mir/Documents/'; > > opendir DIR, $dirname or die "Cannot open '$dirname' $!"; > while($entry = readdir DIR ) > { > next if $entry =~ /^\.\.?$/; > my $full_path = "$dirname$entry"; don't rely on the provided directory name ending in a slash. unix doesn't care if there are excess slashes, it just ignores any extras, so: my $full_path = "$dirname/$entry"; if it bothers you, then strip out the extras yourself: my $full_path = "$dirname/$entry"; $full_path =~ s=//=/=g; > my ($uid, $size, $mtime) = ((stat($full_path))[4,7,9]); list context is correct here because you are returning a list (the array slice). > my ($userid) = getpwuid($uid); you don't want list context here, so change it to: my $userid = getpwuid($uid); > my $date = time2str('%Y-%m-%d', $mtime); > printf "%s,%s,%s %s\n", $userid, $size, $date, $full_path; > } > > closedir DIR; > > But at the moment, when I run this on my old box at work, (and change > the dirname of couse) and run it as root ... what I get are the > directories but not the files in the directories dunno what's happening on your system, but on my system your code DOES display the files in the directory i tried it on (/tmp). of course, it doesn't display any of the files in the subdirectories of /tmp -- see below. > or even sub-dir ... in other word, it is not going down the full_path > recursively. it won't recurse because you haven't written any code to recurse the directories. you've only written code to display the contents of one directory. there are very good reasons why using the modules is better than rolling-your-own, and one of them is so you don't have to waste time rewriting basic tools. if IO::All isn't working for you, or you can't install it on your machine, then try one of the other modules that people mentioned. this is perl, there is *always* more than one way to do it. recursing directories has been done many times, it's a very common requirement. craig -- craig sanders The primary difference [...] is that the Java programm will reliably and obviously crash, whereas the C Program will do something obscure -- Java Language Tutorial From jarich at perltraining.com.au Wed Dec 19 21:05:05 2007 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 20 Dec 2007 16:05:05 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <20071220015216.GF8095@taz.net.au> References: <20071217082135.GB11556@taz.net.au> <20071217090951.GA25780@pax.apana.org.au> <20071217124111.GC11556@taz.net.au> <20071218115917.GA4611@pax.apana.org.au> <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> Message-ID: <4769F801.6040006@perltraining.com.au> Craig Sanders wrote: > if it bothers you, then strip out the extras yourself: > > my $full_path = "$dirname/$entry"; > $full_path =~ s=//=/=g; Except, don't use = as your separator. It breaks people's brains. Use curly braces instead: $full_path =~ s{//}{/}g; or anything which doesn't already have a strong semantic map already (which is hard, because this is Perl, and Perl uses almost all the punctuation for something), and which can reasonably be assumed to be obvious to a 6 months Perl user. Curlies are great for pick-your-delimiter stuff: q{single quoted} qq{double quotes} qx{quoted executable} qr{precompiled regular expression} m{match} s{match}{replace} If absolutely necessary (for example the string/expression contains unmatched }s, I'll use ()s, []s, !s or at worst #s. All the best, J From cas at taz.net.au Wed Dec 19 21:44:42 2007 From: cas at taz.net.au (Craig Sanders) Date: Thu, 20 Dec 2007 16:44:42 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <4769F801.6040006@perltraining.com.au> References: <20071217124111.GC11556@taz.net.au> <20071218115917.GA4611@pax.apana.org.au> <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> Message-ID: <20071220054442.GA8107@taz.net.au> On Thu, Dec 20, 2007 at 04:05:05PM +1100, Jacinta Richardson wrote: > Craig Sanders wrote: > > > if it bothers you, then strip out the extras yourself: > > > > my $full_path = "$dirname/$entry"; > > $full_path =~ s=//=/=g; it's wrong (at least, sub-optimal), anyway. should be: $full_path =~ s=//+=/=g; > Except, don't use = as your separator. It breaks people's brains. only if they can't read perl. i use = (when i don't use /) because it's one of the characters least likely to appear as a character literal in a regexp also containing / character literals. e.g. any regexp containing a literal / (which is why i'm using another char as the separator, to avoid the unreadable ugliness of lots of \ escaping) is fairly likely to also have : characters ("http://.....") '=' also has the significant advantage of being visually distinct from most other characters (no highs or lows, just a horizontally centred double-bar so it highlights the separation almost like whitespace). '-' works reasonably well too. if the regexp has literal = characters too, i'll use something else. the whole point is to make the regexp more readable. > Use curly braces instead: i find that ugly inside regexps, and don't/won't do it. curly braces are for hashes or code blocks etc, not for uglifying regexps. i'll use pretty nearly anything else before i'll use them. > $full_path =~ s{//}{/}g; the point of using a different separator is to make the regexp more readable, not less. YMMV, but to me, that is significantly less readable. craig -- craig sanders Perl is designed to give you several ways to do anything, so consider picking the most readable one. -- Larry Wall in the perl man page From wjmoore at gmail.com Wed Dec 19 21:44:33 2007 From: wjmoore at gmail.com (Wesley Moore) Date: Thu, 20 Dec 2007 16:44:33 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <4769F801.6040006@perltraining.com.au> References: <20071217082135.GB11556@taz.net.au> <20071218115917.GA4611@pax.apana.org.au> <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> Message-ID: <664f64be0712192144p505c8517y64bb8e30ad39e3dc@mail.gmail.com> Another option, avoiding the regex entirely would be to use Cwd::realpath to tidy the path up. http://search.cpan.org/~kwilliams/PathTools-3.25/Cwd.pm#abs_path_and_friends Wes On Dec 20, 2007 4:05 PM, Jacinta Richardson wrote: > Craig Sanders wrote: > > > if it bothers you, then strip out the extras yourself: > > > > my $full_path = "$dirname/$entry"; > > $full_path =~ s=//=/=g; > > Except, don't use = as your separator. It breaks people's brains. Use > curly braces instead: > > $full_path =~ s{//}{/}g; > > or anything which doesn't already have a strong semantic map already > (which is hard, because this is Perl, and Perl uses almost all the > punctuation for something), and which can reasonably be assumed to be > obvious to a 6 months Perl user. > > Curlies are great for pick-your-delimiter stuff: > > q{single quoted} > qq{double quotes} > qx{quoted executable} > qr{precompiled regular expression} > m{match} > s{match}{replace} > > If absolutely necessary (for example the string/expression contains > unmatched }s, I'll use ()s, []s, !s or at worst #s. > > All the best, > > > J > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > From mathew.robertson at netratings.com.au Wed Dec 19 22:28:06 2007 From: mathew.robertson at netratings.com.au (Mathew Robertson) Date: Thu, 20 Dec 2007 17:28:06 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <20071220054442.GA8107@taz.net.au> References: <20071217124111.GC11556@taz.net.au> <20071218115917.GA4611@pax.apana.org.au> <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> <20071220054442.GA8107@taz.net.au> Message-ID: <476A0B76.8070900@netratings.com.au> >>> if it bothers you, then strip out the extras yourself: >>> >>> my $full_path = "$dirname/$entry"; >>> $full_path =~ s=//=/=g; >>> > > it's wrong (at least, sub-optimal), anyway. should be: > > $full_path =~ s=//+=/=g; > > >> Except, don't use = as your separator. It breaks people's brains. >> > > only if they can't read perl. > nobody can read Perl... :) > i use = (when i don't use /) because it's one of the characters least > likely to appear as a character literal in a regexp also containing / > character literals. > > e.g. any regexp containing a literal / (which is why i'm using another > char as the separator, to avoid the unreadable ugliness of lots of \ > escaping) is fairly likely to also have : characters ("http://.....") > > '=' also has the significant advantage of being visually distinct from > most other characters (no highs or lows, just a horizontally centred > double-bar so it highlights the separation almost like whitespace). > > '-' works reasonably well too. > > if the regexp has literal = characters too, i'll use something else. > > the whole point is to make the regexp more readable. > except that using your http example, you can't parse url arguments (without escaping) and the ugliness-factor would but much worse. Perl POD often uses '!'... maybe that is a good character to use? >> Use curly braces instead: >> > > i find that ugly inside regexps, and don't/won't do it. curly braces are > for hashes or code blocks etc, not for uglifying regexps. > > i'll use pretty nearly anything else before i'll use them. > > > >> $full_path =~ s{//}{/}g; >> > > the point of using a different separator is to make the regexp more > readable, not less. > > YMMV, but to me, that is significantly less readable. > The POD contains many references where using balanced brackets is a good thing - it would be only you that considers them ugly. Mathew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071220/5ae2ed80/attachment.html From cas at taz.net.au Wed Dec 19 23:26:58 2007 From: cas at taz.net.au (Craig Sanders) Date: Thu, 20 Dec 2007 18:26:58 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <476A0B76.8070900@netratings.com.au> References: <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> <20071220054442.GA8107@taz.net.au> <476A0B76.8070900@netratings.com.au> Message-ID: <20071220072657.GB8107@taz.net.au> On Thu, Dec 20, 2007 at 05:28:06PM +1100, Mathew Robertson wrote: > > only if they can't read perl. > > > nobody can read Perl... :) lots of people can. it's kind of a requirement for writing it well. > except that using your http example, you can't parse url arguments > (without escaping) 1. i wouldn't. using regexps to parse CGI args is a bad idea. that's what CGI or any one of several other CGI arg parsing modules are for. 2. for the sake of the argument, if i were to be writing a Q&D hack to do that, i would (as i mentioned in my previous msg) use another separator. '|', perhaps. or maybe '-'. or something. depends. my personal aesthetic says if i have to escape a character more than once or twice then use a different separator. > and the ugliness-factor would but much worse. Perl > POD often uses '!'... maybe that is a good character to use? or '!', even if it does feel a bit over-excited. B1FF-mode regexps. > >> Use curly braces instead: > > > > i find that ugly inside regexps, and don't/won't do it. curly braces > > are for hashes or code blocks etc, not for uglifying regexps. > > > > i'll use pretty nearly anything else before i'll use them. also, curly braces have a meaning inside regexps - they're for specifying the number of times to match. {n}? Match exactly n times {n,}? Match at least n times {n,m}? Match at least n but not more than m times i use them all the time, especially the latter two forms. > > YMMV, but to me, that is significantly less readable. > > The POD contains many references where using balanced brackets is a > good thing - it would be only you that considers them ugly. 1. what can i say? i have good taste where some others don't :-) (and i don't consider all curly braces ugly - just using them as regexp boundaries) 2. POD has such examples inside regexps? craig -- craig sanders I could never learn to like her -- except on a raft at sea with no other provisions in sight. -- Mark Twain From mir at pax.apana.org.au Thu Dec 20 04:08:56 2007 From: mir at pax.apana.org.au (Mirko Fluher) Date: Thu, 20 Dec 2007 23:08:56 +1100 Subject: [Melbourne-pm] finally there In-Reply-To: <20071216114021.GA15381@pax.apana.org.au> References: <20071216114021.GA15381@pax.apana.org.au> Message-ID: <20071220120856.GA6049@pax.apana.org.au> On Sun, Dec 16, 2007 at 10:40:21PM +1100, Mirko Fluher wrote: If you remember this was my original request... > Could someone help with this mixture of Unix and Perl. > > foreach $_ (`tree -isuDRf /dir1/fileserver/dir2/documents`) > { > next if(/^\/dir1/); > ($line1, $line2) = /(.*?)\/dir1\/fileserver\/dir2\/documents(\/.*$)/; > $line1 =~ tr/[]//d; > $_ = $line1; > ($userid, $size, $month, $day, $year) = /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/; > print "$userid,$size,$month,$day,$year,$line2\n"; > } > # to run this prog. > # ./make_index_docu_csv.pl|sort +1 -rnt, > /dir1/fileserver/dir2/documents/documents_index.csv I noticed one problem I had was with 'tree' ... it seems to truncate userid afer 8 char.... Thought of using Unix 'find' instead ... but then also thought there must be a way in Perl ... no so simple if you haven't done much work with modules before ... Anyway, thanks to all those who replied! no matter what code I received, it was very useful!! Here is what I have so far ... I tested it and it produces very similar output ... except for date.. because tree gives mmddyy and if yy is current it gives time instead... but I am not too worried about that. ... here it goes... ------------ #!/usr/bin/perl -w use File::Find; use Date::Format; $dirname = "/dir1/fileserver/dir2/documents"; find(sub {$size{$File::Find::name} = -s if -f;}, $dirname); @files = sort {$size{$b} <=> $size{$a}} keys %size; foreach (@files) { my ($uid, $mtime) = ((stat($_))[4,9]); my $userid = getpwuid($uid); my $date = time2str('%Y-%m-%d', $mtime); printf "%s,%s,%s,%s\n", $userid, $size{$_}, $date,$_; } -------------------- Happy to read any other useful comments as I am sure the above code can be improved. Cheers, -- Mirko Fluher http://pax.apana.org.au Il semble que la perfection soit atteinte non quand il n?y a plus rien ? ajouter, mais quand il n?y a plus rien ? retrancher. Perfection is apparently achieved not when nothing more can be added, but rather when nothing else can be removed. ? Antoine de Saint-Exup?ry, Terres des Hommes From ddick at aapt.net.au Thu Dec 20 12:41:33 2007 From: ddick at aapt.net.au (David Dick) Date: Fri, 21 Dec 2007 07:41:33 +1100 Subject: [Melbourne-pm] finally there In-Reply-To: <20071220120856.GA6049@pax.apana.org.au> References: <20071216114021.GA15381@pax.apana.org.au> <20071220120856.GA6049@pax.apana.org.au> Message-ID: <476AD37D.40209@aapt.net.au> Mirko Fluher wrote: > Happy to read any other useful comments as I am sure the above code can be improved. > Cheers, > > hi mirko, i would plead with you to 'use strict' in all of your perl programs. among other things, it will help detect typing mistakes in variable names. something like the following. -------------------------- #!/usr/bin/perl -w use strict; use File::Find; use Date::Format; my $dirname = "/dir1/fileserver/dir2/documents"; my %size; find(sub {$size{$File::Find::name} = -s if -f;}, $dirname); my @files = sort {$size{$b} <=> $size{$a}} keys %size; foreach (@files) { my ($uid, $mtime) = ((stat($_))[4,9]); my $userid = getpwuid($uid); my $date = time2str('%Y-%m-%d', $mtime); printf "%s,%s,%s,%s\n", $userid, $size{$_}, $date,$_; } -------------------------- From mathew.robertson at netratings.com.au Thu Dec 20 14:50:43 2007 From: mathew.robertson at netratings.com.au (Mathew Robertson) Date: Fri, 21 Dec 2007 09:50:43 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <20071220072657.GB8107@taz.net.au> References: <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> <20071220054442.GA8107@taz.net.au> <476A0B76.8070900@netratings.com.au> <20071220072657.GB8107@taz.net.au> Message-ID: <476AF1C3.3020604@netratings.com.au> >>> only if they can't read perl. >>> >> nobody can read Perl... :) >> > lots of people can. it's kind of a requirement for writing it well. > whoosh.... >> except that using your http example, you can't parse url arguments >> (without escaping) >> > > 1. i wouldn't. using regexps to parse CGI args is a bad idea. that's > what CGI or any one of several other CGI arg parsing modules are for. > obviously - but since you brought up the example, you cant then turn around and point fingers... > 2. for the sake of the argument, if i were to be writing a Q&D hack > to do that, i would (as i mentioned in my previous msg) use another > separator. '|', perhaps. or maybe '-'. or something. > > depends. my personal aesthetic says if i have to escape a character > more than once or twice then use a different separator. > >> and the ugliness-factor would but much worse. Perl >> POD often uses '!'... maybe that is a good character to use? >> > or '!', even if it does feel a bit over-excited. B1FF-mode regexps. > > >>>> Use curly braces instead: >>>> >>> i find that ugly inside regexps, and don't/won't do it. curly braces >>> are for hashes or code blocks etc, not for uglifying regexps. >>> >>> i'll use pretty nearly anything else before i'll use them. >>> > also, curly braces have a meaning inside regexps - they're for > specifying the number of times to match. > > {n}? Match exactly n times > {n,}? Match at least n times > {n,m}? Match at least n but not more than m times > > i use them all the time, especially the latter two forms. > > >>> YMMV, but to me, that is significantly less readable. >>> >> The POD contains many references where using balanced brackets is a >> good thing - it would be only you that considers them ugly. >> > > 1. what can i say? i have good taste where some others don't :-) > > (and i don't consider all curly braces ugly - just using them as regexp > boundaries) > > 2. POD has such examples inside regexps? > perlre has examples using {} <>, perlop uses {} And if you consider the 'tr' operator in a similar vein, perlop uses [] <> {} perlop even has one example where two different brackets are used in the same operation, as in: $program =~ s { ... } []sgx; Mathew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071221/a616542a/attachment.html From mathew.robertson at netratings.com.au Thu Dec 20 14:50:43 2007 From: mathew.robertson at netratings.com.au (Mathew Robertson) Date: Fri, 21 Dec 2007 09:50:43 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <20071220072657.GB8107@taz.net.au> References: <20071218134413.GG11556@taz.net.au> <20071218224726.GA12337@pax.apana.org.au> <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> <20071220054442.GA8107@taz.net.au> <476A0B76.8070900@netratings.com.au> <20071220072657.GB8107@taz.net.au> Message-ID: <476AF1C3.3020604@netratings.com.au> >>> only if they can't read perl. >>> >> nobody can read Perl... :) >> > lots of people can. it's kind of a requirement for writing it well. > whoosh.... >> except that using your http example, you can't parse url arguments >> (without escaping) >> > > 1. i wouldn't. using regexps to parse CGI args is a bad idea. that's > what CGI or any one of several other CGI arg parsing modules are for. > obviously - but since you brought up the example, you cant then turn around and point fingers... > 2. for the sake of the argument, if i were to be writing a Q&D hack > to do that, i would (as i mentioned in my previous msg) use another > separator. '|', perhaps. or maybe '-'. or something. > > depends. my personal aesthetic says if i have to escape a character > more than once or twice then use a different separator. > >> and the ugliness-factor would but much worse. Perl >> POD often uses '!'... maybe that is a good character to use? >> > or '!', even if it does feel a bit over-excited. B1FF-mode regexps. > > >>>> Use curly braces instead: >>>> >>> i find that ugly inside regexps, and don't/won't do it. curly braces >>> are for hashes or code blocks etc, not for uglifying regexps. >>> >>> i'll use pretty nearly anything else before i'll use them. >>> > also, curly braces have a meaning inside regexps - they're for > specifying the number of times to match. > > {n}? Match exactly n times > {n,}? Match at least n times > {n,m}? Match at least n but not more than m times > > i use them all the time, especially the latter two forms. > > >>> YMMV, but to me, that is significantly less readable. >>> >> The POD contains many references where using balanced brackets is a >> good thing - it would be only you that considers them ugly. >> > > 1. what can i say? i have good taste where some others don't :-) > > (and i don't consider all curly braces ugly - just using them as regexp > boundaries) > > 2. POD has such examples inside regexps? > perlre has examples using {} <>, perlop uses {} And if you consider the 'tr' operator in a similar vein, perlop uses [] <> {} perlop even has one example where two different brackets are used in the same operation, as in: $program =~ s { ... } []sgx; Mathew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/melbourne-pm/attachments/20071221/a616542a/attachment-0001.html From cas at taz.net.au Fri Dec 21 01:03:39 2007 From: cas at taz.net.au (Craig Sanders) Date: Fri, 21 Dec 2007 20:03:39 +1100 Subject: [Melbourne-pm] nearly there... In-Reply-To: <476AF1C3.3020604@netratings.com.au> References: <20071218232718.GB8095@taz.net.au> <20071219080719.GA16090@pax.apana.org.au> <20071219092015.GD8095@taz.net.au> <20071220002051.GA4673@pax.apana.org.au> <20071220015216.GF8095@taz.net.au> <4769F801.6040006@perltraining.com.au> <20071220054442.GA8107@taz.net.au> <476A0B76.8070900@netratings.com.au> <20071220072657.GB8107@taz.net.au> <476AF1C3.3020604@netratings.com.au> Message-ID: <20071221090339.GC8107@taz.net.au> On Fri, Dec 21, 2007 at 09:50:43AM +1100, Mathew Robertson wrote: > >>> only if they can't read perl. > >>> > >> nobody can read Perl... :) > >> > > lots of people can. it's kind of a requirement for writing it well. > > > whoosh.... 'whooshes' really ought to be reserved for situations where your comment was actually funny enough to be treated as a joke. it wasn't, so the only appropriate response was to treat it as if you were serious. > >> except that using your http example, you can't parse url arguments > >> (without escaping) > > > > 1. i wouldn't. using regexps to parse CGI args is a bad idea. that's > > what CGI or any one of several other CGI arg parsing modules are for. > > > obviously - but since you brought up the example, you cant then turn > around and point fingers... who was pointing fingers? anyway, pattern matching isn't always about parsing. sometimes it's just for recognition or for simple transformation and you don't give a damn about the 'meaning' or embedded values. > > 2. for the sake of the argument, if i were to be writing a Q&D hack > > to do that, i would (as i mentioned in my previous msg) use another ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > separator. '|', perhaps. or maybe '-'. or something. i brought up that example too (twice. three times now), which you chose to ignore. > > 2. POD has such examples inside regexps? > > > perlre has examples using {} <>, perlop uses {} still ugly, IMO. and far more prone to creating confusion than simply using an = as the regexp separator. one final advantage of = is that it is a single keystroke. on reflection, that is probably my primary reason (equal with the visual distinction) for using it. curly braces are four: shift, {, shift, }. over a full 's/search/replace/options;', that's 8 keystrokes versus 3. in the end, though, i really couldn't care less whether you like curly braces as regexp separators or not and can not fathom why it bothers you so much that i don't. craig -- craig sanders BOFH excuse #357: I'd love to help you -- it's just that the Boss won't let me near the computer. From crashkat at gmail.com Thu Dec 27 14:51:09 2007 From: crashkat at gmail.com (Kat Grant) Date: Fri, 28 Dec 2007 09:51:09 +1100 Subject: [Melbourne-pm] Namespace Guidelines? Message-ID: <28F99384-15BB-42A2-9EE8-96E794DE5E0A@gmail.com> Hey All, Hope everyone had a happy festive day :) Does anyone know of any nice articles outlining guidelines for OO perl namespaces? At the moment, we have heaps of old code which is sitting in the top level namespace and potentially clashing with cpan stuff, and also we don't have things in any kind of namespace hierarchy - everything is just in /lib. We want to clean this up and I'm looking for something I can refer to in our dev guidelines. Any help? Cheers Kat From alfiejohn at gmail.com Sat Dec 29 01:40:11 2007 From: alfiejohn at gmail.com (Alfie John) Date: Sat, 29 Dec 2007 20:40:11 +1100 Subject: [Melbourne-pm] Namespace Guidelines? In-Reply-To: <28F99384-15BB-42A2-9EE8-96E794DE5E0A@gmail.com> References: <28F99384-15BB-42A2-9EE8-96E794DE5E0A@gmail.com> Message-ID: Hey Kat, Don't know of any guidelines off the top of my head that I could point you to, but why not start local packages with your own organisation name? That way, you're guaranteeing you won't be clashing with anything on CPAN. If that's too broad, you could do: Org::Division::Branch::Package Org::App::Object Org::Division::App::Object Alfie On Dec 28, 2007 9:51 AM, Kat Grant wrote: > Hey All, > Hope everyone had a happy festive day :) > > Does anyone know of any nice articles outlining guidelines for OO > perl namespaces? > > At the moment, we have heaps of old code which is sitting in the top > level namespace and potentially clashing with cpan stuff, and also we > don't have things in any kind of namespace hierarchy - everything is > just in /lib. We want to clean this up and I'm looking for something > I can refer to in our dev guidelines. > > Any help? > > Cheers > Kat > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > From crashkat at gmail.com Sat Dec 29 15:03:13 2007 From: crashkat at gmail.com (Kat Grant) Date: Sun, 30 Dec 2007 10:03:13 +1100 Subject: [Melbourne-pm] Namespace Guidelines? In-Reply-To: References: <28F99384-15BB-42A2-9EE8-96E794DE5E0A@gmail.com> Message-ID: Hey Alfie, Yep, definitely the first step is to move them into organisational namespace, but I'm looking for something that goes at bit further in good module naming practices. I'm pretty sure I read something quite good years ago, but haven't been able to find it :( K On 29/12/2007, at 8:40 PM, Alfie John wrote: > Hey Kat, > > Don't know of any guidelines off the top of my head that I could point > you to, but why not start local packages with your own organisation > name? That way, you're guaranteeing you won't be clashing with > anything on CPAN. > > If that's too broad, you could do: > > Org::Division::Branch::Package > Org::App::Object > Org::Division::App::Object > > Alfie > > On Dec 28, 2007 9:51 AM, Kat Grant wrote: >> Hey All, >> Hope everyone had a happy festive day :) >> >> Does anyone know of any nice articles outlining guidelines for OO >> perl namespaces? >> >> At the moment, we have heaps of old code which is sitting in the top >> level namespace and potentially clashing with cpan stuff, and also we >> don't have things in any kind of namespace hierarchy - everything is >> just in /lib. We want to clean this up and I'm looking for something >> I can refer to in our dev guidelines. >> >> Any help? >> >> Cheers >> Kat >> _______________________________________________ >> Melbourne-pm mailing list >> Melbourne-pm at pm.org >> http://mail.pm.org/mailman/listinfo/melbourne-pm >> From alfiejohn at gmail.com Sat Dec 29 21:47:04 2007 From: alfiejohn at gmail.com (Alfie John) Date: Sun, 30 Dec 2007 16:47:04 +1100 Subject: [Melbourne-pm] Namespace Guidelines? In-Reply-To: References: <28F99384-15BB-42A2-9EE8-96E794DE5E0A@gmail.com> Message-ID: Hey again, On Dec 30, 2007 10:03 AM, Kat Grant wrote: > Hey Alfie, > Yep, definitely the first step is to move them into organisational > namespace, but I'm looking for something that goes at bit further in > good module naming practices. > I'm pretty sure I read something quite good years ago, but haven't > been able to find it :( Maybe you were thinking of perlmodstyle? Damian's PBP has an entire chapter on naming conventions, but doesn't talk about module naming. Perhaps you should just be focusing on the API and abstractions, and the naming convention will come naturally. It usually does :) Alfie