metacpan
What has happened to: http://search.metacpan.org/ ?
Re: CGI::Application and recent bash security hole
On 26/09/14 10:24, Dave Cross wrote: env X=() { (a)=\\ bash -c '/dev/stdout date' But not this: env X=() { (a)=\\ bash -c 'date' bash: X: line 1: syntax error near unexpected token `=' bash: X: line 1: `' bash: error importing function definition for `X' Fri Sep 26 14:11:23 BST 2014
Re: Regex to match odd numbers
On 27/05/14 16:22, David Cantrell wrote: As part of the nasty mess that is CPANdeps, I have this line of code: $record-{is_dev_perl} = ( $record-{perl} =~ /(^5\.(7|9|11|13|15|17|19|21)|rc|patch)/i ) ? 1 : 0; I'd like to not have to remember to add 23 to the list in a year or so's time. Can anyone think of a nice way of matching any odd number from 7 upwards? Obviously it's easy to do in a coupla lines of perl code instead of a regex, so I'm asking more out of curiosity than because I actually need it. $bool = ($record-{perl} 7) 1; # for example?
Re: Regex to match odd numbers
On 27/05/14 17:21, Abigail wrote: On Tue, May 27, 2014 at 04:54:47PM +0100, Dirk Koopman wrote: On 27/05/14 16:22, David Cantrell wrote: As part of the nasty mess that is CPANdeps, I have this line of code: $record-{is_dev_perl} = ( $record-{perl} =~ /(^5\.(7|9|11|13|15|17|19|21)|rc|patch)/i ) ? 1 : 0; I'd like to not have to remember to add 23 to the list in a year or so's time. Can anyone think of a nice way of matching any odd number from 7 upwards? Obviously it's easy to do in a coupla lines of perl code instead of a regex, so I'm asking more out of curiosity than because I actually need it. $bool = ($record-{perl} 7) 1; # for example? $ perl -wE 'say +(8 7) 1' 1 $ It would be very odd to consider 8 to be odd. Indeed, hence my follow up. But this works: perl -e 'for (0..30) {print ((($_ 7) ($_ 1)) ? $_ = 1\n : $_ = 0\n)}'; Dirk
Re: Finding the intersection between two regexes
On 21/04/14 03:14, Mark Fowler wrote: On Sunday, April 20, 2014, David Cantrell da...@cantrell.org.uk wrote: Can anyone point me at some code on the CPAN that, given two regexes, can figure out whether there are any bits of text that will be matched by both? I'm not sure I understand the question here, or moreover why you want to do this..is it just an intellectual exercise? If it's just a matter of wanting a single Perl regular expression that can match something iff both of these other regular expressions would match, surely you can just do this by inserting the second regular expression at the beginning of the first encapsulated in a zero-width positive look ahead assertion (with suitable variable length doodads to pad if they're not anchoring at the same place in the string.) What the link is talking about seems to be converting a regular expression down into a finate state machine and then combining that finate state machine with another finate state machine (I.e. non deterministic, being turned back into deterministic with maths). I can see how that's possible for a strict regular expression, but as you say, not for a true Perl non-regular regular expression. So...why do you want to do this? This may be related to the question I asked recently about turning (up to) a few hundred REGEXes into one giant REGEX. The goal being to test all those disparate REGEXes in the most efficient way possible on a string. Dirk
Re: Finding the intersection between two regexes
On 21/04/14 10:03, James Laver wrote: On 21 Apr 2014, at 09:45, Dirk Koopman d...@tobit.co.uk wrote: This may be related to the question I asked recently about turning (up to) a few hundred REGEXes into one giant REGEX. The goal being to test all those disparate REGEXes in the most efficient way possible on a string. Sounds like an implementation detail. Yes, it is *the* implementation detail if one is writing a message switch whose primary purpose is to route messages based on said lists of regexes. It's bad enough having just the one list of regexes on the one key, but when there are hierarchical lists dealing with tuples of the type (data, key1, key2, [...]), that detail really, really matters. Oh and then there is the possible random ordering of the keys and one may need regexes to choose which list of regexes to use. Dirk
Re: Web scraping frameworks?
On 04/03/14 21:44, Dave Cross wrote: On 04/03/14 21:33, DAVID HODGKINSON wrote: Does something exist? If it doesn't does anyone want to help make it happen? I *really* don't want to have to write the code all over again ten times... Something like Web::Scraper, perhaps? https://metacpan.org/pod/Web::Scraper Or https://metacpan.org/pod/Mojo::DOM Dirk
Re: Web scraping frameworks?
On 04/03/14 22:05, Dirk Koopman wrote: On 04/03/14 21:44, Dave Cross wrote: On 04/03/14 21:33, DAVID HODGKINSON wrote: Does something exist? If it doesn't does anyone want to help make it happen? I *really* don't want to have to write the code all over again ten times... Something like Web::Scraper, perhaps? https://metacpan.org/pod/Web::Scraper Or https://metacpan.org/pod/Mojo::DOM I should have added https://metacpan.org/pod/Mojolicious::Guides::Cookbook#USER-AGENT
Re: Best practices for database migrations
On 18/11/13 10:03, Abigail wrote: I would mistrust any solution offered by someone who doesn't know the details of your environment/requirements -- and hence, I'm not going to offer solution. Second and thirded. Abigail [1] .. [10] Been there, done that, did not get a T-shirt. Why is the *never* a T-shirt? And if it goes wrong (or even just slightly awry) why is there *always* a brickbat.
Re: Database Design Advice
On 08/11/13 11:43, Smylers wrote: • Have separate euro_discount and percentage_discount tables, then when a discount applies create a record in the appropriate table. This avoids any NULLs in the DB (something I've seen advocated as good database design), but it still requires ensuring that both discount types don't get used at once. It also makes answering the question ‘is there any discount?’ more work, and something which will get worse if the business concocts another discount type in future. It all depends on the application and your view as to where the business might go in the future. A case that I had to deal with many years ago was related to the building trade and their suppliers (Lloyds Insurance Broking would also qualify [in a less complex way, and for other things]). In essence suppliers would supply using discount rate cards which would state that for products of discount band a1-z9 (to give a rough scale of number of bands) would have chain discounts on book price of the form +135% [...] -30% -10% [...] and customers might offered anything from cost + 5% (say on a lorry load organised by phone) - 5% off list price (all retail customers [everyone likes a discount]), via -30% trade -10% (for plumbing) -5% ('cos you're a good customer). And then there would be fixed amounts off individual items (say in sales) as well as normalising units of measure (timber is easier now, but in those days there were about 6 units of measure - depending on where the timber came from. Now there are only about 3 with m3 being predominant). What I am trying to say is: do something that doesn't back you into a corner that you hadn't anticipated. Oh and normalising tables an all in databases is all very fine and gives one interlecktuwal warm feelings, but it doesn't necessarily give the *business* an optimal result.
Re: Tourist-y suggestions?
On 03/11/13 20:43, Randy J. Ray wrote: On 11/3/13 8:34 PM, Joel Bernstein wrote: All those amazing arty suggestions and you went to the armpit of the home counties, AKA Milton bloody Keynes to look at old electronics? SIGH! I'm kidding - glad you found something fun for you. Heh... as I told one of the volunteers at TNMOC, when I tell my friends where I went first on my holiday, those I work with will get it, those that aren't in our industry will look at me like I'm crazy :-). Besides, man... real bloody Enigma machines! That appeals to both the hacker in me *and* the military historian. That's double points! If you are still here next weekend, try the Kew Steam Museum http://www.kbsm.org/ for a different take on engineering... Today would have been a good day as they were steaming. Dirk
ORMs du jour?
Any recommendations for an ORM? I am looking for something simple rather than lots of bells and whistles.
Re: ORMs du jour?
On 21/10/13 14:42, Joel Bernstein wrote: DBIx::Class. On 21 October 2013 15:37, Dirk Koopman d...@tobit.co.uk wrote: Any recommendations for an ORM? I am looking for something simple rather than lots of bells and whistles. That does seem like the default choice. I should perhaps have added that I need to query an ingres database rather closely. I have successfully used DBI for this in the past, but the time has now come to do something (considerably) more complex.
Re: ORMs du jour?
On 21/10/13 15:33, Abigail wrote: On Mon, Oct 21, 2013 at 02:37:52PM +0100, Dirk Koopman wrote: Any recommendations for an ORM? I am looking for something simple rather than lots of bells and whistles. My recommendation for ORMs: don't. http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx and also On 21/10/13 15:31, Jason Clifford wrote: On 2013-10-21 14:37, Dirk Koopman wrote: What is your requirement - ie the use case? Traditionally what I have done is abstracted all the SQL queries that I want to use into a class (read: package) and call those methods usually as functions (returning arrays of data). The reason for this is that my programs' SQL queries cover a database's contents very sparsely but specifically and, compared to the size of said database, in a very limited way. An ORM would not have gained me a huge amount of time or enough other goodness to make it worth the effort learning that ORM's foibles. I now find myself needing to provide something that could, in the limit, replicate some C programs that are able create arbitrarily complex reports, that will be punted into a Mojo webserver for onward service to a punter. The punters in question will not be using SQL :-). The SQL required will cover a much larger range of the tables (as well as quantities of data) in the database, even for the first cut which will simply webify some existing excel reports. But the webification only amounts to providing that data in JSON and punting it down a websocket. (Oh and the original screen of course, but that is out of scope for this discussion). It has to be said that my instinct would be with Abigail. But the very fact that I am asking the question means that I recognise that some OOish view of this database might be useful. Obviously, if this system that I am starting now ends up where I think it will, I could simply generate SQL queries on the fly and hide them in some real (generated) classes and carry on like that. It is very likely that this, in the first instance, also a reasonable possibility. The decision could turn either way at the moment. Dirk
Re: ORMs du jour?
On 21/10/13 16:54, Joel Bernstein wrote: I suspect you should be looking at DBIx::Class, and something like https://metacpan.org/module/Catalyst::Controller::DBIC::API Many of your assumptions seem invalid. I'm not sure what foibles you expect, but generating SQL queries on the fly is exactly what DBIC does, with the benefit of those query abstractions being orthogonal, composable, testable etc. Catalyst is not an option. Sorry. All software has foibles, as well as a learning curve. Even mine.
Re: ORMs du jour?
On 21/10/13 17:27, Jérôme Étévé wrote: DBIx::Class is great if you: - Generate it automatically from your _well designed (haha)_ DB with DBIx::Class::Schema::Loader Noted. And I laughed so much. Well designed? It is, at least (over) mature and not likely to change enough to be a particular problem. - Don't try to extend it too much. It _can_ become very messy. Not likely to do that. I tend to wrap, rather than extend, modules that I take from CPAN. That way I stand a chance to remain in some form of control when (data) structure changes under my feet. - Wrap your business model _around_ it. (like in https://github.com/jeteve/jcom/blob/master/JCOM-BM/lib/JCOM/BM/DBICWrapper.pm ). I will look at that.
Re: Could use some hotel/travel help
On 26/09/13 10:42, Alan Mosca wrote: I've got one word for you : Priceline. Er.. http://booking.com (well known supporters of all things perl)?
Re: Robot turtles
On 23/09/13 16:18, Joel Bernstein wrote: When am I ever not? On 23 September 2013 15:47, Matt Freake matthew.d.fre...@gmail.com wrote: I'm not aware of any 3-8 year olds in this group, am I missing the point? Are you trolling again? Well, now look what you've done. I hope you're satisfied.
Re: Assigning Classes
On 09/09/13 15:10, Raphael Mankin wrote: This is a classic variation of the transportation problem. If you can assign (different) costs to being in the wrong class and zero cost to being in the right class then the Hungarian Algorithm will do the job. The standard version of the algorithm has quartic time complexity, but there is a version due to Wright(?) at Lancaster University that is quadratic. Both versions have quadratic space complexity. I programmed it about 20 years ago but I cannot now give you any references. Search the literature. It also has similarities to rate minimisation problems in chemistry where one has several (say) gases, some energy, reactions happen and one has (essentially) guess what is likely to come out. Or alternatively: given what comes out and the starting proportions, how did it get there. The NAG libraries have a raft of numercial algorithms for solving these sorts of problems - I always found the ones that used (cough) Monte Carlo Methods gave what seemed like the best answers and in (by far) the quickest time. I believe that after 30 odd years in the wilderness this type of algorithm is coming back into fashion as is worth a long. Dirk
Re: Which modules do you allow yourself to use for production?
On 23/07/13 11:03, Abigail wrote: On Mon, Jul 22, 2013 at 09:39:33PM +0100, Dirk Koopman wrote: While I reckon prototyping is useful, you should be aware that when dealing with people that have Pound note watermarks etched on their glasses, prototypes have a habit of becoming (the rump of) production code. This, IMO, is usually a recipe for failure and if not that, then significant engineering cost later on. Which is not to say that your partner is such a person. I think that's short sighted, and IMO, you're making a classical mistake. Doing extra work now in order to save costs later is a luxury problem. Your first worry should go to actually being alive later on. When you're starting up, your resources are limited, the work that needs to be done ASAP is huge, and your income is nil. I sometimes express myself too forcefully. I am trying to suggest that there is a balance to be struck. Further more, I believe that a successful developer does this (after a while :-) automatically. I have personally been in situations where I have had to come in to productionise prototypes that had become the product but demand overwhelmed that solution. If I had not been successful, then the business(es) would have failed. A prototype is just that. It is a tool for thinking, it may become something that someone can sell, but that is just a useful asset. Dirk
Re: Which modules do you allow yourself to use for production?
On 23/07/13 13:22, Abigail wrote: On Tue, Jul 23, 2013 at 12:43:05PM +0100, Dirk Koopman wrote: On 23/07/13 11:03, Abigail wrote: I sometimes express myself too forcefully. I am trying to suggest that there is a balance to be struck. Further more, I believe that a successful developer does this (after a while :-) automatically. Then there aren't many succesful developers I've found it very hard to convince people that thou shalt not create technical debt shouldn't be taken as a dogma. I've given talks at various (Perl) conferences where three quarters of the audience would have thrown rotten tomatoes at me if they had some. In my experience, most developers don't have much of a business sense, and instead of acknowledging that, they look down upon people whose specialty it is. In my experience, people that look down on business are biting the hand that will feed them and their families. But you are right, in that there aren't many of this sort of programmer about. But business people also have a part to play here: they should understand that it *may* take more time to do something worthwhile and not _forever_ focus on the quick win and worry about the consequences later. It took me (and others) time and effort to train Olivetti salesmen not to say yes to everything automatically without thought (it was a long time ago - the 1970s). But then having got there, they were superb at selling the stuff we did have and then getting sufficient margin to do any extra development. Mind you, one wonderful technique they had was inflating the price to 15+% over list/estimate and allowing themselves to be beaten down to 5-7% over :-). Cooperation is truly what one needs in *any* successful business, not just a startup. A good business/sales operation and a development operation that works together as a team. Mutual respect and acknowledgement of each group's strengths gives a business something greater than the sum of its parts. Could be one definition of profit? Dirk
Re: Which modules do you allow yourself to use for production?
On 22/07/13 19:45, Pierre M wrote: As i was asking for advice in a previous email, Dirk Koopman wrote: Use the lowest impact perl from the beginning (that probably means avoiding Moose, Catapole et al). I understand that this means: avoid modules with lots of dependencies. Is that right? I thought Moose only slowed things down at compile time, am i wrong? What is the negative impact of using it for a web-app? There is a significant difference between Moo and Moose. The same is true for other choices between modules that you might make. And yes, I would advise against producing production code that has lots of external (CPAN) dependencies, especially if the normal path through those modules touches most of them. There are numerous (horror) stories of what can happen when one wants to update something, say a perl or a major CPAN component with many dependencies. While I reckon prototyping is useful, you should be aware that when dealing with people that have Pound note watermarks etched on their glasses, prototypes have a habit of becoming (the rump of) production code. This, IMO, is usually a recipe for failure and if not that, then significant engineering cost later on. Which is not to say that your partner is such a person. The choices you make now will colour your development for several years, unless you (intend to, from the start) throw that codebase away and start again. A plan that you might like something in writing about in your agreement/design goal document. The trick with this software writing lark is to get the balance right from as near the start as possible. But don't agonise for a long time over all this, get on with writing it :-) Dirk
Re: Almost on-topic
On 12/07/13 17:15, David Cantrell wrote: On 12/07/2013 10:58, Denny wrote: http://www.youtube.com/watch?v=oAMSrKqpl_c I wonder why you can't just anaesthetize it and put it on the scales with a forklift. Have you *any* idea how much that costs? It's bad enough with a horse, but one of those camels weighs 25% more.
Re: OT: Cheapo vps hosting
On 04/07/13 11:24, Stanislaw Pusep wrote: There's a free VPN server hosted in UK: http://www.vpnbook.com/ Quite responsive; sponsored by NSA, maybe?! More likely by one of their local agents
Mailing List Spam
I run a few mailing lists which have seasonal or sporadic usage. A side effect of running these things is that the lists collect spam which ends up in my list administrator's mailbox. All very normal and boring. But I am starting to notice a pattern which seems to suggest that when a list is quiet (such a hockey club's list during the summer months when there is nearly no traffic) - there is nearly no spam. As traffic builds up, the level of attempted spam increases. Is it just me? Is it a coincidence? Has anyone else noticed something similar? Dirk
New pet keeping rules in the Netherlands
It appears that my esteemed government has changed the rules about about which pets one might keep at home. Apart from all the usual suspects, it appears one may keep a water buffalo but, crucially, one will *not* be able to keep a camel. Apparently, camels are dirty, disease ridden animals but water buffaloes (by definition) must be clean and (contagious) disease free. Given the respective O'Reilly colophons (MSCE Core Elective Exams in a Nutshell and er.. the Camel Book) what does this all mean? Dirk
Re: New pet keeping rules in the Netherlands
On 19/06/13 20:55, Paul Makepeace wrote: Wow, and I thought Oakland (California) was permissive allowing us, in a large (~1M pop.) city, to keep cows and horses. You need an acre minimum for a horse, but so long as you can demonstrate adequate manure processing capacity, cows are a go. Where is this fabulous discussion happening? Is there any urban precedent for water buffalo, or camels, in .NL? An URL in English: http://www.dutchnews.nl/news/archives/2013/06/new_official_rules_you_can_kee.php Paul On Wed, Jun 19, 2013 at 12:15 PM, Dirk Koopman d...@tobit.co.uk wrote: It appears that my esteemed government has changed the rules about about which pets one might keep at home. Apart from all the usual suspects, it appears one may keep a water buffalo but, crucially, one will *not* be able to keep a camel. Apparently, camels are dirty, disease ridden animals but water buffaloes (by definition) must be clean and (contagious) disease free. Given the respective O'Reilly colophons (MSCE Core Elective Exams in a Nutshell and er.. the Camel Book) what does this all mean? Dirk
Re: Scope of variables in a function
On 01/06/13 18:03, Hakim Cassimally wrote: Andy, I believe your problem is: my $x = 'FOO' if $condition; This only declares the new variable if $condition, so it ends up having surprising, static-like behaviour, which you probably shouldn't rely on. Rewriting to: my $result; $result = 'FOO' if ... gives your expected result. It is very annoying. The more so because this is an artefact that is (apparently) relied on by a lot of legacy code. Quite a lot of other perl artefacts have been deprecated and then removed. Why does this one persist? In what way is it useful or intuitive?
Re: Quarantining crap HTML?
On 22/05/13 16:29, DAVID HODGKINSON wrote: Upon sleeping on it, this was the direction I was headed in. The problem is the HTML is user-generated and we know where that leads. Carefully constructed, efficient and well tested code?
Re: Alternative sources of Perl programmers
On 14/05/13 15:09, Joel Bernstein wrote: Jobsite have been very definite for over a year that the job is not WFH. They are still plaintively asking for someone to come and work in their offices somewhere[0] just East of Portsmouth. Presumably they're soon either going to crack and hire a telecommuter, outsource the damn work entirely, or rewrite in Java. Not on their website though, so it can't be that plaintive... Dirk
Re: Alternative sources of Perl programmers
On 14/05/13 15:36, Joel Bernstein wrote: Aha! Do you have any opinion on the pedestrianisation of Norwich city centre? I'll be honest, I'm dead against it. Yar a bit late for tha' Bor...
Re: Alternative sources of Perl programmers
On 14/05/13 17:04, Joel Bernstein wrote: Your estimates are wonky, the relevant distance is a (section of a) great circle, not ATCF: http://www.gcmap.com/dist?P=LHR-CPH,+BRS-ZRH *From* *To* Initial *Heading* *Distance* LHR http://www.gcmap.com/airport/LHR (51°28'39N 0°27'41W)CPH http://www.gcmap.com/airport/CPH (55°37'05N 12°39'21E) 56.9° (NE)610 miBRS http://www.gcmap.com/airport/BRS (51°22'58N 2°43'09W)ZRH http://www.gcmap.com/airport/ZRH (47°27'53N 8°32'57E) 113.7° (SE)575 mi /joel Cough, I think you will find that most of this will be on airways and not GC. Sadly RNAV has yet to catch on in a big way, largely thanks to the inertia in the various air traffic services that such a flight would traverse. Dirk
Re: New perl features?
On 19/03/13 14:39, David Cantrell wrote: I'd like to talk about cheese. Then start a new thread under a relevant subject. Netiquette 101. Vinny blue is very fine
Testing message switch daemons
I have a message switch, rather long in the tooth, which is finally being allowed by management to be automatically tested. So I need a Test::xxx module of some kind that starts up a process (written in C), connects to that process twice (testing will be bidirectional) using TCP or UDP. The switch has many drivers. Msgs come in on one driver that handles some arcane high level (HL) binary format framed in one of several low level(LL) message framing styles. The message is normalised, routing decisions made, then sent out through one or more HL+LL driver interfaces. Each driver may (and usually will) de-normalise the message on output. One common usage of the switch is to receive position reports in one of many formats (ETSI LIP, Motorola LRRP, NMEA (various) or one of several proprietary formats) and to output them to several interested parties, connected simultaneously, each connection expecting one of an EDI, JSON or XML version of each position report. The general case will be: 0. Start up process with generated parameter file. 1. Send some data to the process on one connection. 2. Wait for the normalised message and Test it on the other connection. *. Repeat 1 2, until happy. *. Reverse direction of travel, then repeat 1 2 as before. 3. Kill process. Then do the whole lot again for each driver. This switch has several drivers (something like 20) each of which will eventually need tests. This tests each driver. Once this is done, one then needs to test end to end, binary LL/HL driver to binary HL/LL driver. A further issue is that any UDP connection may be running some kind of ARQ protocol which will need some handling underneath or out of band from the testing process (if that makes any sense). Any suggestions for the best CPAN Test::xxx module to look at for this kind of job? Concise testing would be very nice. Dirk
Re: Updating lots of database fields in a single row
On 24/01/13 16:00, David Cantrell wrote: On Thu, Jan 24, 2013 at 04:49:17PM +0100, Abigail wrote: On Thu, Jan 24, 2013 at 03:38:08PM +, Greg McCarroll wrote: Tied variables ;-) Overloaded constants, and not even your place holders are safe. Stupid language. Let's all use C instead. No, no. Let's use PLZ. Dirk
Re: Prepare for invasion.
On 13/12/12 17:56, DAVID HODGKINSON wrote: We Will Rock You 39 Steps Anything at the Globe. Is the Mousetrap still running? Yes. And the plot hasn't changed either.
Re: Perl outreach
On 26/11/12 15:59, Daniel Mantovani wrote: Dave Hodgkinson, I agree with you. Why don't we start an event for everybody with different's kind of subjects to attract people from others groups ? *The Perl community just do events for Perl community*, and people afraid of Perl will be always outside from the circle. We should start do events with another name, to attract people *from everywhere*, and than we show how Perl is fantastic. Good luck with that... Sorry to sound negative, but with the best will in the world, this is a big ask. It's like the BBC and global warming (allegedly) - they have decided that a contrary view is no longer sustainable. Perl is regarded with a similar contrary view in a computing context. It isn't that perl isn't fashionable any more, it is that it is actively being promoted as unfashionable. People will get fired for buying perl. Or (yet another analogy): perl is to programming what smoking is to workplaces - something you do in the comfort of your own home - or in a shelter outside specially constructed for the purpose. Oh and the hubris that Larry promotes as virtue and many perl programmers openly espouse - really does not does win many friends. Dirk
Re: 25 Years of Perl
On 21/11/12 09:45, David H. Adler wrote: Here is a photo of #perl users from 13 years ago! http://photography.mengwong.com/yapc1999/group-1.html And here's one from 8 years ago. http://www.panix.com/~dha/test/pix/IMG_2749.JPG It is important and/or enlightening to wonder why most of you are wearing pixie style tinfoil hats? Are the points more or less likely to attract the very emanations that you are trying to protect yourselves from? Or are you really secret Damian fans after all?
Re: 25 Years of Perl
On 21/11/12 11:47, Roger Burton West wrote: On Wed, Nov 21, 2012 at 11:40:26AM +, Dirk Koopman wrote: On 21/11/12 09:45, David H. Adler wrote: And here's one from 8 years ago. http://www.panix.com/~dha/test/pix/IMG_2749.JPG It is important and/or enlightening to wonder why most of you are wearing pixie style tinfoil hats? Are the points more or less likely to attract the very emanations that you are trying to protect yourselves from? Or are you really secret Damian fans after all? I see no hats. Are you sure you're on the right pills? One can never be sure whether they are the correct pills. However, there is tinfoil in the photo and most of it is on top of people's heads - these seem to me to qualify, albeit loosely, as hats. Unless you are suggesting that they had just been borged by our robotic overlords?
Re: 25 Years of Perl
On 20/11/12 20:42, DAVID HODGKINSON wrote: As did PHP. And the rest is history. Speaking of which, is it just a folk memory that suggests that the first 'P' in PHP once stood for perl?
Re: 25 Years of Perl
On 20/11/12 21:17, Randy J. Ray wrote: On 11/20/12 1:10 PM, Dirk Koopman wrote: On 20/11/12 20:42, DAVID HODGKINSON wrote: As did PHP. And the rest is history. Speaking of which, is it just a folk memory that suggests that the first 'P' in PHP once stood for perl? I thought, for the longest time, that PHP had originally been an acronym for Perl Hypertext Pages. But people deny that, so I can't be sure. Wikipedia says: PHP development began in 1994 when the programmer Rasmus Lerdorf initially created a set of Perl scripts he called Personal Home Page Tools to maintain his personal homepage. The scripts performed tasks such as displaying his résumé and recording his web-page traffic.[6][9][10] Lerdorf initially announced the release of PHP on the comp.infosystems.www.authoring.cgi Usenet discussion group on June 8, 1995.[11].
Re: Calendar web apps
On 03/10/12 10:44, Dave Cross wrote: Quoting Simon Wistow si...@thegestalt.org: I wrote this, many many years ago and still use it. http://search.cpan.org/dist/OurCal/ I did a bit of a refactor about 5 years ago but there's definitely bits I'd like to go clear up. But isn't there always. For a start I'd like to go make it Plackable but haven't got round to it yet. The major 'issue' is that all events that you create are tied to a day rather than having a start time and end time. Because that's all I really cared about. Changing that would actually be pretty easy. The svn address in the docs no longer works. Could you stick it on github so we can start playing with it? Please? Dirk
Calendar web apps
It seems a good idea to ask if there is a recommended Mojo/Dancer/whatever perl Calendar web app out there, just before I write one. Any suggestions?
Re: Calendar web apps
On 02/10/12 19:42, Jesse Vincent wrote: On Tue, Oct 02, 2012 at 02:54:37PM +0100, Dirk Koopman wrote: It seems a good idea to ask if there is a recommended Mojo/Dancer/whatever perl Calendar web app out there, just before I write one. Any suggestions? What featureset are you looking for? Essentially a shared calendar that one can put events in different categories onto. Maybe send email or other alarms near the time. Effectively something like Thunderturd's Lightning or even Google Calendar, but without exposing my life to Google. Nothing particularly clever.
Re: [ADMIN] Testing the Silence
On 25/09/12 04:58, Uri Guttman wrote: On 09/24/2012 11:17 PM, Yitzchak Scott-Thoennes wrote: So, HTML::Template or Mason? *ducks* Template::Simple! print '*ducks*' x 100 ; Nah, nah. You've gotta write yer own from scratch. That's what *real* programmers do! I have donned my waterproof, chainsaw boots and hat. I have a big hank of climbing rope, various bits of climbing equipment; a hard hat, lamp and spare batteries. I'm going in. Wish me luck. Dirk
Re: [ANNOUNCE] London Perl Mongers Technical Meeting 2012-07-12
On 04/07/12 23:26, Sue Spence wrote: On 4 July 2012 23:03, James Denness scaryro...@gmail.com wrote: August is YAPC Europe so there will no doubt be plenty of lead time. Can I have a gentle rant about the fact that the early bird price for YAPC will change EUR 80 - EUR 110 after 8th July (never mind the unknown cost of accommodation) and there is yet not even an outline program? Or is this unreasonable and simply me being too Dutch and not wanting to pay too much or even just buying a pig in poke [cultural stereotypes R us]? Dirk
Re: on-call rates
Can I thank everyone that replied on and off list, it is all most useful and interesting. Much appreciated. Dirk
on-call rates
I have been asked to make myself available on-call 24/7 (for defined periods of time) on third line support on a product that rarely goes wrong. Nearly all problems are infrastructure or user cockup. However, said users are a) paranoid about blame and b) by default, it must be our product's fault until proved (*PROVED* I say!) it isn't (99.9% success rate on that so far :-). Oh, and by the way, *please* get us working PDQ (pretty please). I believe I might get called 1-4 times year. Are there any standards or bits of common practice out there that can help me price this up? Dirk
Re: OT? Perl Question, iCal
On 01/06/12 21:59, Simon Wistow wrote: it's dog slow (fcvo 'dog') I find my values of dog don't really apply (being Border Terriers), or are unhelpful in these circumstances. Try: snail on mogodon. Less variability and very, very slow.
search.cpan.org MIA?
Er... search.cpan.org seems not to be responding? traceroute to search.cpan.org (194.106.223.155), 30 hops max, 60 byte packets .. 8 10ge-linx226.c4l.co.uk (195.66.236.201) 35.980 ms 38.203 ms 38.325 ms 9 swanzo-wolverine.c4l.co.uk (84.45.90.194) 39.897 ms 41.041 ms 41.508 ms 10 84.45.39.126 (84.45.39.126) 45.708 ms 45.907 ms 49.096 ms 11 194.106.223.155 (194.106.223.155) 47.429 ms 47.636 ms 47.827 ms 12 194.106.223.155 (194.106.223.155) 49.294 ms !X 50.051 ms !X 51.307 ms !X !X = communication administratively prohibited.
Re: search.cpan.org MIA?
On 10/05/12 18:58, Dave Cross wrote: On 10/05/12 17:29, Dirk Koopman wrote: Er... search.cpan.org seems not to be responding? Do people still use search.cpan,org? http://metacpan.org/ Yep, cpanm does when it tries to download a package to install. It can be got around, but it's a pain.
Re: search.cpan.org MIA?
On 10/05/12 19:28, Dirk Koopman wrote: On 10/05/12 18:58, Dave Cross wrote: On 10/05/12 17:29, Dirk Koopman wrote: Er... search.cpan.org seems not to be responding? Do people still use search.cpan,org? http://metacpan.org/ Yep, cpanm does when it tries to download a package to install. It can be got around, but it's a pain. It's working again now, thank you to whomever fixed it.
event driven serial port handlers
I am on the horns of a small dilemma. I am writing a small driver for a serially connected weather station that *has* to be event driven (whether that be by boring IO::Select or some other framework). It happens that sometimes the devices communicates in ascii and at other times in binary. Like many devices of its kind, it is pretty unreliable about being connected or alive or indeed generally knowing what state its knickers are in, necessitating much prodding to wakeup/reset/just talk to me you br. I am trying to avoid just writing a standalone C program to handle it. If I do it in perl (the rest of the system will be in perl), there is no option, IMO, but to have a state machine. That means ultimately processing characters created out of buffers of data returned by the random buffers of data returned from non-blocking sysread()s. My question is: is this going to be grossly inefficient bearing in mind that I want to do this in a process that also serves the data in some HTML5ish that allows me and others go oo-ah at the lovely webby guages and graphs? Dirk PS Please assume that I have had a really good look at CPAN w.r.t the various weather station modules there, especially the three that purport to handle the one I have. None of them will handle the sorts of outages that happen in the real world (around here at any rate).
Re: event driven serial port handlers
On 09/05/12 14:09, Mark Fowler wrote: On Wednesday, 9 May 2012 at 12:46, Dirk Koopman wrote: My question is: is this going to be grossly inefficient bearing in mind that I want to do this in a process that also serves the data in some HTML5ish that allows me and others go oo-ah at the lovely webby guages and graphs? Why is this happening in the same process? Couldn't you just store the results in some sort of database (or for that matter, simple flat file on disk.) The two separate processes you've got here (talking to the spottily connected weather station) and serving web pages seem like they'd better off being two, ahem, separate processes. That's a point of view that I am considering. The answer depends rather on the answer to the above question. I didn't mention the UDP based data distribution protocol (or the websockets) in the app, as that may have confused the issue. As a multi protocol select()[ish] event handler is already involved, and if it the character handling is not a big processor hog, then it makes some sense to me to shove that in as another module serviced by the event handler. I have quite a bit of form doing this sort of thing. Having it in the same process, that then means arrival of data can drive state changes which directly cause output such as sending stuff down websocket connections and elsewhere via UDP. Otherwise one has to poll databases, which is IMO naff (and a cop out in an event based system)[and so is the store it in a database and signal the main process model]. Obviously, I could try it. But putting a framework together that I won't have to throw away and start again is a significant piece of work. I was hoping someone has the experience to answer my core question before plunging in. Dirk
Re: event driven serial port handlers
On 09/05/12 17:37, Mark Fowler wrote: On Wednesday, 9 May 2012 at 15:42, Dirk Koopman wrote: Obviously, I could try it. But putting a framework together that I won't have to throw away and start again is a significant piece of work. I was hoping someone has the experience to answer my core question before plunging in. Well, there are obviously many event loop based frameworks out there. Here's a few random thoughts: Twiggy - https://metacpan.org/release/Twiggy (https://metacpan.org/release/Reflex) will let you run an AnyEvent Plack compatible webserver, so you could avoid having to even think about the event loop while you're doing the web stuff if you used this and a Plack compatible web framework (Dancer, Mojolicious, Catalyst, etc.) Obvious care not to do something blocking from within your web server app would have to be taken. If you want to go old school, POE has wheels that abstract out the HTTP bit. If you want to go ultra-modern there's Reflex https://metacpan.org/release/Reflex Thank you, I am aware of and will be using at least some of these. But as usual, I manage to lead people astray with ambiguous use of terms (in this case: framework). The framework I was referring to is that of the whole app itself, not the underlying event handling one.
Re: [ANNOUNCE] London Perl Mongers Technical Meeting 2012-05-31
On 09/05/12 20:11, Leon Brocard wrote: This meeting is sponsored by Webfusion and will be held at the Conway Hall. Many thanks to Barbie, Webfusion and everyone involved for allowing us to use this wonderful venue. Wot? No Damian? At the Conway Hall? For Shame!
Re: Professional Indemnity
On 01/05/12 20:52, Paul Makepeace wrote: I went with none. I didn't see the point of paying for something that seems to have zero legal (AFAIK) legal precedent. cat/dev/urandom/dev/null The problem with PI is that you have to have it when the punter makes the claim, not (just) when you did the work. Which means that if the BBC (just talking very hypothetically) wants to sue three years after you left them, and you have no PI in force, then you could be stuffed. I have successfully argued, in a non IR35 threatening way, that the customer has to test and accept the work that I do. Once (s)he has accepted the work, and they sell as theirs, then they must accept liability. In my view demanding PI for programmers (or other production occupation of customers' geegaws) is incorrect and probably not enforceable in a court. Where it is mandatory is if one provides a (consultancy) service (for money) directly to a company for its own internal use. Or so it was explained to me by a Lloyds broker that I did some work for many years ago. The people that I contracted to had the PI and they warranted the package that they supplied to that broker. Obviously everyone must have public liability for those days when one just can't seem to stop oneself dropping the customer's computer on his stupid foot. Dirk PS IANAL IANAIB PPS Technically EOE is a trademark for EOE insurance and so I won't use it. Just bear that in mind as well though.
Re: Confused by sysread()
On 09/04/12 22:32, Roger Burton West wrote: while (1) { my @ready=$s-can_read(0.5); foreach my $fh (@ready) { my $data; my $y=sysread $fh,$data,16; die $! unless defined $y; # do stuff with $data } } For what it is worth, I am running a similar loop which will call sysread, but with an extra offset parameter as in: my $y=sysread $fh,$data,16,0; I believe I did this for similar reasons as early as perl 5.0004. But this may be complete misremembering on my part as it was more than 12 years ago. My version of this code is still running very happily on perl 5.10.1, but on sockets and in non-blocking mode.
Re: Programming Heresy
On 30/03/12 10:24, Steve Mynott wrote: Has anyone tried programming outside? E-ink (like on the Kindle) works well in sunlight and I wondered if any such device would be useable (ideally with a decent keyboard). Get yourself a decent man shed with some decent windows that you can open.
Re: Programming Heresy
On 30/03/12 11:40, Roger Burton West wrote: On Fri, Mar 30, 2012 at 11:29:46AM +0100, Will Crawford wrote: On 30 March 2012 11:23, Dirk Koopmand...@tobit.co.uk wrote: Get yourself a decent man shed with some decent windows that you can open. What kind of colour is man? Pick one: Whatever colour you want it to be. The colour it was when it came from the shop. The colour of all this left-over paint I had lying around. Pink. Because I felt like it. The shop sent mine in Ivory White.
Re: Where to buy Cassocks?
On 31/01/12 08:05, Andrew Beattie wrote: Is there a place to go to buy a used Cassock other than the 'Bay? It's hard. So hard that most regular cassock wearers end up buying new ones. At least they then stand a chance of fitting. More difficult questions are: what colour, closely followed by: what style? Orange is an option. Dirk
Re: Where to buy Cassocks?
On 31/01/12 13:55, Guinevere Nell wrote: I keep reading it as where to buy Cossackshttp://en.wikipedia.org/wiki/Cossacks Carsocks is also a valid synonym in the more radical wing of the rent a choir fraternity (www.clerkes.org.uk)
Re: Laptop Recommendation
On 24/01/12 09:10, Smylers wrote: I'm looking to part with over £1000, one of the most expensive things I've ever bought (topped only by a home and a wedding). Surely when a company's wishing to take that sum of money from a customer it's worth them putting a little effort into it? Right now shopping on laptop websites can't possibly be more painful than going into PC World and trying to engage their staff in meaningful technical conversation. At least in PC World I could physically pick up a laptop and get a feel for how much it weighs. I could even take the kitchen scales with me ... (While finding the Acer UK website though, going via the Acer Group site I did learn that Gateway (moo!) and Packard Bell (shudder) still exist.) It may be that visiting PC World with your Ubuntu on a memory stick may be the only sane way of doing this. Although you may find John Lewis a more cooperative test subject. Please bear in mind that there essentially only three Chinese (include Taiwan) laptop manufacturers, one of which is Lenovo. Looking at the label is unlikely to tell you who made the machine (the keyboard is a reasonable, but not infallible, giveaway). Just because it says Acer/Asus/Gateway/Packard Bell doesn't mean it isn't a Clevo. One reason the touchpad spec may not be spelled out is that I have found (once) that I ended up with a non-multitouch Synaptics touchpad when my previous model had one. Also have a look on http://www.reghardware.co.uk. Dirk
Re: Laptop Recommendation
On 23/01/12 22:00, Peter Edwards wrote: On 23 January 2012 19:17, Smylerssmyl...@stripey.com wrote: I realize that I stupidly omitted to state that I'll be running Ubuntu on whatever I buy. I have found that Acer laptops work reasonably well under Ubuntu (or Xubuntu as I use). They seem to have decentish Synaptics touchpads etc and more or less as advertised battery life - so long as one uses the latest kernel or one from awhile back. There was a power handling regression that snuck in which has only recently been fixed. Dirk
Re: Telecommuting
On 12/12/11 10:13, David Cantrell wrote: On Sat, Dec 10, 2011 at 11:06:14PM +, ian docherty wrote: The small 'ping' of an IRC is less disruptive than a tap on the shoulder and you can complete your current work before giving it, and your co-developer, your full attention. Doesn't work so well when the IRC window is buried under twenty other windows because you're actually *working*. Clearly, there is a priority mismatch here somewhere. Especially as my window manager has both an always on top as well as an always below tag for windows. Mind you, I am not certain what use the second of those is... But (but) there is this meme being punted around at the moment that says: all internal email is bad and should be banned because studies show that people spend (more than) 20% of their time processing what turn out to be useless email. Properly organised IRC does seem like a reasonable alternative. Being constantly interrupted is one of the programmers bugbears. Especially as I argue that this probably wastes even more time than dealing with email. It isn't just the time the interruption takes, but also the time lost whilst one gets back into whatever one might have been doing. And then there is the this is a crisis, I need immediate help syndrome. The more successful one is at solving problems, the more one is likely to be dragged from pillar to post solving other peoples (usually trivial) problems - or worse - being loaded with more problems that one can possible resolve satisfactorily, by more managers than one knew existed. This has recently caused a good friend to have a breakdown. Decent management is hard to find. Dirk
Re: london.pm
On 06/12/11 14:04, Dave Cross wrote: Well that seemed to go well. The AFNIC .pm pre-registrations were processed this morning and I am now the proud owner of the domain london.pm. It's only taken me 13 years to get it. Huzzah!!
.pm TLD to become available?
I see in Perl Weekly that it may become possible to obtain domains under the TLD of .pm. http://perlhacks.com/2011/11/saint-pierre-and-miquelon/ Is anyone organising an application for 6th December when it opens. Is anyone interested?
Re: .pm TLD to become available?
On 28/11/11 12:14, David Cantrell wrote: On Mon, Nov 28, 2011 at 10:49:44AM +, Dave Cross wrote: Quoting Dirk Koopmand...@tobit.co.uk: http://perlhacks.com/2011/11/saint-pierre-and-miquelon/ Do you really think I would have publicised this by writing a blog post about it _before_ doing all I could to reserver london.pm? :-) *to reserver*? Did the AFNIC website infect your langue? It's a French TLD.
Re: Implementing a Queue in a process
On 22/11/11 07:16, Shantanu Bhadoria wrote: - How to implement this queue in a perl process. (remote shared Database:mysql?, internal data structure, local SQLite?) - How do I push new tasks into this queue ( i.e. interprocess communication, Simpler(uglier) for a shared database, but I would prefer a process like that to sit in isolation and accept requests and manage them on its own so whats the ideal inter-process communication format for it?named pipes?). I would really love to know your opinions on the best way to do it. The straightforward but ugly way to do this would probably be putting tasks into a database and have the other process ping the database for new tasks in queue every second. But I believe there has gotta be a better way to do it and what better place to figure it out then ask you folks. :) So what do you guys think is the best implementation for such a requirement? Now is your chance to use AnyEvent and Json. That is what I do these days. I used to use my own message handling stuff, but these are better and much faster. Dirk
h2xs -x
Has anyone managed to get h2xs -x to produce anything on a modern gcc / linux combination? It seems to barf parsing the interstices of stdio.h etc and, BTW, with totally useless error messages. I also notice that debian removed the package on 2008 on the grounds that nobody used it (and it produced this error then). Expecting parenth after identifier in `struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 364 /usr/include/libio.h 3 4 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); typedef __io_read_fn cookie_read_function_t; typedef __io_write_fn cookie_write_function_t; typedef __io_seek_fn cookie_seek_function_t; typedef __io_close_fn cookie_close_function_t; typedef struct { __io_read_fn *read; __io_write_fn *write; __io_seek_fn *seek; __io_close_fn *close; } _IO_cookie_io_functions_t; typedef _IO_cookie_io_functions_t cookie_io_functions_t; struct _IO_cookie_file; extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write, void *__cookie, _IO_cookie_io_functions_t __fns)' after `struct _IO_FILE_plus _IO_2_1_stdin_' at /usr/local/share/perl/5.8.8/C/Scan.pm line 729.
Re: Perl Skills Test
On 28/09/11 10:42, Wendy G.A. van Dijk wrote: I've got this very interesting book in my Perl library for quite a while. It does contain interview questions about Perl. Not all questions are excellent, but quite a bunch are. In my opinion, many questions can be used to find out the skill of interviewed prospective Perl developers. So, it's not a test, but with these questions you can make several. Perl Interview Questions: Perl Programming Frequently Asked Questions Equity Press http://itcookbook.com/store/index.php?main_page=product_infocPath=1products_id=1 2006, edited by Emilee Newman Bowles ISBN 1-933804-48-3 And on Amazon, from a self selected group of one, the review says: POOR If you are looking for some good in-depth material to help with Perl interviews then this book is definitely NOT for you.
Re: Perl-friendly message queue-like system
On 22/09/11 15:56, David Cantrell wrote: On Thu, Sep 22, 2011 at 02:48:32PM +0100, Tomas Doran wrote: There are other advantages of having a 'real' message queue ... I have yet to come across a situation where you needed a real message queue and can't just use a table in a database (replicated/clustered if necessary) with an auto-incrementing id. FLAME ALERT!
Re: Perl in shared hosting environments
On 21/09/11 09:55, Tomas Doran wrote: On 21 Sep 2011, at 09:22, Philip Newton wrote: And I agree with Lesley in assuming the answer is no - I doubt that you can modify Apache that way to inject a module into it from your section of a shared hosting environment. Oh, yes, of course! Your perl script isn't going to be able to extend apache without apache collaborating in this :) For what it is worth, I stopped using mod_perl (as well as Apache) several years ago and moved onto other webservers and FastCGI. Reason include: * Apache seems to be the sendmail of the webserving world. Does anybody other than me note the frequency of critical bugs, ongoing, that Apache has? * Other webservers can be run, more easily, on non-privileged ports and users, chrooted etc etc to reduce the attack surface even more (obviously one redirects traffic from port 80 etc either via the operating system or load balancers). * Stuff has to be stitched into mod_perl. This is unnecessarily tedious - difficult and probably increases the attack surface as well. * Added (completely) new stuff into the same mod_perl environment is next to impossible (i.e. forget shared hosting). * mod_perl processes seem(ed) to get bigger and bigger and need(ed) to be killed every few 10s of requests to keep memory usage in bounds. We needed many more (bigger) machines to run mod_perl v other webservers and FastCGI. * Stuff designed with FastCGI in mind is much easier to test and debug. * FastCGI does not have to be on the same machine as the webserver, nor even on the same architecture. * The difference in speed between mod_perl and an established FastCGI set of processes is minimal. In some cases I have found FastCGI faster than mod_perl. * Other webservers can be run, more easily, on non-privileged ports and users, chrooted etc etc to reduce the attack surface even more (obviously one redirects traffic from port 80 etc either via the operating system or load balancers). I may simply be biased, but it is based on bitter (but now old) experience. YMMV (and probably does) Dirk
Re: Perl in shared hosting environments
On 21/09/11 11:38, Leo Lapworth wrote: snip On 21 September 2011 11:21, Dirk Koopmand...@tobit.co.uk wrote: For what it is worth, I stopped using mod_perl (as well as Apache) several years ago and moved onto other webservers and FastCGI. As long as your not completely integrated to mod_perl hooks, e.g. your mostly using it for precompile speed up... Check out Plack: http://plackperl.org/ - https://metacpan.org/module/Plack http://blog.plackperl.org/2011/08/plack-basics-for-perl-websites-yapceu-2011.html Then you can switch between mod_perl / FastCGI / Starman / Twiggy to your hearts content (we found Starman is REALLY fast). I am happy to be educated, but I found Plack introduced a load of dependencies that I did not want, it *is* another layer which cannot help but reduce speed - which may not matter - but did to me at the time. You also get a lot (160+ modules) of nice middleware available. More software to, at least potentially, get in the way or add unnecessary dependencies or unwanted constraints. But I will look at it again soon. Dirk
Re: Perl in shared hosting environments
On 21/09/11 16:49, Randal L. Schwartz wrote: Dirk == Dirk Koopmand...@tobit.co.uk writes: Dirk Reason include: You forgot: * My application only requires content generation, and I can completely ignore the other 14 phases of serving, because I don't want custom redirects, authentication, authorization, mime interpretation, and/or logging and other things written in the language of my choice: Perl. Seriously... *nothing* can compete with mod_perl as far as its reach into Apache. *Nothing*. With mod_perl, you can inject new behavior at every level of decision making that Apache does. FastCGI is replacing just *one* of those 14 stages. And these are advantages or reasons to avoid mod_perl? I agree with your last paragraph, but I have to utter a very politely meant, but heartfelt, so what. Nothing written, so far, would cause me to stop avoiding Apache with every fibre of my being. It is a hateful security_hole^Hprogram and mod_perl is an unfortunate part of that. Also once perl is embedded into any thing and one uses perl extensively within, the speed of the thing will tend toward the speed of the perl part. In the case of a (web)server, these days, one may as well use one of the perl (web)server modules/frameworks and do the whole lot in perl. Maybe using some of the newer XS support modules. All stages of a request are available. It isn't significantly slower than mod_perl (and maybe quicker). The memory requirements seem to stabilise very quickly and are reasonable. I have perl servers of one kind or another that stay up for years at a time even under some aggressive attempts to DoS / exceed limits. The joy of infinite buffer sizes and garbage collection. And it's easier to debug (although it would be nice not to have Carp::Heavy crash on errors quite so frequently). Dirk
Re: Should I get my mum a Kindle?
On 20/09/11 14:33, Dave Hodgkinson wrote: On 20 Sep 2011, at 14:21, Edmund von der Burg wrote: Perhaps an iPod Touch with some cloud syncing so you can put music onto it? No idea about the details though but if my toddler can work an iPad your Mum should be able to too :) No, he said there's no wifi in the house. iPhone was my first thought or maybe iTouch plus one of those 3G-wifi dongledoofers. Bite one's tongue and install a secret wifi box with all the latest security etc? We have an old 8G iTouch here going begging... Much better then a Kindle for multimedia.
Re: More free stuff at the ORTHODOX social
On 21/08/11 16:31, David Cantrell wrote: I've got a load of books to get rid of, including a bunch of perly books. There's a list here: http://www.cantrell.org.uk/david/library/unwanted.tt2 Let me know what you want and I'll bring them to the pub. What is moderately frightening is that I have nearly all of those books already. Should be worried? Am I a closet Dave? Dirk
Re: LPW 2011 carpooling
On 20/08/11 00:17, Merijn Broeren wrote: Quoting Job van Achterberg (j...@xs4all.nl): Hi everyone, First off, for those who attended, it was great to see you at YAPC::EU::2011. I've arranged to come to the LPW, but am wondering if any other Dutch people following this list are attending. Perhaps we could carpool and share transportation costs. I have no car, just a motorbike, and it'd be quite the drive. With the car or motorcycle I now do it in 5, and I get the benefit of stopping for food in Belgium. Benefit? Has something changed? Cheers, [1] Private planes only, not really targetting the .pm audience :-) Oh I dunno, unless something has changed recently, there is the issue of please join long downwind, you are number 15 to land. Dirk
Re: LPW 2011 carpooling
On 19/08/11 13:14, David Cantrell wrote: On Fri, Aug 19, 2011 at 11:57:16AM +0100, James Laver wrote: If you're being sensible and you have the money, fly from city, else heathrow, else gatwick, else luton, else stansted. In that order, preferably avoiding scumming it from stansted. If you're using another airport and you don't happen to live near euston, don't even think about any of the others. FWIW, my order of preference for travelling to and from the Netherlands would be Eurostar / City / Gatwick / Lydd (sorry, London Ashford) / boat from Harwich and failing that, don't travel. Heathrow is both deeply unpleasant and a pain in the arse to get to. Gatwick is also a pain in the arse to get to unless you live where I do, but at least once you're there it is just about bearable. I'd only use Heathrow, Luton, or Stansted if I was being paid to do so. Agreed, but always remember the convenience and speed of flying is illusory. Old Chinese Aviator, he say: Time to spare? Go by Air!. Particularly true now in these paranoid times. Dirk
Re: LPW 2011 carpooling
On 19/08/11 14:49, Martin A. Brooks wrote: - Original Message - From: Kieren Dimentdim...@gmail.com Sent: Friday, 19 August, 2011 1:31:13 PM Personally my favourite airport is Changi in Singapore Oslo. It's _quiet_. And quick and efficient. Shame about the £60 return fare to the actual city though. Dirk
Re: Gatwick
On 25/07/11 14:34, Smylers wrote: Hello. How big is Gatwick Airport? More specifically, about how long do I need to allow for walking from its railway station to the check-in hall ('Terminal S', according to my ticket)? Be warned that the Gatwick Express is noticeably more expensive, and not much quicker (if you choose your starting point in London correctly), than yer normal train. I think they have finally stopped charging extra for a ticket to Gatwick Airport, as opposed to Horsham which is the next station. But you may care to check if that matters to you. Dirk
Re: Gatwick
On 25/07/11 16:02, Paul Makepeace wrote: On Mon, Jul 25, 2011 at 15:49, Andy Wardleya...@wardley.org wrote: On 25/07/2011 14:53, Ash Berlin wrote: Curiously I've arrived at gatwick far more often than I've left from there OK, I'll bite. My curiosity is piqued. How can this be? Leave the UK from say Stansted, arrive back through Gatwick. (The bus/car/train making up the other half of each (arrive, depart) tuple, presumably.) Another frequent reason occurs when flying EasyAir or near equiv. One may go out from Gatwick and on return have the flight cancelled and be offered a (later) one to Luton. Or vice versa. The coach journey is pretty quick though. Dirk
Re: [ANNOUNCE] Croyden.pm
On 19/07/11 16:22, Chisel wrote: On Mon, Jul 18, 2011 at 5:02 PM, David Cantrellda...@cantrell.org.ukwrote: There will be a Gathering of Croyden.pm at the Royal Standard in Croydon on Wednesday the 20th of July. I have to ask ... Croyd*e*n.pm? Don't, Please don't. It's just like that OK?
Re: Slightly offtopic - coordinate conversions
On 13/07/11 07:52, Peter Edwards wrote: On 13 July 2011 07:16, Peter Sergeantp...@clueball.com wrote: I've been playing around with Google Maps recently, and noticed that they've started using hashes of some coordinates: latlng: 52.54296 -0.308166 hnear : 0x4877f21032e242f5:0x805cb103d71d5051 latlng: 51.411586,-0.300893 hnear : 0x47d8a00baf21de75:0x52963a5addd52a99 Hex representation of the double? Dirk
Re: [OT]-ish: Can someone explain this?
On 04/07/11 16:40, David Cantrell wrote: On Sat, Jul 02, 2011 at 05:32:38PM +0100, Dirk Koopman wrote: Here is a bit of C code that is part of something much bigger. _exit(0); Why _exit instead of exit? Because there is an atexit() handler that a) needs to be active and b) does evil[tm] things that are only partially set up at the point where this string is output and then _exit()ed. And nothing whatever to do with the fact that someone couldn't be bothered (or was too stressed to) rearrange things so that atexit() is called slightly later to enable exit() to be used at that point. Oh no, nothing like that at all... Dirk
[OT]-ish: Can someone explain this?
Here is a bit of C code that is part of something much bigger. #include stdio.h #include unistd.h #define GIT_VERSION 1.23-dev #define GIT_COUNT 73 #define GIT_ID daa3ab8 #define VERSION 1.23 main() { printf(\nThingy version %s (%s-%s-%s) (built %s, %s)\n\n, VERSION, GIT_VERSION, GIT_COUNT, GIT_ID, __TIME__, __DATE__); // fflush(stdout); _exit(0); } If one compiles it (cc vtest.c -o vtest) and runs it at a shell prompt, one gets: jim@mike2:~/thingy$ vtest Thingy version 1.23 (1.23-dev-73-daa3ab8) (built 16:21:49, Jun 30 2011) jim@mike2:~/thingy$ All is well and seemingly as expected. However now do this: jim@mike2:~/thingy$ vtest | grep version jim@mike2:~/thingy$ Stdout appears not to have been have been flushed. Which, after reading the man page for _exit is fair enough as it says: The function _exit() terminates the calling process immediately. Any open file descriptors belonging to the process are closed. This is, in fact, what is wanted in the larger program. This behaviour has only come to light, after several years mind, because some (other) poor fool wanted to grab the version no for some shell script or other, instead of just checking what a user had installed via a shell prompt. The fix is simply to fflush(stdout), before _exit(). But how come I get output at a shell prompt, and not down a pipe (or a redirection either)? What special magic is occurring here? Dirk
Phenona
Anyone had a go with: http://www.phenona.com/ a perl cloud?
Re: Speed v Version
On 03/06/11 09:28, Nigel Metheringham wrote: On 3 Jun 2011, at 08:28, Toby Wintermute wrote: 1) Are they running old Red Hat or CentOS versions? I ask because the Perl shipped on those was, for quite a long time, very, very broken due to a vendor patch that made bless() take 1000x longer than it should. In that case, just using a non-broken Perl will be extremely faster. I suspect from the version info and context given that their install is older than that particular bug (which actually was very limited in timescale, but it just took them a while to roll out the fix) It is a custom perl generated from the real perl tarball, not a vendor modified one. The only customisation is to change the name of the perl binary itself (together with all the library paths etc). This is so that there is no chance of ever getting vendor and this custom perl packages mixed up. Thank you all for your suggestions. I will see whether I can persuade them to upgrade. Dirk
Re: Speed v Version
On 03/06/11 10:56, Dave Hodgkinson wrote: On 3 Jun 2011, at 10:21, Dirk Koopman wrote: Thank you all for your suggestions. I will see whether I can persuade them to upgrade. Which is almost certainly Not The Problem. I agree it is Not The Problem. But increased speed is a killer hook to persuade them to agree an upgrade. I have to upgrade DBI and DBD::ODBC because I need newer facilities in there to do some other stuff. I am looking to upgrade the perl at the same time ('cos I am a professional and like to anticipate) and casting around for suitable justifications. It isn't exactly a lot of extra work. Dirk
Speed v Version
I contemplating providing encouragement to a customer to upgrade from 5.8.7 to something more modern. One of the overriding issues is speed. The customer is fixated with speed. Unfortunately one of the major things the customer's clients do is replicate their ISAM data into databases, usually MS-SQL via DBI and DBD::ODBC. The ISAM data is always on Linux (and a few Unix) boxes. The replication is a batch process that must complete overnight. Currently it is a fairly close run thing. I don't suppose anyone has done any speed benchmarking on the various perls to date? Still less on newer DBIs etc? All the customer's modules are circa 2005. Dirk
Re: Part-time Perl Developer Position based Reading, UK
On 26/05/11 17:53, David Cantrell wrote: Well, I did once get in trouble for failing to oil the social wheels with a client, but that's because I called them spamming scum rather than not giving a shit about their football team. There are some wheels that are best oiled with blood, flesh, and bits of ground-up bone. Here, here! Dirk
Re: Fwd: [Full-disclosure] TSSA-2011-03 - Perl : multiple functions null pointer dereference uppon parameters injection
On 09/05/11 12:01, Jacqui Caren-home wrote: FYI: may be old news but worth repeating. Not sure why xpdf is doc'd as the vendor :-) Jacqui Original Message Subject: [Full-disclosure] TSSA-2011-03 - Perl : multiple functions null pointer dereference uppon parameters injection Date: Mon, 9 May 2011 10:52:20 +0200 From: Advisories Toucan-System advisor...@toucan-system.com To: bugt...@securityfocus.com, full-disclos...@lists.grok.org.uk --- * Perl : multiple functions null pointer dereference * * uppon parameters injection * --- For what it is worth, this appears to have been patched distributed by Debian and Ubuntu in the last week or so.
Re: Junior-mid level Perl
On 28/04/11 00:14, Aaron Crane wrote: Pedro Figueiredom...@pedrofigueiredo.org wrote: I was just thinking that surely a Bloody Mary is 1 of your 5-a-day. How about sloe gin? Sloe vodka is just as nice, if slightly different, and also matures more quickly (at least when I make it). Unfortunately I suspect you have to eat the sloes to get the 5 a day. However, get some decent rough scrumpy, drop the spent sloes (left after making your sloe gin/vodka) into it. Leave in a sealed jar for a couple of days (shaking occasionally) and then drink. This is called slider and it certainly does go down very easily. The sloes by now are edible - just. And there is the apple content from cider as well. That must count for something? Dirk
Re: Junior-mid level Perl (Victoria Conlan)
On 27/04/11 13:00, Sue Spence wrote: On 27 April 2011 12:49, Victoria Conlanvi...@comps.org wrote: I still favour getting the hell out of IT and setting up a tea shop, though. (tea and cakes at my place when I do so!) Victoria(n) sponge cakes? But of course! I also do a pretty nifty chocolate fudge cake, and a hugely calorific sachertorte, plus very nice vegan shortbread. I am going to get s fat. :-) Vegan shortbread? WTH. The short(ening) agent in Short Bread = fat. Dirk
Re: Junior-mid level Perl (Victoria Conlan)
On 27/04/11 21:58, Sue Spence wrote: On 27 April 2011 19:54, Dirk Koopmand...@tobit.co.uk wrote: On 27/04/11 13:00, Sue Spence wrote: On 27 April 2011 12:49, Victoria Conlanvi...@comps.orgwrote: I still favour getting the hell out of IT and setting up a tea shop, though. (tea and cakes at my place when I do so!) Victoria(n) sponge cakes? But of course! I also do a pretty nifty chocolate fudge cake, and a hugely calorific sachertorte, plus very nice vegan shortbread. I am going to get s fat. :-) Vegan shortbread? WTH. The short(ening) agent in Short Bread = fat. Specifically, it must be butter. No butter, no shortbread. Actually LARD works even better (as shortening), but then a) it would not taste the same and b) is arguably even less vegan. So what is Vegan shortbread then? Dirk
Re: Junior-mid level Perl
On 27/04/11 22:31, Pedro Figueiredo wrote: On 27 Apr 2011, at 18:08, Dave Hodgkinsondaveh...@gmail.com wrote: On 27 Apr 2011, at 16:55, Pedro Figueiredo wrote: On 27 Apr 2011, at 16:18, Paul Makepeace wrote: Also: geek-operated mojito bars in the caribbean. Ten years ago I considered opening a margarita bar on a deserted beach in Thailand, but couldn't find such thing. Would gladly consider mojitos, perhaps serve margaritas in the morning when you need to replenish the salt reserves, and switch to mojitos in the afternoon, as the sugar would keep you going. MAGIC ALCOHOLIC DIET!! And lime for vitamin C. I was just thinking that surely a Bloody Mary is 1 of your 5-a-day. Only in a 250ml serving.
Re: Someone needs to take jwz aside...
On 20/04/11 23:17, Peter Edwards wrote: Imagine you're supporting a 3 year old code base that needs specific versions of DBIx::Class, Catalyst, Moose and Class::MOP to make it run, and when you do a upgrade via yum or apt-get or cpan random things break in your regression tests and you don't have the budget to go fix all of them. (No, that's not where I work now but it is a real world situation.) Which is a pretty serious indictment of CPAN and the attitudes of the people that maintain software there. How can anyone expect businesses to use perl and CPAN when stuff is likely to break (sometimes big time) when one upgrades the toolchain? Why does stuff on CPAN so frequently not maintain backward compatibility? Dirk
Re: Perl and IPv6. It's alright now.
On 18/04/11 03:16, Jesse Vincent wrote: On Sun 17.Apr'11 at 20:11:09 +0100, Duncan Garland wrote: Hi Jesse, Ok, I'll see if I can organise something. Perl 5.13 is a beta release which is due to become the production release 5.14 this year isn't it? Yes. Can I conclude that 5.14 is expected to have good quality IPv6 support. It'd be a much safer conclusion if you could validate that we've actually met whatever bar you've set for good quality IPv6 support For what it is worth, I am currently using IO::Socket::INET6 in production code achieving boringly normal IPV6 connections to and from instances spread all around the globe. The same code works seamlessly to IPV4 - being a direct replacement for IO::Socket::INET. Mostly (but not exclusively) on 5.10.x perls. But then I don't do anything exotic. Dirk
Re: perlbrew and Image::Magick
On 06/04/11 22:38, Chisel wrote: I don't know if it's perlbrew specific, or just a good way to encounter the problem but I'm stumped. I'm seeing the same thing with a 5.12.2 and 5.12.3 brewed perl; everything's under Ubuntu or Linux Mint. snip LD_RUN_PATH=/usr/lib cc -L../magick/.libs -lMagickCore -shared -O2 -L/usr/local/lib -fstack-protector Magick.o -o blib/ arch/auto/Image/Magick/Magick.so \ -lMagickCore -lperl \ /usr/bin/ld: cannot find -lperl collect2: ld returned 1 exit status From your perl -V: useshrplib=false Could be relevant. It may will be that Image::Magick insists on this being true. As a suggestion. Dirk
Re: [ANNOUNCE] Speakers at a conference
On 07/02/11 22:52, Dave Hodgkinson wrote: On 7 Feb 2011, at 17:01, Dagfinn Ilmari Mannsåker wrote: Dave Hodgkinsondaveh...@gmail.com writes: On 7 Feb 2011, at 15:47, Piers Cawley wrote: Alan Kay Brian Stroustrup and make him apoligise. ITYM Bjarne. I've been watching too much Family Guy. Now, a language designed by a liberal, Prius-driving, alcoholic dog would be good. Wait. No, it wouldn't be any different. I don't suppose there would be any mileage in comparing the gestation and evolution of C++ with other languages at this point? Compare and contrast, that sort of thing? Can't think of any obvious parallels just now, but I am sure there are more intelligent people on here who might be able to help us. My coat is hanging within easy reach Dirk