From JDAfu2aDM4VF5 at perform.nospymail.com Thu Jul 2 11:39:58 2009 From: JDAfu2aDM4VF5 at perform.nospymail.com (VPeuWzSme3ZPzsXHjF2wHz) Date: Thu, 02 Jul 2009 14:39:58 -0400 Subject: [Wellington-pm] truth vs.Truth Message-ID: FROM THE USA, a financial bank's daily newsletter taking to task the discrepancy between what the public is told and what the numbers proport to report: The strangeness of today though will be the fact that the Weekly Initial Jobless Claims will print, and probably show that over 600,000 jobs were lost last week, and unemployment claims were filed... So... How does the BLS (labor statistics) come up with "only" 365,000 jobs lost for the month, when one week was 600,000? The games people play now... Every night and every day now... Never meaning what they say now... Never saying what they mean... And they wile away the hours... In their ivory towers... Till they're covered up with flowers...In the back of a black limousine... - Joe South... ____________________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From douglas at paradise.net.nz Thu Jul 2 15:15:46 2009 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Fri, 03 Jul 2009 10:15:46 +1200 Subject: [Wellington-pm] truth vs.Truth In-Reply-To: References: Message-ID: <4A4D3192.3020507@paradise.net.nz> VPeuWzSme3ZPzsXHjF2wHz wrote: > FROM THE USA, a financial bank's daily newsletter taking to task the > discrepancy between what the public is told and what the numbers proport > to report: > > The strangeness of today though will be the fact that the Weekly Initial > Jobless Claims will print, and probably show that over 600,000 jobs were > lost last week, and unemployment claims were filed... So... How does the > BLS (labor statistics) come up with "only" 365,000 jobs lost for the > month, when one week was 600,000? The games people play now... Every > night and every day now... Never meaning what they say now... Never > saying what they mean... And they wile away the hours... In their ivory > towers... Till they're covered up with flowers...In the back of a black > limousine... - Joe South... OK, I think I see where your problem lies. The "Truth" module you refer to is http://search.cpan.org/~beppu/Unamerican-Truth-1.08/Truth.pm, yes? whereas "truth" is just an unimplemented pragma. I'm surprised (just slightly) that it works at all. So replace use truth; with use Unamerican::Truth; and you should get better results. As for the details of the output, they may be explained if some of the numbers involved were octal or hex. Did you perhaps input 0600000 by mistake? Of course this would all be clearer if you could supply a code example. Douglas From JDAfu2aDM4VF5 at perform.nospymail.com Thu Jul 2 15:24:52 2009 From: JDAfu2aDM4VF5 at perform.nospymail.com (VPeuWzSme3ZPzsXHjF2wHz) Date: Thu, 02 Jul 2009 18:24:52 -0400 Subject: [Wellington-pm] truth vs.Truth In-Reply-To: <4A4D3192.3020507@paradise.net.nz> References: <4A4D3192.3020507@paradise.net.nz> Message-ID: Since we're all so interested in the economy, the computations are correction-able based on betting on the high ideal of truth or Rashomon ! See video from St. Louis for more - http://www.sovereignsociety.com/Portals/0/landing/chuckvideo_070209.html On 7/2/2009 6:15 PM, Douglas Bagnall wrote: > VPeuWzSme3ZPzsXHjF2wHz wrote: > > >> FROM THE USA, a financial bank's daily newsletter taking to task the >> discrepancy between what the public is told and what the numbers proport >> to report: >> >> The strangeness of today though will be the fact that the Weekly Initial >> Jobless Claims will print, and probably show that over 600,000 jobs were >> lost last week, and unemployment claims were filed... So... How does the >> BLS (labor statistics) come up with "only" 365,000 jobs lost for the >> month, when one week was 600,000? The games people play now... Every >> night and every day now... Never meaning what they say now... Never >> saying what they mean... And they wile away the hours... In their ivory >> towers... Till they're covered up with flowers...In the back of a black >> limousine... - Joe South... >> > > > > OK, I think I see where your problem lies. The "Truth" module you > refer to is > http://search.cpan.org/~beppu/Unamerican-Truth-1.08/Truth.pm, yes? > whereas "truth" is just an unimplemented pragma. I'm surprised (just > slightly) that it works at all. So replace > > use truth; > > with > > use Unamerican::Truth; > > and you should get better results. > > As for the details of the output, they may be explained if some of the > numbers involved were octal or hex. Did you perhaps input 0600000 by > mistake? Of course this would all be clearer if you could supply a > code example. > > > Douglas > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > > -- KENNETH POLLOCK . tel: 07-5743345 mob: 0064-21-1230962 fax: (815) 642.1475 nz at perform.cotse.net isotope at safe-mail.net . ____________________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From douglas at paradise.net.nz Thu Jul 2 15:42:34 2009 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Fri, 03 Jul 2009 10:42:34 +1200 Subject: [Wellington-pm] truth vs.Truth In-Reply-To: References: <4A4D3192.3020507@paradise.net.nz> Message-ID: <4A4D37DA.5010800@paradise.net.nz> hi VPeuWzSme3ZPzsXHjF2wHz, > the computations are > correction-able based on betting on the high ideal of truth or Rashomon ! I think you're expecting too much here, even of Perl. But again, a code example would clarify. Douglas From grant at mclean.net.nz Thu Jul 9 14:32:33 2009 From: grant at mclean.net.nz (Grant McLean) Date: Fri, 10 Jul 2009 09:32:33 +1200 Subject: [Wellington-pm] Beer and Perl on Tuesday Message-ID: <1247175153.6412.27.camel@localhost> Hi Mongers The July meeting of Wellington Perl Mongers will be a social rather than a technical meeting. This will involve meeting at a pub for drinks and chats (Perl optional) and possibly food afterwards. The question to be decided is which pub. I of course always favour JJ Murphys but they let us down rather badly by running out of beer last time. The Green Man has been pretty good but we may want to consider that both JJ Murphys and the Green Man have a quiz night on Tuesdays. Another option worthy of consideration is the Bristol. Thoughts? Cheers Grant From brenda at wallace.net.nz Thu Jul 9 15:45:45 2009 From: brenda at wallace.net.nz (Brenda Wallace) Date: Fri, 10 Jul 2009 10:45:45 +1200 Subject: [Wellington-pm] Beer and Perl on Tuesday In-Reply-To: <1247175153.6412.27.camel@localhost> References: <1247175153.6412.27.camel@localhost> Message-ID: Somewhere with ginger beer please. On Fri, Jul 10, 2009 at 9:32 AM, Grant McLean wrote: > Hi Mongers > > The July meeting of Wellington Perl Mongers will be a social rather than > a technical meeting. ?This will involve meeting at a pub for drinks and > chats (Perl optional) and possibly food afterwards. > > The question to be decided is which pub. I of course always favour JJ > Murphys but they let us down rather badly by running out of beer last > time. ?The Green Man has been pretty good but we may want to consider > that both JJ Murphys and the Green Man have a quiz night on Tuesdays. > Another option worthy of consideration is the Bristol. > > Thoughts? > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > -- www.br3nda.com www.coffee.geek.nz "Support living artists - the dead ones don't need it." - Collette Rene Fergus From JDAfu2aDM4VF5 at perform.nospymail.com Thu Jul 9 20:01:59 2009 From: JDAfu2aDM4VF5 at perform.nospymail.com (VPeuWzSme3ZPzsXHjF2wHz) Date: Thu, 09 Jul 2009 23:01:59 -0400 Subject: [Wellington-pm] Beer and Perl on Tuesday Message-ID: Art and humor is just around the bend: (1)I want to die in my sleep like my grandfather... Not screaming and yelling like the passengers in his car. Will Shriner (2)I`ve got a great ambition to die of exhaustion rather than boredom. Thomas Carlyle (3)Have the courage to live. Anyone can die. Robert Cody (4)In modern war... you will die like a dog for no good reason. Ernest Hemingway (5)If you want to see what your friends and family think of you, die broke, and see who comes to your funeral. Gregory Nunn Brenda Wallace wrote: > Somewhere with ginger beer please. > > On Fri, Jul 10, 2009 at 9:32 AM, Grant McLean wrote: > >> Hi Mongers >> >> The July meeting of Wellington Perl Mongers will be a social rather than >> a technical meeting. This will involve meeting at a pub for drinks and >> chats (Perl optional) and possibly food afterwards. >> >> The question to be decided is which pub. I of course always favour JJ >> Murphys but they let us down rather badly by running out of beer last >> time. The Green Man has been pretty good but we may want to consider >> that both JJ Murphys and the Green Man have a quiz night on Tuesdays. >> Another option worthy of consideration is the Bristol. >> >> Thoughts? >> >> Cheers >> Grant >> >> _______________________________________________ >> Wellington-pm mailing list >> Wellington-pm at pm.org >> http://mail.pm.org/mailman/listinfo/wellington-pm >> >> ____________________________________________________________________________ ____________________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From grant at mclean.net.nz Mon Jul 13 03:15:52 2009 From: grant at mclean.net.nz (Grant McLean) Date: Mon, 13 Jul 2009 22:15:52 +1200 Subject: [Wellington-pm] Wellington.pm social tomorrow (Tuesday) Message-ID: <1247480152.8427.29.camel@localhost> Hi Mongers The July meeting of Wellingon Perl Mongers is a social rather than a technical meetup. Come along to the Bristol Hotel at 131 Cuba Mall from 6:00ish (or earlier if you fancy) and join the other Perl Mongers for beer, conversation and perhaps even dinner. Tuesday evening. See you there Grant From lrw at clear.net.nz Wed Jul 15 20:12:20 2009 From: lrw at clear.net.nz (Lesley Longhurst) Date: Thu, 16 Jul 2009 15:12:20 +1200 Subject: [Wellington-pm] Wellington.pm social tomorrow (Tuesday) In-Reply-To: <1247480152.8427.29.camel@localhost> References: <1247480152.8427.29.camel@localhost> Message-ID: <4A5E9A94.7080602@clear.net.nz> Grant McLean wrote: > Hi Mongers > > The July meeting of Wellingon Perl Mongers is a social rather than a technical meetup. > So, how did it work? I had been intending to go, but when the time came I was feeling pretty anti-social so I though it best not to inflict myself on the crowd. From matt at catalyst.net.nz Wed Jul 15 20:15:42 2009 From: matt at catalyst.net.nz (Matthew Hunt) Date: Thu, 16 Jul 2009 15:15:42 +1200 Subject: [Wellington-pm] Wellington.pm social tomorrow (Tuesday) In-Reply-To: <4A5E9A94.7080602@clear.net.nz> References: <1247480152.8427.29.camel@localhost> <4A5E9A94.7080602@clear.net.nz> Message-ID: <4A5E9B5E.60103@catalyst.net.nz> Lesley Longhurst wrote: > Grant McLean wrote: >> Hi Mongers >> >> The July meeting of Wellingon Perl Mongers is a social rather than a >> technical meetup. > > So, how did it work? I had been intending to go, but when the time came > I was feeling pretty anti-social so I though it best not to inflict > myself on the crowd. Crowd. Haha :) It was certainly a good way of lowering productivity on Wednesday. From grant at mclean.net.nz Wed Jul 15 20:26:24 2009 From: grant at mclean.net.nz (Grant McLean) Date: Thu, 16 Jul 2009 15:26:24 +1200 Subject: [Wellington-pm] Wellington.pm social tomorrow (Tuesday) In-Reply-To: <4A5E9A94.7080602@clear.net.nz> References: <1247480152.8427.29.camel@localhost> <4A5E9A94.7080602@clear.net.nz> Message-ID: <1247714784.21546.3.camel@putnam.wgtn.cat-it.co.nz> On Thu, 2009-07-16 at 15:12 +1200, Lesley Longhurst wrote: > Grant McLean wrote: > > Hi Mongers > > > > The July meeting of Wellingon Perl Mongers is a social rather than a technical meetup. > > > > So, how did it work? I had been intending to go, but when the time came > I was feeling pretty anti-social so I though it best not to inflict > myself on the crowd. It was not a large crowd but that's not particularly surprising given the weather. Six hardy souls turned up for good beer, good conversation and a good curry. I did manage to wake up feeling fairly crappy the next day so I guess it must have been a good night. Cheers Grant From JDAfu2aDM4VF5 at perform.nospymail.com Wed Jul 15 22:39:08 2009 From: JDAfu2aDM4VF5 at perform.nospymail.com (VPeuWzSme3ZPzsXHjF2wHz) Date: Thu, 16 Jul 2009 01:39:08 -0400 Subject: [Wellington-pm] Wellington.pm social tomorrow (Tuesday) In-Reply-To: <1247714784.21546.3.camel@putnam.wgtn.cat-it.co.nz> References: <1247480152.8427.29.camel@localhost> <4A5E9A94.7080602@clear.net.nz> <1247714784.21546.3.camel@putnam.wgtn.cat-it.co.nz> Message-ID: And I wanted to go, but was more than ten minutes north, and that was by motorway. On 7/15/2009 11:26 PM, Grant McLean wrote: > On Thu, 2009-07-16 at 15:12 +1200, Lesley Longhurst wrote: > >> Grant McLean wrote: >> >>> Hi Mongers >>> >>> The July meeting of Wellingon Perl Mongers is a social rather than a technical meetup. >>> >>> >> So, how did it work? I had been intending to go, but when the time came >> I was feeling pretty anti-social so I though it best not to inflict >> myself on the crowd. >> > > It was not a large crowd but that's not particularly surprising given > the weather. Six hardy souls turned up for good beer, good conversation > and a good curry. I did manage to wake up feeling fairly crappy the > next day so I guess it must have been a good night. > > Cheers > Grant > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > > -- KENNETH POLLOCK . tel: 07-5743345 mob: 0064-21-1230962 fax: (815) 642.1475 nz at perform.cotse.net isotope at safe-mail.net . ____________________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From grant at mclean.net.nz Tue Jul 21 00:56:30 2009 From: grant at mclean.net.nz (Grant McLean) Date: Tue, 21 Jul 2009 19:56:30 +1200 Subject: [Wellington-pm] [Fwd: Books and News from the O'Reilly User Group Program--July] Message-ID: <1248162990.11831.1.camel@localhost> -------- Forwarded Message -------- View this information as HTML in your browser, click here: http://post.oreilly.com/rd/9z1zdu21hkrdrs7luq5vqcjv0p0bbnaiagjku614ltg Hi there, We're updating our UG newsletter so it's easier to find the info you need to keep in touch with O'Reilly. Comments, suggestions, and feedback are always welcome. Please pass along any part of this newsletter to your group via email or your website and include the discount codes. We offer both a text and an HTML version. Thanks --Marsee Henon P.S. If you're a twitter user, please follow our special O'Reilly User Group account: http://post.oreilly.com/rd/9z1zi5p82b7bhgpbdt4tbav6cvd4vafsrsc9or8gou0 OSCON (O'Reilly Open Source Convention) is approaching quickly in San Jose, CA on July 20-24. If you're coming, please let me know so I can keep an eye out for you during the week. We'd also love to have you come by the O'Reilly booth in the expo hall on Wednesday, July 22, at 6pm to meet our authors. If you're undecided about attending, you can still register with code "os09usrg" to receive 20% off. http://post.oreilly.com/rd/9z1z6r3qbap8tib4f5olah2q641h6mm65ebq6qshdf8 Or register for an Expo Pass and attend any of these free events including: Birds of a Feather http://post.oreilly.com/rd/9z1zola15mll1hbqsacrbunfdmpue6tcci1tn1m6538 Products and Services sessions http://post.oreilly.com/rd/9z1ztr09o2e3u9qg17e7fegi5h3363tgbvmoi0ihk98 OSCamp http://post.oreilly.com/rd/9z1ztvjpmt31e5ken7u3l21f39rj24sl0uqd57blpe8 For a list of all free events, go to: http://post.oreilly.com/rd/9z1zc08qcu3b603uacgt3akg3c6v08u7tk7jndf6glo The Community Leadership Summit starts this weekend before OSCON (July 18-19) and is designed for community managers, leaders, and organizers of all kinds (that includes all user group leaders!) at the San Jose McEnery Convention Center. The summit is free but requires pre-registration. Even if you can't make the conference, please join us for this special event. http://post.oreilly.com/rd/9z1z2hju6hi2d7je7m4bjb6pnejj23qftt93u2g2blo New to the training lineup is our InsideMobile Conference--Learn the ins and outs of mobile programming, design and business for iPhone, Blackberry, Windows Mobile, Android, and Palm webOS. July 26 & 27 in San Jose, CA. Register Now and Save $150! http://post.oreilly.com/rd/9z1zgo8nf45dtitpodmq2dakuptoiu16id8tr29e8s0 O'Reilly Media is conducting research about a technical certification program and we want your opinion. Please take our 20 question survey to help us understand what you want in a certification program from O'Reilly--what topics, what motivates you, and what you'd expect to get out of it. Complete the survey and you'll be entered in a random drawing for a chance to win $200 of O'Reilly ebooks. Thank you for your help! http://post.oreilly.com/rd/9z1z881vtb5reaatdsvhmocc84p0i7p3gs23e58atc0 Have you tried one of our free webcasts? We offer many different topics every week and you can always go back and watch the previous ones. Upcoming webcasts include "iPhone Forensics: Live Recovery of an iPhone 3G[s]" and "Hands-on: Step-by-step MySQL Clustering Setup," Past topics that are well worth a watch include "10 Ways to Wreck Your Database," "Radical Career Success in a Down Economy," and "Around the world in 32 minutes with The Geek Atlas." You can find them all at: http://post.oreilly.com/rd/9z1zsf2s539h13h07m22tko0nkhi1h5ls84jnop51bg We're always looking for book reviewers, especially on our new releases. New books we're excited about include the The Geek Atlas, The New Community Rules, Best iPhone Apps, Erlang Programming, and Beautiful Architecture. If you'd like to write a review of any of these books for Amazon, Slashdot, or your blog, please send an email to your user group leader with the book title and where you'll review it. --------------------------------------------------------------- New Releases --------------------------------------------------------------- Get 35% off from O'Reilly, No Starch, Paraglyph, PC Publishing, Pragmatic Bookshelf, Rocky Nook, SitePoint, or YoungJin books and ebooks you purchase directly from O'Reilly. Just use code DSUG when ordering online or by phone 800-998-9938. http://post.oreilly.com/rd/9z1zkc3lr5d797ut0elve4aq7ct6d0bjt3hkbuqgp0g Digital Architectural Photography http://post.oreilly.com/rd/9z1z27fic6lqv5cm7ptvb98rv2lh7luc04722s94ad0 Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition (SitePoint) http://post.oreilly.com/rd/9z1zieirngjlqtt5dtak93hhujee4275i8ptlpok72o Complete Web Monitoring http://post.oreilly.com/rd/9z1zqge74i93i9civpis4cmrkrmemlah2oido43lfl8 The CSS Anthology: 101 Essential Tips, Tricks & Hacks, Third Edition http://post.oreilly.com/rd/9z1z286ilcjuiubunjptd9jceus76lmvp2m8sjkke8g Data Mashups in R http://post.oreilly.com/rd/9z1zn77fmj89lh28su9oetvf9lhh2lkct1819peeqr0 Erlang Programming http://post.oreilly.com/rd/9z1zsjtvatgvlb6f8b9495o79069n0r0m7r2gh61np0 Even Faster Web Sites http://post.oreilly.com/rd/9z1zq1cnc4i7bra913o2ia1hslrv47ivh9bu5us3elo Hadoop: The Definitive Guide http://post.oreilly.com/rd/9z1z181lbrtrm64c9c30lf47k27c8cvj2utai928bkg Head First PMP: Rough Cuts Version, Second Edition http://post.oreilly.com/rd/9z1z00fqopqirl1mqoh90ru61dfgm21aqptqep4bddo iPhone Game Development: Rough Cuts Version http://post.oreilly.com/rd/9z1zr9s8d915d3mml018jtaf26f8n38472tok0vthog Java Message Service, Second Edition http://post.oreilly.com/rd/9z1z1h1u5hde4m7tjpjs1etjk1uhkvtuft9uslm2i0g Land the Tech Job You Love (Pragmatic Bookshelf) http://post.oreilly.com/rd/9z1z11or3ghep6gbk8q22omnu8vilpijth7t8h3k9r0 Learning PHP, MySQL, and JavaScript http://post.oreilly.com/rd/9z1znuv3ldrfmotald50189j507nre2skupr2k6iu1g Mercurial: The Definitive Guide http://post.oreilly.com/rd/9z1z76903o33t54lnt4liubnp02h39925h4ueioud50 Modular Java (Pragmatic Bookshelf) http://post.oreilly.com/rd/9z1zdc53p1db8hce3m947uvl6dpkaofjtfcbsr1p6v0 My New iPhone (No Starch) http://post.oreilly.com/rd/9z1zerugi20dk3so46ohge5no66b2j468mjnn690g70 The Myths of Security http://post.oreilly.com/rd/9z1z7220fctrip844if3c1d69ddeeja90lhjj2lh8m0 Natural Language Processing with Python http://post.oreilly.com/rd/9z1zgpf1vdvaokfio51tu1mgv0op446lr7cadokn73o The New Community Rules http://post.oreilly.com/rd/9z1zkv41jk8ph6ihupir0icnlf68gqv337kfjl73q98 Online Marketing Inside Out (SitePoint) http://post.oreilly.com/rd/9z1zjdl0773sbd31umbkunfnha8b2c182krcifar5jg Programming Cocoa with Ruby http://post.oreilly.com/rd/9z1z3hf10vgtcus0gsnl689f7q50g3c3ge8r7cag3jg Programming Scala (Pragmatic Bookshelf) http://post.oreilly.com/rd/9z1zmhm61dljmfjlo17jp0mgqjceq580e1ksjnk1nvo Programming the Semantic Web http://post.oreilly.com/rd/9z1zt42h64c0at75q1qqte4o6r24r1rme70ifibkli8 Ruby Best Practices http://post.oreilly.com/rd/9z1zlua6rc65am239qtr1l54n0dm10e7lip372splk8 Take Control of Safari 4 (TidBITS) http://post.oreilly.com/rd/9z1zpki1mg1oe35nhqf0eictetpc58ql6lhqtthd66o VMware Cookbook: Rough Cuts Version http://post.oreilly.com/rd/9z1zb605j7f7siehuahb4p93c8mp9m6hjftq4077en0 Windows 7: Up and Running: Rough Cuts Version http://post.oreilly.com/rd/9z1zav00p42r28mvaurvsdj0el7bkgs4c86bsjcihdo Until next time-- Marsee Henon Forward this announcement - http://post.oreilly.com/f2f/9z1zqc16454lmpp46s0b0i6mev5h8ldh11c635b681g ================================================================ O'Reilly 1005 Gravenstein Highway North Sebastopol, CA 95472 800-998-9938 http://post.oreilly.com/rd/9z1zju7c1he9eqf0p8th4b6baa1tjgd00fm6nemjmdo Follow us on Twitter at http://post.oreilly.com/rd/9z1zr48jla1ao3to4582vdtcq47eea496pon0jv2udg You are receiving this email because you are a User Group contact with O'Reilly Media. If you would like to stop receiving these newsletters or announcements from O'Reilly, send an email to marsee at oreilly.com ================================================================ > > From chris.eade at gmail.com Tue Jul 21 16:10:37 2009 From: chris.eade at gmail.com (Chris Eade) Date: Wed, 22 Jul 2009 11:10:37 +1200 Subject: [Wellington-pm] Strange (for me) notation Message-ID: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> Hi, My name is Chris Eade - Long time listener, first time caller. Well, not so much the long time listener :) I am working as a developer on a suite of web applications written in Perl. Its basically maintaining legacy code, and there are always bits of code that make me stop and think: what the..?! However, this particular piece of code has me really stumped. It looks like this: use constant LATEST_D_ACROSS_PRODUCTS => 'P'; $ib->{reg}->{@{[LATEST_D_ACROSS_PRODUCTS]}} = $ed; $ib->{prodNo}->{@{[LATEST_D_ACROSS_PRODUCTS]}} .= "$product_no,"; The part I really don't get is the meaning of this: @{[LATEST_D_ACROSS_PRODUCTS]} I realise that LATEST_D_ACROSS_PRODUCTS becomes "P", but then I really don't understand: @{[P]} as a valid hash key. From the rest of the code, $ib->{reg} and $ib->{prodNo} are references to hashes that appear to just behave normally with strings as the has keys. Does anyone know what might be happening here? The line occurs within a loop that makes use of $_ rather than assigning a variable explicitly to each element of the loop, so I thought that might have something to do with it (like a form of @{$_} or something). Kind regards, Chris. From grant at mclean.net.nz Tue Jul 21 16:23:18 2009 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 22 Jul 2009 11:23:18 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> Message-ID: <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> Hi Chris! It's been so quiet here without you :-) On Wed, 2009-07-22 at 11:10 +1200, Chris Eade wrote: > ... this particular piece of code has me really stumped. It looks > like this: > > use constant LATEST_D_ACROSS_PRODUCTS => 'P'; > > $ib->{reg}->{@{[LATEST_D_ACROSS_PRODUCTS]}} = $ed; > $ib->{prodNo}->{@{[LATEST_D_ACROSS_PRODUCTS]}} .= "$product_no,"; The problem is if they just did ... $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS} = $ed; Then LATEST_D_ACROSS_PRODUCTS would be interpreted as the string 'LATEST_D_ACROSS_PRODUCTS'. > > The part I really don't get is the meaning of this: > > @{[LATEST_D_ACROSS_PRODUCTS]} Yeah that's pretty awful. Putting [ .. ] around the constant creates an arrayref, putting @{ .. } around that dereferences the array ref back to a list of all its values. Since a Perl constant is really a subroutine (that gets optimised away), alternative approaches are: $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS()} = $ed; or: $ib->{reg}->{&LATEST_D_ACROSS_PRODUCTS} = $ed; Cheers Grant From chris.eade at gmail.com Tue Jul 21 17:09:10 2009 From: chris.eade at gmail.com (Chris Eade) Date: Wed, 22 Jul 2009 12:09:10 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <2e5ff0050907211709i70729188mf1b588caed2692c5@mail.gmail.com> Awesome! Thanks for that - thats much clearer now. I will definitely be changing it, so any future unlucky punter doesn't encounter it too. Cheers, and I hope everything is going well - including the boat! I have made some progress, but not far enough to have reached water yet :) Chris. On Wed, Jul 22, 2009 at 11:23 AM, Grant McLean wrote: > Hi Chris! > > It's been so quiet here without you :-) > > On Wed, 2009-07-22 at 11:10 +1200, Chris Eade wrote: >> ... this particular piece of code has me really stumped. It looks >> like this: >> >> use constant LATEST_D_ACROSS_PRODUCTS => 'P'; >> >> $ib->{reg}->{@{[LATEST_D_ACROSS_PRODUCTS]}} = $ed; >> $ib->{prodNo}->{@{[LATEST_D_ACROSS_PRODUCTS]}} .= "$product_no,"; > > The problem is if they just did ... > > $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS} = $ed; > > Then LATEST_D_ACROSS_PRODUCTS would be interpreted as the string > 'LATEST_D_ACROSS_PRODUCTS'. > >> >> The part I really don't get is the meaning of this: >> >> @{[LATEST_D_ACROSS_PRODUCTS]} > > Yeah that's pretty awful. Putting [ .. ] around the constant creates an > arrayref, putting @{ .. } around that dereferences the array ref back to > a list of all its values. > > Since a Perl constant is really a subroutine (that gets optimised away), > alternative approaches are: > > $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS()} = $ed; > > or: > > $ib->{reg}->{&LATEST_D_ACROSS_PRODUCTS} = $ed; > > Cheers > Grant > > > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > From daniel at rimspace.net Tue Jul 21 17:19:55 2009 From: daniel at rimspace.net (Daniel Pittman) Date: Wed, 22 Jul 2009 10:19:55 +1000 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> (Chris Eade's message of "Wed, 22 Jul 2009 11:10:37 +1200") References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> Message-ID: <87zlax1sd0.fsf@rimspace.net> Chris Eade writes: > My name is Chris Eade - Long time listener, first time caller. Well, not so > much the long time listener :) > > I am working as a developer on a suite of web applications written in > Perl. Its basically maintaining legacy code, and there are always bits of > code that make me stop and think: what the..?! Grant has answered the question quite well, but a tool that might help y'all in future investigating this sort of thing: > However, this particular piece of code has me really stumped. It looks > like this: > > use constant LATEST_D_ACROSS_PRODUCTS => 'P'; > $ib->{reg}->{@{[LATEST_D_ACROSS_PRODUCTS]}} = $ed; I rewrote this bit into a Perl script as follows: use constant LATEST_D_ACROSS_PRODUCTS => 'P'; $ib->{reg}->{@{[LATEST_D_ACROSS_PRODUCTS]}} = $ed; $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS()} = $ed; $ib->{reg}->{&LATEST_D_ACROSS_PRODUCTS} = $ed; $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS} = $ed; Then, using B::Deparse, you can see the effect of the various presentations: ] perl -MO=Deparse example.pl sub LATEST_D_ACROSS_PRODUCTS () { 'P' } use constant ('LATEST_D_ACROSS_PRODUCTS', 'P'); $$ib{'reg'}{@{['P'];}} = $ed; $$ib{'reg'}{'P'} = $ed; $$ib{'reg'}{&LATEST_D_ACROSS_PRODUCTS} = $ed; $$ib{'reg'}{'LATEST_D_ACROSS_PRODUCTS'} = $ed; example.pl syntax OK That shows you what Perl is actually doing at each step along the way, and how it interprets the code. Oh, and which of the options is the fastest because it allows the optimizer to actually eliminate the function call. ;) Anyway, B::Deparse can eliminate some of the syntax fluff around statements and tell you what Perl actually /does/ rather than just what it looks like... Regards, Daniel -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From olly at survex.com Tue Jul 21 20:05:16 2009 From: olly at survex.com (Olly Betts) Date: Wed, 22 Jul 2009 04:05:16 +0100 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <87zlax1sd0.fsf@rimspace.net> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> Message-ID: <20090722030516.GO14223@survex.com> On Wed, Jul 22, 2009 at 10:19:55AM +1000, Daniel Pittman wrote: > ] perl -MO=Deparse example.pl > sub LATEST_D_ACROSS_PRODUCTS () { 'P' } > use constant ('LATEST_D_ACROSS_PRODUCTS', 'P'); > $$ib{'reg'}{@{['P'];}} = $ed; > $$ib{'reg'}{'P'} = $ed; > $$ib{'reg'}{&LATEST_D_ACROSS_PRODUCTS} = $ed; > $$ib{'reg'}{'LATEST_D_ACROSS_PRODUCTS'} = $ed; Neat, thanks for the tip. Note that this also works as intended, and the constant gets substituted: $ib->{reg}->{(LATEST_D_ACROSS_PRODUCTS)} = $ed; This seems clearer too (constants being subroutines feels like an implementation detail to me). Cheers, Olly From grant at mclean.net.nz Tue Jul 21 20:36:05 2009 From: grant at mclean.net.nz (Grant McLean) Date: Wed, 22 Jul 2009 15:36:05 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <20090722030516.GO14223@survex.com> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> Message-ID: <1248233765.25719.8.camel@putnam.wgtn.cat-it.co.nz> On Wed, 2009-07-22 at 04:05 +0100, Olly Betts wrote: > Note that this also works as intended, and the constant gets substituted: > > $ib->{reg}->{(LATEST_D_ACROSS_PRODUCTS)} = $ed; > > This seems clearer too (constants being subroutines feels like an > implementation detail to me). Agreed. Another option that you'll come across sometimes is the unary plus operator: $ib->{reg}->{+LATEST_D_ACROSS_PRODUCTS} = $ed; Cheers Grant From chris.eade at gmail.com Tue Jul 21 20:52:08 2009 From: chris.eade at gmail.com (Chris Eade) Date: Wed, 22 Jul 2009 15:52:08 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <20090722030516.GO14223@survex.com> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> Message-ID: <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> Thanks for the info everyone :-) On Wed, Jul 22, 2009 at 3:05 PM, Olly Betts wrote: > On Wed, Jul 22, 2009 at 10:19:55AM +1000, Daniel Pittman wrote: >> ] perl -MO=Deparse example.pl >> sub LATEST_D_ACROSS_PRODUCTS () { 'P' } >> use constant ('LATEST_D_ACROSS_PRODUCTS', 'P'); >> $$ib{'reg'}{@{['P'];}} = $ed; >> $$ib{'reg'}{'P'} = $ed; >> $$ib{'reg'}{&LATEST_D_ACROSS_PRODUCTS} = $ed; >> $$ib{'reg'}{'LATEST_D_ACROSS_PRODUCTS'} = $ed; > > Neat, thanks for the tip. > > Note that this also works as intended, and the constant gets substituted: > > $ib->{reg}->{(LATEST_D_ACROSS_PRODUCTS)} = $ed; > > This seems clearer too (constants being subroutines feels like an > implementation detail to me). > > Cheers, > Olly > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm > From sam at vilain.net Tue Jul 21 23:43:13 2009 From: sam at vilain.net (Sam Vilain) Date: Wed, 22 Jul 2009 18:43:13 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> Message-ID: <4A66B501.6090505@vilain.net> Chris Eade top-posted: > Thanks for the info everyone :-) > > On Wed, Jul 22, 2009 at 3:05 PM, Olly Betts wrote: > >> On Wed, Jul 22, 2009 at 10:19:55AM +1000, Daniel Pittman wrote: >> >>> ] perl -MO=Deparse example.pl >>> sub LATEST_D_ACROSS_PRODUCTS () { 'P' } >>> use constant ('LATEST_D_ACROSS_PRODUCTS', 'P'); >>> $$ib{'reg'}{@{['P'];}} = $ed; >>> $$ib{'reg'}{'P'} = $ed; >>> $$ib{'reg'}{&LATEST_D_ACROSS_PRODUCTS} = $ed; >>> $$ib{'reg'}{'LATEST_D_ACROSS_PRODUCTS'} = $ed; >>> >> Neat, thanks for the tip. >> >> Note that this also works as intended, and the constant gets substituted: >> >> $ib->{reg}->{(LATEST_D_ACROSS_PRODUCTS)} = $ed; >> >> This seems clearer too (constants being subroutines feels like an >> implementation detail to me). >> But surely you want to know another way, using scalar: $ib->{reg}{scalar LATEST_D_ACROSS_PRODUCTS} Sam. From srdjan at catalyst.net.nz Tue Jul 21 23:52:55 2009 From: srdjan at catalyst.net.nz (Srdjan) Date: Wed, 22 Jul 2009 16:52:55 +1000 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <4A66B501.6090505@vilain.net> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> <4A66B501.6090505@vilain.net> Message-ID: <4A66B747.2070608@catalyst.net.nz> > > But surely you want to know another way, using scalar: > $ib->{reg}{scalar LATEST_D_ACROSS_PRODUCTS} > That's cheating and obfuscated way of saying $ib->{reg}{ LATEST_D_ACROSS_PRODUCTS() } No points. From daniel at rimspace.net Wed Jul 22 00:19:19 2009 From: daniel at rimspace.net (Daniel Pittman) Date: Wed, 22 Jul 2009 17:19:19 +1000 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <4A66B747.2070608@catalyst.net.nz> (srdjan@catalyst.net.nz's message of "Wed, 22 Jul 2009 16:52:55 +1000") References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> <4A66B501.6090505@vilain.net> <4A66B747.2070608@catalyst.net.nz> Message-ID: <87y6qhw5fs.fsf@rimspace.net> Srdjan writes: >> But surely you want to know another way, using scalar: >> $ib->{reg}{scalar LATEST_D_ACROSS_PRODUCTS} > > That's cheating and obfuscated way of saying $ib->{reg}{ > LATEST_D_ACROSS_PRODUCTS() } No points. Actually, it involves 'scalar' as well, so passes an extra OP through the interpreter compared to the direct () call... Regards, Daniel I really doubt it makes a measurable difference, however. -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From kentfredric at gmail.com Wed Jul 22 03:00:01 2009 From: kentfredric at gmail.com (Kent Fredric) Date: Wed, 22 Jul 2009 22:00:01 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <8cd1ed20907220300h609b5bb8m429c38e7438c7dc5@mail.gmail.com> On Wed, Jul 22, 2009 at 11:23 AM, Grant McLean wrote: > Hi Chris! > > It's been so quiet here without you :-) > > On Wed, 2009-07-22 at 11:10 +1200, Chris Eade wrote: > > ... this particular piece of code has me really stumped. It looks > > like this: > > > > use constant LATEST_D_ACROSS_PRODUCTS => 'P'; > > > > $ib->{reg}->{@{[LATEST_D_ACROSS_PRODUCTS]}} = $ed; > > $ib->{prodNo}->{@{[LATEST_D_ACROSS_PRODUCTS]}} .= "$product_no,"; > > Yet Another Plausible Way To Do It use Readonly; Readonly my $LATEST_D_ACROSS_PRODUCTS => 'P'; $ib->{reg}->{$LATEST_D_ACROSS_PRODUCTS} = $ed; $ib->{prodNo}->{$LATEST_D_ACROSS_PRODUCTS} .= "$product_no,"; Biggest advantage of doing it this way is its less surprising. You don't get all the fun things involved with constant folding, but on the bright side, you don't get all the fun things involved with constant folding :) And Optimality, meh, worry about that when your code is demonstratively too slow :) Kent perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) for ( 9,8,0,7,1,6,5,4,3,2 ); -------------- next part -------------- An HTML attachment was scrubbed... URL: From olly at survex.com Wed Jul 22 04:12:35 2009 From: olly at survex.com (Olly Betts) Date: Wed, 22 Jul 2009 12:12:35 +0100 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <87y6qhw5fs.fsf@rimspace.net> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> <4A66B501.6090505@vilain.net> <4A66B747.2070608@catalyst.net.nz> <87y6qhw5fs.fsf@rimspace.net> Message-ID: <20090722111235.GR14223@survex.com> Some repetitive approaches (but only in the source - these all optimise to just the constant): $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS||LATEST_D_ACROSS_PRODUCTS} = $ed; $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS&&LATEST_D_ACROSS_PRODUCTS} = $ed; And my favourite (what I tell you three times must be true): $ib->{reg}->{LATEST_D_ACROSS_PRODUCTS?LATEST_D_ACROSS_PRODUCTS:LATEST_D_ACROSS_PRODUCTS} = $ed; Cheers, Olly From lrw at clear.net.nz Wed Jul 22 16:26:43 2009 From: lrw at clear.net.nz (Lesley Longhurst) Date: Thu, 23 Jul 2009 11:26:43 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <8cd1ed20907220300h609b5bb8m429c38e7438c7dc5@mail.gmail.com> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> <8cd1ed20907220300h609b5bb8m429c38e7438c7dc5@mail.gmail.com> Message-ID: <4A67A033.4090501@clear.net.nz> Kent Fredric wrote: > perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, > 3 ) for ( 9,8,0,7,1,6,5,4,3,2 ); Since we're in the mood for picking nits, you're missing a closing quote. :-) -- Lesley Longhurst (previously Walker) Linux Systems Administrator Opus International Consultants Ltd Tel +64 4 471 7002, Fax +64 4 473 3017 From kentfredric at gmail.com Wed Jul 22 18:00:35 2009 From: kentfredric at gmail.com (Kent Fredric) Date: Thu, 23 Jul 2009 13:00:35 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <4A67A033.4090501@clear.net.nz> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <1248218598.25719.6.camel@putnam.wgtn.cat-it.co.nz> <8cd1ed20907220300h609b5bb8m429c38e7438c7dc5@mail.gmail.com> <4A67A033.4090501@clear.net.nz> Message-ID: <8cd1ed20907221800p1cc3aa2dmf666fe0383e131f7@mail.gmail.com> On Thu, Jul 23, 2009 at 11:26 AM, Lesley Longhurst wrote: > Kent Fredric wrote: > >> perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) >> for ( 9,8,0,7,1,6,5,4,3,2 ); >> > > Since we're in the mood for picking nits, you're missing a closing quote. > :-) > > Shall I claim that's intentional to thwart bots trying to parse/execute it :) ? . Bots haven't learnt to fix bugs yet, its the only guarantee-able CAPTCHA :) -- Kent perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );" -------------- next part -------------- An HTML attachment was scrubbed... URL: From jarich at perltraining.com.au Wed Jul 22 20:49:37 2009 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 22 Jul 2009 20:49:37 -0700 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <4A66B501.6090505@vilain.net> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> <4A66B501.6090505@vilain.net> Message-ID: <4A67DDD1.1050806@perltraining.com.au> Sam Vilain wrote: > But surely you want to know another way, using scalar: > $ib->{reg}{scalar LATEST_D_ACROSS_PRODUCTS} You might also see: $ib->{reg}{ LATEST_D_ACROSS_PRODUCTS . "" } but I think the @{[ ... ]} is cute, but terrible. This is the same trick required for __PACKAGE__ and similar. J From daniel at rimspace.net Wed Jul 22 21:02:05 2009 From: daniel at rimspace.net (Daniel Pittman) Date: Thu, 23 Jul 2009 14:02:05 +1000 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <4A67DDD1.1050806@perltraining.com.au> (Jacinta Richardson's message of "Wed, 22 Jul 2009 20:49:37 -0700") References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> <4A66B501.6090505@vilain.net> <4A67DDD1.1050806@perltraining.com.au> Message-ID: <87my6w82te.fsf@rimspace.net> Jacinta Richardson writes: > Sam Vilain wrote: > >> But surely you want to know another way, using scalar: >> $ib->{reg}{scalar LATEST_D_ACROSS_PRODUCTS} > > You might also see: > > $ib->{reg}{ LATEST_D_ACROSS_PRODUCTS . "" } > > but I think the @{[ ... ]} is cute, but terrible. This is the same trick > required for __PACKAGE__ and similar. *nod* Speaking of cute, but terrible, tricks, I am still fond of the "interpolate live Perl code in a format string" trick: perl -e 'print "${\(time)}\n"' Regards, Daniel system("rm -rf /") is much meaner. -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From kentfredric at gmail.com Wed Jul 22 21:08:51 2009 From: kentfredric at gmail.com (Kent Fredric) Date: Thu, 23 Jul 2009 16:08:51 +1200 Subject: [Wellington-pm] Strange (for me) notation In-Reply-To: <4A67DDD1.1050806@perltraining.com.au> References: <2e5ff0050907211610y17a7967bna90cb4f8d9a16747@mail.gmail.com> <87zlax1sd0.fsf@rimspace.net> <20090722030516.GO14223@survex.com> <2e5ff0050907212052o56afc730s527a947416539163@mail.gmail.com> <4A66B501.6090505@vilain.net> <4A67DDD1.1050806@perltraining.com.au> Message-ID: <8cd1ed20907222108v3efbe56cu423ed0359ae9198d@mail.gmail.com> On Thu, Jul 23, 2009 at 3:49 PM, Jacinta Richardson < jarich at perltraining.com.au> wrote: > Sam Vilain wrote: > > But surely you want to know another way, using scalar: >> $ib->{reg}{scalar LATEST_D_ACROSS_PRODUCTS} >> > > You might also see: > > $ib->{reg}{ LATEST_D_ACROSS_PRODUCTS . "" } > > but I think the @{[ ... ]} is cute, but terrible. This is the same trick > required for __PACKAGE__ and similar. > Of course, you don't want to be using that in the event LATEST_D_WHATEVER is in fact an array-returning constant doing parallel hash assignment :) #!/usr/bin/perl use strict; use warnings; use Moose::Autobox; local $Data::Dumper::Indent = $Data::Dumper::Indent = 0; local $Data::Dumper::Terse = $Data::Dumper::Terse = 1; sub FOO() { 'bar', 'baz'; } my %hash; @hash{ (FOO) } = ( 1, 2 ); %hash->dump->say; # {'bar' => 1,'baz' => 2} @hash{ FOO() } = ( 3, 4 ); %hash->dump->say; # {'bar' => 3,'baz' => 4} @hash{FOO} = ( 5 ); # Scalar value @hash{FOO} better written as $hash{FOO} at /tmp/ex.pl line 24. %hash->dump->say; # {'bar' => 3,'baz' => 4,'FOO' => 5} @hash{FOO . "" } = ( 6 ); %hash->dump->say; # {'bar' => 3,'baz' => 6,'FOO' => 5} @hash{FOO . "" } = ( 7, 8 ); %hash->dump->say; # {'bar' => 3,'baz' => 7,'FOO' => 5} -- Kent perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );" http://kent-fredric.fox.geek.nz -------------- next part -------------- An HTML attachment was scrubbed... URL: From lrw at clear.net.nz Thu Jul 23 16:06:24 2009 From: lrw at clear.net.nz (Lesley Longhurst) Date: Fri, 24 Jul 2009 11:06:24 +1200 Subject: [Wellington-pm] A "Mordac" gem Message-ID: <4A68ECF0.4030901@clear.net.nz> Mordac, the preventer of information services, left this little gem behind when he left the company. I thought I would share this clever piece of code with you all: sub error { } -- Lesley From grant at mclean.net.nz Thu Jul 23 16:26:41 2009 From: grant at mclean.net.nz (Grant McLean) Date: Fri, 24 Jul 2009 11:26:41 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A68ECF0.4030901@clear.net.nz> References: <4A68ECF0.4030901@clear.net.nz> Message-ID: <1248391601.21535.30.camel@putnam.wgtn.cat-it.co.nz> On Fri, 2009-07-24 at 11:06 +1200, Lesley Longhurst wrote: > Mordac, the preventer of information services, left this little gem > behind when he left the company. I thought I would share this clever > piece of code with you all: > > sub error { > } It's OK I can't imagine that routine would ever get called anyway :-) Grant From douglas at paradise.net.nz Thu Jul 23 17:01:29 2009 From: douglas at paradise.net.nz (Douglas Bagnall) Date: Fri, 24 Jul 2009 12:01:29 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <1248391601.21535.30.camel@putnam.wgtn.cat-it.co.nz> References: <4A68ECF0.4030901@clear.net.nz> <1248391601.21535.30.camel@putnam.wgtn.cat-it.co.nz> Message-ID: <4A68F9D9.8090208@paradise.net.nz> Lesley/Mordac wrote: > sub error { > } Following the previous discussion, my understanding is that this would be best rewritten: use constant error => undef; so the error could be optimised away (if you used the right syntax). Douglas From JDAfu2aDM4VF5 at perform.nospymail.com Thu Jul 23 19:08:03 2009 From: JDAfu2aDM4VF5 at perform.nospymail.com (VPeuWzSme3ZPzsXHjF2wHz) Date: Thu, 23 Jul 2009 22:08:03 -0400 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A68F9D9.8090208@paradise.net.nz> References: <4A68ECF0.4030901@clear.net.nz> <1248391601.21535.30.camel@putnam.wgtn.cat-it.co.nz> <4A68F9D9.8090208@paradise.net.nz> Message-ID: What's the importance of that, when what I'm running appears not dissimilar: sub compute_other { my $data_file = shift; if ( ! -f "$data_dir/$data_file" ) { print "Cannot find data file $data_file in $data_dir\n"; return ( undef, undef, undef ); } On 7/23/2009 8:01 PM, Douglas Bagnall wrote: > Lesley/Mordac wrote: > > >> sub error { >> } >> > > > Following the previous discussion, my understanding is that this would > be best rewritten: > > use constant error => undef; > > so the error could be optimised away (if you used the right syntax). > > Douglas > _______________________________________________ > Wellington-pm mailing list > Wellington-pm at pm.org > http://mail.pm.org/mailman/listinfo/wellington-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From lrw at clear.net.nz Thu Jul 23 19:15:25 2009 From: lrw at clear.net.nz (Lesley Longhurst) Date: Fri, 24 Jul 2009 14:15:25 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A68F9D9.8090208@paradise.net.nz> References: <4A68ECF0.4030901@clear.net.nz> <1248391601.21535.30.camel@putnam.wgtn.cat-it.co.nz> <4A68F9D9.8090208@paradise.net.nz> Message-ID: <4A69193D.9030502@clear.net.nz> Douglas Bagnall wrote: > Following the previous discussion, my understanding is that this would > be best rewritten: > > use constant error => undef; > > so the error could be optimised away (if you used the right syntax). > /me falls over laughing Mordac was good at optimising his errors away. From kentfredric at gmail.com Fri Jul 24 04:46:29 2009 From: kentfredric at gmail.com (Kent Fredric) Date: Fri, 24 Jul 2009 23:46:29 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A68F9D9.8090208@paradise.net.nz> References: <4A68ECF0.4030901@clear.net.nz> <1248391601.21535.30.camel@putnam.wgtn.cat-it.co.nz> <4A68F9D9.8090208@paradise.net.nz> Message-ID: <8cd1ed20907240446o9811c17l2c20979a57e71fee@mail.gmail.com> On Fri, Jul 24, 2009 at 12:01 PM, Douglas Bagnall wrote: > Lesley/Mordac wrote: > > > sub error { > > } > > > Following the previous discussion, my understanding is that this would > be best rewritten: > > use constant error => undef; > > so the error could be optimised away (if you used the right syntax). > > or you could have just added '()' to the original sub declaration and achieved the same benefit, as well as keeping the pesky code in a place you don't have to look at it =D -- Kent perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );" -------------- next part -------------- An HTML attachment was scrubbed... URL: From enkidu at cliffp.com Fri Jul 24 15:27:20 2009 From: enkidu at cliffp.com (Cliff Pratt) Date: Sat, 25 Jul 2009 10:27:20 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A68ECF0.4030901@clear.net.nz> References: <4A68ECF0.4030901@clear.net.nz> Message-ID: <4A6A3548.8010406@cliffp.com> Lesley Longhurst wrote: > Mordac, the preventer of information services, left this little gem > behind when he left the company. I thought I would share this clever > piece of code with you all: > > sub error { > } > Am I missing something? Is this something more than a placeholder than never got revisited, albeit with an amusing name? Cheers, Cliff From lrw at clear.net.nz Sun Jul 26 15:25:22 2009 From: lrw at clear.net.nz (Lesley Longhurst) Date: Mon, 27 Jul 2009 10:25:22 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A6A3548.8010406@cliffp.com> References: <4A68ECF0.4030901@clear.net.nz> <4A6A3548.8010406@cliffp.com> Message-ID: <4A6CD7D2.5080400@clear.net.nz> Cliff Pratt wrote: > Lesley Longhurst wrote: >> Mordac, the preventer of information services, left this little gem >> behind when he left the company. I thought I would share this clever >> piece of code with you all: >> >> sub error { >> } >> > Am I missing something? Is this something more than a placeholder than > never got revisited, albeit with an amusing name? I probably should have mentioned that it's in production code, in an application that's meant to be pretty robust but resembles a vat of spaghetti. From matt at catalyst.net.nz Sun Jul 26 15:39:36 2009 From: matt at catalyst.net.nz (Matthew Hunt) Date: Mon, 27 Jul 2009 10:39:36 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A6CD7D2.5080400@clear.net.nz> References: <4A68ECF0.4030901@clear.net.nz> <4A6A3548.8010406@cliffp.com> <4A6CD7D2.5080400@clear.net.nz> Message-ID: <4A6CDB28.2000309@catalyst.net.nz> Lesley Longhurst wrote: > Cliff Pratt wrote: >> Lesley Longhurst wrote: >>> Mordac, the preventer of information services, left this little gem >>> behind when he left the company. I thought I would share this clever >>> piece of code with you all: >>> >>> sub error { >>> } >>> >> Am I missing something? Is this something more than a placeholder than >> never got revisited, albeit with an amusing name? > > I probably should have mentioned that it's in production code, in an > application that's meant to be pretty robust but resembles a vat of > spaghetti. Surely the solution to that is to: use Acme::MetaSyntactic::pasta; :) Matt. From enkidu at cliffp.com Mon Jul 27 00:04:05 2009 From: enkidu at cliffp.com (Cliff Pratt) Date: Mon, 27 Jul 2009 19:04:05 +1200 Subject: [Wellington-pm] A "Mordac" gem In-Reply-To: <4A6CD7D2.5080400@clear.net.nz> References: <4A68ECF0.4030901@clear.net.nz> <4A6A3548.8010406@cliffp.com> <4A6CD7D2.5080400@clear.net.nz> Message-ID: <4A6D5165.3070508@cliffp.com> Lesley Longhurst wrote: > Cliff Pratt wrote: >> Lesley Longhurst wrote: >>> Mordac, the preventer of information services, left this little gem >>> behind when he left the company. I thought I would share this clever >>> piece of code with you all: >>> >>> sub error { >>> } >>> >> Am I missing something? Is this something more than a placeholder than >> never got revisited, albeit with an amusing name? > > I probably should have mentioned that it's in production code, in an > application that's meant to be pretty robust but resembles a vat of > spaghetti. > OIC, well I refer you to this programming reference : http://bible.cc/john/8-7.htm Cheers, Cliff From grant at mclean.net.nz Thu Jul 30 19:08:18 2009 From: grant at mclean.net.nz (Grant McLean) Date: Fri, 31 Jul 2009 14:08:18 +1200 Subject: [Wellington-pm] Next meeting: August 11th Message-ID: <1249006098.23922.13.camel@putnam.wgtn.cat-it.co.nz> Hi Mongers The next meeting of Wellington Perl Mongers will be on August 11th (which is the Tuesday after next). Usual time and place: 6:00pm Tuesday 11 August 2009 Level 3, Catalyst House 150 Willis Street Wellington (map: http://xrl.us/map2catalyst ) At this stage we have three talks lined up: * Douglas Bagnall - Confessions of a detwikifier * Sam Vilain - Oribtal control with Perl and XS * Martyn Smith - Keeping time with Perl There may be room for another 5-10 minute talk - contact me if you're keen. Cheers Grant