Re: Barbie and Perl

2014-11-19 Thread Paul Makepeace
Amusing rewrite:
http://caseyfiesler.com/2014/11/18/barbie-remixed-i-really-can-be-a-computer-engineer/

On Wednesday, November 19, 2014, Guinevere Nell guinevere.n...@gmail.com
wrote:

 Hi London.pm (ers)

 Having just got a reminder from perl's Barbie about LPW, it occured to me
 that I could share not-perl's Barbie's atrocious book about what it means
 for a girl to think about going into computery stuff ~ a girl computer
 engineer ?? ... Don't worry, she'll let the boys do all the hard stuff...

 Since I know the perl community would like to welcome the femalier sex into
 its folds (let's not imagine folds of fat, please), I thought you all might
 be interested:

 http://gizmodo.com/barbie-f-cks-it-up-again-1660326671

 What an amazing role model for girls, huh?

 Cheers,

 Guinevere

 p.s. please feel free to share with the rest of the perl community and
 brainstorm about possible open-source / public domain solutions to this
 rubbish ...


 --
 http://economicliberty.net/



Re: Getting the latest related record from a SQL DB

2014-10-09 Thread Paul Makepeace
Why not include a sub-select like,

 ... where album.published = (select max(album.published) from album
join artist on album.artist_id = artist.id) ...

Paul

On Thu, Oct 9, 2014 at 5:28 AM, Andrew Beverley a...@andybev.com wrote:
 Hi guys,

 I'm after some best-practice advice regarding SQL database design.

 I have a table (say artist, couldn't resist...) that has a one-to-many
 relationship to another table (say album). The album table has a field
 which references the artist table's ID. So one artist can have many
 albums.

 So, if I want to know all of an artist's albums, that's easy.

 But what if I want to fetch an artist's details and his latest album? I
 can select the artist from the artists table and then join the albums
 table. But to get the latest album I'd have to use a max function (say
 on the album's date), with which it isn't possible to get the related
 fields in the same row.

 I see 2 ways of solving this:

 - Run multiple queries to get the relevant album's ID (if even possible)
 and then retrieve its row in entirety.

 - Have a reference from the artist table back to the album table,
 specifying which is the latest album, which I update each time the
 albums table is updated.

 Neither seem particularly tidy to me, so am I missing something
 completely obvious?

 Thanks,

 Andy




Re: Regex to match odd numbers

2014-08-22 Thread Paul Makepeace
$thread-resurrect();


On Tue, May 27, 2014 at 12:37 PM, Mark Fowler m...@twoshortplanks.com wrote:

 On Tuesday, May 27, 2014, Sam Kington s...@illuminated.co.uk wrote:
 
  Sounds like you want something like
 
  / ( ^ 5[.] ( [79] | \d+ [13579] ) ) /x
 

 This is where I mention that \d matches characters other than [0-9] unless
 you have the /a flag in effect (thanks Unicode!)

Does anyone have any concrete examples where the locale affecting
meaning/matching of \d causes real problems?

I'm assuming the worst case is it matches too much, e.g. picks up
spurious Chinese numerals, which seems like a wildly improbable edge
case for most datasets+patterns. Presumably there isn't a situation
where \d _doesn't_ match [0-9] at least? In other words [0-9] is a
subset of \d for all locales.

$ export LC_CTYPE=zh_CN.utf-8
$ perl -Mlocale -Mutf8 -le 'print 一 =~ /\d/'  # 1

Doesn't print 1 - why?

$ export LC_CTYPE=zh_CN.utf-8
$ perl -Mlocale -Mutf8 -le 'print 三 =~ /[一-六]/'  # 3 in 1-6? Yes
1
$ export LC_CTYPE=en_US.utf-8
$ perl -Mlocale -Mutf8 -le 'print 三 =~ /[一-六]/'
1

Why is it still 1? OS X with Perl 5.16.2

Paul



Re: Deploying perl code

2014-07-24 Thread Paul Makepeace
On Thu, Jul 24, 2014 at 2:47 PM, Schmoo schmoos...@gmail.com wrote:
 On 24 July 2014 22:31, Paul Makepeace pa...@paulm.com wrote:
 On Thu, Jul 24, 2014 at 2:06 PM, James Laver james.la...@gmail.com wrote:

 Then I’ll double down on my capistrano/tak recommendation.

 capistrano is a (the?) winner for sure.

 Why do these new fangled things all have such off-putting names?


I'm sure the Italians have a similar opinion of Huddersfield.



Re: Finding the intersection between two regexes

2014-04-22 Thread Paul Makepeace
On Tue, Apr 22, 2014 at 4:16 AM, David Cantrell da...@cantrell.org.uk wrote:
 On Sun, Apr 20, 2014 at 10:14:48PM -0400, 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?

 I do actually have a use for it, which would help to explain the
 question.

 A large part of Number::Phone is based on data in google's
 libphonenumber project. That has, for most countries, regular
 expressions that match valid fixed lines and valid mobiles. For some
 countries those two regexes can both match some of the same numbers.
 Here's the data:
   http://goo.gl/hTBAhZ

 If you look at the data for Barbados, they have for fixed lines:
   246[2-9]\d{6}

 and for mobiles:
   246(?:(?:2[346]|45|82)\d|25[0-4])\d{4}

I'd go out on a limb and say that the complete list of overlapping
situations all share a /^prefix/ like this. (This doesn't necessarily
help you since you'd have to exhaustively falsify it but if you're
going for the quick win I bet just looking for prefixes gets you
most/all of the way.)

 then some strings will match both expressions - 246230, for example.
 But if you look at the data for Jamaica there are no strings that match
 both regexes.

 At the moment I detect these overlaps (and then throw the regexes away
 as being unfit for my purpose) by just going through each country's
 number space. This is practical for NANP countries as I can do it
 all with only about a million comparisons in the worst possible case. It
 would be impractical to apply this to the whole world though.

If your goal is to simply identify overlaps rather than generate
encompassing regexes, you could try attacking it with
intelligently/heuristically generated random numbers.

Paul


 --
 David Cantrell | Bourgeois reactionary pig


Re: XP-Replacement for Parents

2014-03-28 Thread Paul Makepeace
On Fri, Mar 28, 2014 at 2:55 AM, david da...@chromiq.org wrote:

 Thread drifting for a moment, do folks have any recommendations for where to 
 buy reasonably priced, legal Win 7 licenses ? I really should upgrade my 
 compatability platform...

The trick is to go for the OEM license. This is cheaper because
you're opting not to hassle MS for support.

http://www.newegg.com/Product/Product.aspx?Item=N82E16832116986

Paul


Re: tablets for parents

2014-03-02 Thread Paul Makepeace
On Sun, Mar 2, 2014 at 1:37 PM, Martin A. Brooks mar...@antibodymx.net wrote:

 I don't think I would recommend trying to videoconference over a 3G 
 connection.  Not as anything other than a one-off emergency thing, anyway.


Works fine in my experience in the US, which on balance has a shittier
phone network than any other first world country I've visited. YMMV
etc

Paul


Re: sub signatures coming

2014-02-25 Thread Paul Makepeace
On Feb 25, 2014 7:16 AM, James Laver james.la...@gmail.com wrote:


 On 25 Feb 2014, at 11:31, Matt Lawrence matt.lawre...@virgin.net wrote:

  On 25/02/14 11:18, James Laver wrote:
 
  But I probably already have List::MoreUtils imported (because Perl).
 
  sub pairwise_sum ($a1, $a2) {
zip @$a1, @$a2;
  }
 
  And lets ignore the fact that the perl version that was used in the
article was buggy. If $arg2 is shorter than $arg1 it breaks. zip's supposed
defined behaviour is to stop when either list runs out of elements.
 
  Whereas this one is buggy because it doesn't actually do what it says
on the tin. Where's the summation?
 
  Matt

 Ah yes. I'd just woken up.

 sub pairwise_sum($a2,$a2) {
   map {shift($_)+shift($_)} (zip @$a1, @$a2);
 }

You aren't making a good case for perl here :)


 James


Re: sub signatures coming

2014-02-24 Thread Paul Makepeace
On Mon, Feb 24, 2014 at 2:04 PM, Steve Mynott steve.myn...@gmail.com wrote:
 http://perltricks.com/article/72/2014/2/24/Perl-levels-up-with-native-subroutine-signatures

Finally. But don't believe the python/perl comparison troll, as
python, for once, actually outguns perl on a character chomping basis,

sub pairwise_sum ($arg1, $arg2) {
return map { $arg1-[$_] + $arg2-[$_] } 0 .. $#$arg1;
}

def pairwise_sum(list1, list2):
return [i + j for i, j in zip(list1, list2)]

Paul


Re: Main general Perl mailing list

2014-02-12 Thread Paul Makepeace
On Wed, Feb 12, 2014 at 9:17 AM, Dave Hodgkinson daveh...@gmail.com wrote:
 ...or the IRC channels for the thing you're having problems with.

Some people, when confronted with a problem, think I know, I'll ask
on IRC.  Now they have two problems.

:)


Re: Recommended IDE...?

2014-01-19 Thread Paul Makepeace
On Sat, Jan 18, 2014 at 8:39 AM, Peter Corlett ab...@cabal.org.uk wrote:
 On Fri, Jan 17, 2014 at 10:18:14AM -, Andrew wrote:
 Looking to try using an Integrated Development Environment.

 Why? What problem are you having that you expect an IDE to solve?

He wants to *try* it.

 The features I find most compelling in IDEs is background parsing to
 immediately spot syntax errors and be able to auto-complete or otherwise spot
 typoes or confusion about what type a method returns. However, this only 
 really
 works with statically-typed compiled languages such as Java. Perl is very much
 the antithesis of Java and you don't really get these benefits.

Yes you do. It's 2014; parsing dynamic languages in IDEs is largely
solved. Any difficulty in finding such a thing for Perl is more a
reflection of Perl's status as a language in 2014 than any intrinsic
technical difficulty.

 They also provide various hot keys and shortcuts to perform test compiles, VCS
 integration and whatnot, but that's really only of marginal benefit.

Says you. Maybe the OP would like to *try* it and not have someone
second guess their own motivations  preferences? Maybe they've read
something like http://www.jetbrains.com/ruby/features/ and thought
wouldn't they like that for perl?

These oh but emacs/vi/nano is great! responses are really irrelevant.

Paul


Re: Recommended IDE...?

2014-01-17 Thread Paul Makepeace
On Fri, Jan 17, 2014 at 8:27 AM, Kent Fredric kentfred...@gmail.com wrote:
 I'm curious what the definition of Integrated means in this context.

Think of it as already integrated :)

Sure you could make your editor do stuff like an IDE but the IDE
*already does it*.

The scripting IDEs from JetBrains do dynamic code parsing and it's
good enough to appear to be black magic.

The rest of your answer and several others in this thread (not to be
combative) is pretty much the I'm Not Familiar With IDEs So I'm Going
To Be Dismissive of Them and Rationalize Why They Suck Anti-Pattern.
This is an anti-pattern because the OP asked for IDE recommendations
not for any existential commentary.

Paul


Re: Regex teaser

2013-12-04 Thread Paul Makepeace
On Tue, Dec 3, 2013 at 5:03 PM, Mark Fowler m...@twoshortplanks.com wrote:
 On Tue, Dec 3, 2013 at 6:54 PM, Paul Makepeace pa...@paulm.com wrote:

 $ perl -le '($a = aabbb) =~ s/b*$/c/g; print $a'

 This is where tools like Regexp::Debugger shine.  Running

  perl -le 'use Regexp::Debugger; ($a = aabbb) =~ s/b*$/c/g; print $a'

 Shows exactly why it gives the output it does (if you hit n for next a lot)

Can't use an undefined value as an ARRAY reference at
/Library/Perl/5.16/Regexp/Debugger.pm line 499.

Glad we're not the only ones confused by it ;-) But yeah that's neat.
I don't agree it shows WHY as much as HOW.

The puzzle comes down to whether the $ is part of the first b*
capture. IMO it is (and python seems to agree). Why the engine
restarts having captured as much as it can to the very end strikes me
as counter intuitive. Almost, if not actually, bug-like.

So, Part II:

Construct an elegant* regex (in perl!) to ensure the end of the string
contains string:

is(fqdn('foo'), 'foo.example.com')
is(fqdn('foo.example.com'), 'foo.example.com')

Paul

* I realise this is hilariously open to interpretation but you'll know
what I mean either way


Re: I have a bikeshed, colour suggestions appreciated

2013-12-03 Thread Paul Makepeace
On Tue, Dec 3, 2013 at 3:21 PM, Kent Fredric kentfred...@gmail.com wrote:

 I would just like to convey my disappointment that mauve.bikeshed.org
 renders as blue.

Wait 'til you see http://cream.bikeshed.org/

I think we should table a meeting to discuss a revised painting review
process going forward.

Paul


Re: filesystems for external drivesx

2013-11-01 Thread Paul Makepeace
On Fri, Nov 1, 2013 at 6:30 AM, Nicholas Clark n...@ccl4.org wrote:

 Dear knowledgeable hive mind,

 1) I can mount NTFS read/write on Linux. But is there any good way on Linux
to correctly copy files from one NTFS file system to another, preserving
everything? (specifically Alternate Data Streams, which I see that I have
here, when I mount said file system read-only on OS X)
 2) Is there any sane choice of file system to use which will mount read/write
on both Linux and OS X, and support at least basic POSIX features?
(ownership, permissions, hard links) (on Snow Leopard, if it matters)

Personally, I'd just drop the $40 and get this,

http://www.paragon-software.com/home/extfs-mac/

Or you can go the free route (YMMV), http://osxfuse.github.io

Yet another option that's worked for me in the past is running a Linux
VM and sharing it over Samba. Not as painful/unreliable as I was
expecting.

 3) Is there any Linux equivalent to OS X sparse bundles?
(And if the answer to that is yes, I guess it mostly doesn't matter, as one
just formats the disk as FAT32, and makes images on top of it)

http://www.debian-administration.org/articles/664 - worth a shot?

Paul


Re: ORMs du jour?

2013-10-21 Thread Paul Makepeace
On Tue, Oct 22, 2013 at 12:19 AM, Peter Corlett ab...@cabal.org.uk wrote:

 Much of the blog post can be basically summed up by the languages I use are 
 too verbose, error-prone and inflexible that an ORM does not win me 
 anything[0]. Which is something I quite agree with.

In case anyone was considering actually reading it, this is a pretty
inaccurate summary IMO. There's a small section on verbosity but
considering Active Record is referenced it's by far not the most
pressing concern the author covers by a long way.

It's a long article and does capture pretty thoroughly the impedance
mismatches and gotchas with trying to bridge OO/RDBMS. One of the best
I've read. Even if you're fully committed to ORMs, and there are many,
many great reasons and fully justifiable scenarios to go with one in
our current environment (prevalence of built-from-scratch, lightweight
webapps), knowing the potential pitfalls down the road is important.

Paul


Re: Perl publishing and attracting new developers

2013-09-19 Thread Paul Makepeace
On Thu, Sep 19, 2013 at 2:49 AM, Philippe Bruhat (BooK) 
philippe.bru...@free.fr wrote:

 Some of the secret ops are actually awesome, used in production code,
 and deserve to be better known. From the top of my head: 0+ !! @{[]} ()x!!


Seriously. Perl's lack of a string eval interpolation operator (à la Ruby's
#{...}) is a real hole in the language.

Paul


Re: Perl publishing and attracting new developers

2013-09-19 Thread Paul Makepeace
On Thu, Sep 19, 2013 at 4:21 PM, Peter Corlett ab...@cabal.org.uk wrote:

 If somebody new discovers Perl and uses it, that's great. If they don't, I'm 
 cool with that too.

Well if perl doesn't attract new developers, and the existing user
base is a diminishing set, perl will eventually run out of developers.
But maybe you don't care about that too, and you'll be alone in your
shed with your aging perl binary Commodore 64... ;)

Paul


Re: Perl 5.16 vs Ruby 2.0 UTF-8 support

2013-08-22 Thread Paul Makepeace
On Thu, Aug 22, 2013 at 8:39 AM, gvim gvi...@gmail.com wrote:

 The problematic mail file doesn't display any non-ASCII characters when
 opened in Vim. Here's the Ruby 2.0 error message:


How about when you hexdump it?


Re: Perl 5.16 vs Ruby 2.0 UTF-8 support

2013-08-22 Thread Paul Makepeace
On Thu, Aug 22, 2013 at 9:15 AM, gvim gvi...@gmail.com wrote:

 On 22/08/2013 17:05, Paul Makepeace wrote:

  How about when you hexdump it?


 I wouldn't know but here's the result of hexdump -C (literal text removed
 from line end):


You're looking for high bits in the characters, as a first pass. High bit
is 0x80-0xff,

$ perl -lane 'shift @F; print if @F =~ /\b[89a-f]/i'  dump
0560  75 67 68 74 20 66 6f 72  20 75 6e 64 65 72 20 a3

Paul


Re: while in London

2013-08-20 Thread Paul Makepeace
On Tue, Aug 20, 2013 at 8:34 AM, Diana Donca diana.do...@evozon.com wrote:

 I'm Diana Donca, member of cluj.pm.


I read this quickly and thought that was one of those non-geographic cute
.pm's referring to http://en.wikipedia.org/wiki/Kludge but actually it's a
place in Romania. Welcome (soon) to London!

Paul (himself in Cupertino but that doesn't matter)


Re: Using grep on undefined array

2013-08-14 Thread Paul Makepeace
On Wed, Aug 14, 2013 at 9:35 AM, Avishalom Shalit avisha...@gmail.com wrote:
 wait, aren't $a and $b special  ?
 (they magically live for {$a=$b} etc. )

IIRC, they're local'ised within the sort block.

You can try it yourself,

$ perl -wle 'print a=$a (pre init); $a = 5; @f = sort {print a=$a
b=$b (in sort); $a = $b} (2,1); print a=$a (later)'
Name main::f used only once: possible typo at -e line 1.
Use of uninitialized value $a in concatenation (.) or string at -e line 1.
a= (pre init)
a=2 b=1 (in sort)
a=5 (later)

Paul


Re: Using grep on undefined array

2013-08-13 Thread Paul Makepeace
On Tue, Aug 13, 2013 at 4:09 PM, Andrew Beverley a...@andybev.com wrote:

 my $select_fields = $fields ? join(',', map { 'users.' . $_ } @fields)
 : '*';


my $select_fields = @fields ? join(',', map { 'users.' . $_ } @fields)
: '*';

?

Maybe a lesson in variable naming there ;-)

Paul


Re: Using grep on undefined array

2013-08-13 Thread Paul Makepeace
On Tue, Aug 13, 2013 at 4:09 PM, Andrew Beverley a...@andybev.com wrote:

 get();
 sub get($)


(You probably know this but calling get() like that, i.e. before it's
declared, is denying perl the chance to enforce the subroutine
prototype.)


Re: Assigning anonymous hash to a list

2013-07-31 Thread Paul Makepeace
On Wed, Jul 31, 2013 at 10:37 AM, Peter Corlett ab...@cabal.org.uk wrote:

 On Wed, Jul 31, 2013 at 01:04:11PM -0300, Hernan Lopes top-posted:
  it should be the same size to do what he wants... otherwise it wont work.

 Why should? Perl doesn't require the LHS of an array assignment have the
 same
 number of elements as the RHS, and there are a number of use cases where
 you
 may not want it.


Indeed. E.g.,

my ($arg1, $arg2, $..., @...) = @_;  # is covered early on in a perl
neophyte's training

Paul


Re: Why I give up my talk in YAPC

2013-07-03 Thread Paul Makepeace
On Wed, Jul 3, 2013 at 9:46 AM, Mark Fowler m...@twoshortplanks.com wrote:

 On Wednesday, 3 July 2013 at 11:10, Daniel de Oliveira Mantovani wrote:
  in #perl at freenode

 freenode is…well, freenode.  Most people on this list would not consider
 it the 'home' of Perl on irc.


irc.perl.org doesn't consider itself 'home' either :)

http://www.irc.perl.org/faq.html
http://www.irc.perl.org/channels.html

Paul



 We mainly use irc.perl.org (where we have our own #perl) and this Perl
 monger group even has its own channel #london.pm

 Hope to see you around.

 Mark.




Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Paul Makepeace
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?

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: New pet keeping rules in the Netherlands

2013-06-19 Thread Paul Makepeace
On Wed, Jun 19, 2013 at 1:25 PM, Dirk Koopman d...@tobit.co.uk wrote:
 An URL in English:
 http://www.dutchnews.nl/news/archives/2013/06/new_official_rules_you_can_kee.php

The approved list contains animals such as dogs, cats, hamsters, mink
and water buffalo.

I'm sorry but one of these animals is not like the others... (hint:
it's the one that can weigh half a tonne)


npm, PyPi overtake CPAN

2013-05-23 Thread Paul Makepeace
http://modulecounts.com/

... with Rubygems screaming ahead since overtaking CPAN a couple of years
ago. And the hugeness of Maven Central.

I'm sure there's plenty of caveats etc but the gradients is probably what's
most interesting here; CPAN is relatively static compared with, well, all
the others.


Re: ISNIC DNS

2013-05-08 Thread Paul Makepeace
On Wed, May 8, 2013 at 2:06 AM, Dave Cross d...@dave.org.uk wrote:
 The IP address 2001:1850:1:0:107:0:0:d of nameserver fns1.dnspark.net is
 missing its PTR record or has an incorrect PTR record.

$ host 2001:1850:1:0:107:0:0:d
Host d.0.0.0.0.0.0.0.0.0.0.0.7.0.1.0.0.0.0.0.1.0.0.0.0.5.8.1.1.0.0.2.ip6.arpa
not found: 3(NXDOMAIN)

Why not just add that PTR (IP - name) and be done with it?

Paul


Re: Ungooglable interview questions (was: Re: New perl features?)

2013-03-17 Thread Paul Makepeace
On Sat, Mar 16, 2013 at 6:54 PM, Sam Kington s...@illuminated.co.uk wrote:
 I'm slightly concerned that the specific questions are susceptible to being 
 googled. Does anyone have any good examples of non-googlable interview 
 questions that could be answered (or not) over IRC or a similar medium? The 
 usual standby, asking people to write code during their interview, obviously 
 doesn't work when someone can google, cut and paste.

In practice it's probably too hard to copy  paste code content for an
interview.

Even if it weren't it's easy for you as an employer to ask questions
about said code to test understanding. Everything from explain the
syntax of that declaration to explain your choice of top level
algorithm to what other ways could you achieve this small
aspect/large aspect/entire thing plus you can always insist they TDD
the solution; that happened to me recently for a ruby gig and so I
wrote a nano-test framework since I couldn't remember the APIs of
anything outside of rspec :D

Going further you can start to ask variations like the same program
with different inputs, outputs, performance characteristics (running
on VM v. metal), different environments (your network is really
laggy, how would that affect it? How would you mitigate?), different
languages (what programming languages have you used that might be
more suited to this  why? any that would be awful for it?)

I've seen a colleague who had a fake question that had an answer
online he'd written to catch people searching for the question, so
there's that too ;-)

Paul



Re: Perl School 4: Database Programming with Perl and DBIx::Class

2013-02-07 Thread Paul Makepeace
On Thu, Feb 7, 2013 at 4:09 AM, Dave Cross d...@dave.org.uk wrote:
 I think the best programmers don't stick with the language they know. I
 think they see a new language as largely a case of learning new syntax and
 enjoy having a number of languages to choose from so they can use the best
 one for each individual task.

I feel this is a well-worn trope but not actually how it works except
for possibly very small one-off projects. Learning and being
productive in a language is far more than just syntax; in fact that's
probably the easiest part since they're largely the same, unless
you're learning something radically different. By far the lion's share
of the work is the libraries, error messages, documentation, and
toolchain.

From my own experience, if I'm day-to-day productive at a
being-paid-for-it level in say Perl, I tend to swap out a bunch of
Python knowledge. Sure, I can swap it in, but as ever there's quite a
cost to that. Spending one's day constantly referring to Stack
Overflow, Google, CPAN, and perldoc is workable but it's slow. Using
say Perl + JavaScript is do-able but it requires IME daily use of
both.

Conclusion: unless Language X was compellingly amazing at Task A I'd
do my best to solve Task A with Language I'm Most Familiar With These
Days.

Curious how others approach this.

Paul


Re: Updating lots of database fields in a single row

2013-01-24 Thread Paul Makepeace
On Jan 24, 2013 8:48 AM, Greg McCarroll g...@mccarroll.org.uk wrote:



 No no no, lets just use any language that our process analyst consultant
decides - they can come up with a long winded approach to software
development that will ensure the lack of any possible security holes by
providing long winded documentation to auditors and by selecting whatever
language/toolset was cool about 10 years ago.

So we're using Perl still then? :D

P


 G.



Re: cpan you have to see

2012-12-14 Thread Paul Makepeace
On Fri, Dec 14, 2012 at 4:23 PM, David Cantrell da...@cantrell.org.uk wrote:
 $ true  echo it was true

This makes sense. Think of true as thing that succeeded rather
than OMG it's 0 so must be false!!1!

Ruby treats everything as true unless it's nil or false (so yes, 0 and
'' are true). Bit weird to get used to but all this other nonsense
goes away.

Paul


Re: Perl outreach

2012-11-26 Thread Paul Makepeace
On Mon, Nov 26, 2012 at 10:36 AM, Dirk Koopman d...@tobit.co.uk wrote:
 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.

There's possibly an easier explanation than any conspiracy theory.

At some point perl fell out of favour to PHP with the CGI process
start up problem, and mod_perl's complexity and perhaps even early
bugginess (perceived or actual). At that point its usage declined and
it got stuck in a positive (in the control theory sense) feedback
loop: usage drops, so a business case needs to be made to counter
usage dropping, so usage drops, GOTO 10. Meanwhile other languages
(PHP, Python, Java, Ruby) catch up and surpass Perl, each on their own
various dimensions: PHP's ease of install, Python's relative language
simplicity, Rails having a big successful commercial backer, Java an
enormous subcontinent of cheap labour, etc.

Now, Perl in a sense has two problems: its relatively low usage, and
that the other languages  frameworks have caught up  in some cases
surpassed Perl's, so Perl's advantages over other options just aren't
seen as that compelling.

Perhaps Perl's biggest problem though is it still uses - as a method
invocation operator. (Heh, kidding… kinda… not ;)

Anyway, those are the two areas I would look into: 1) getting real
stats on perl's usage and seeing whether the perception matches
reality -- maybe there is a dark pool of perl users that aren't
being counted 1b) making perl more accessible, e.g. meetup.com,
facebook, etc rather than just this mailing list 2) drawing up a list
of really compelling reasons why perl is a good fit for various tasks.
And possibly being OK with the battle having been lost in the
short/medium term on various fronts (web frameworks)

Key IMO is acknowledging the power of perception: maybe perl is
amazing at X, Y, Z but if it's not perceived that way some marketing
is needed rather than intellectual discussion.

Paul



Re: 25 Years of Perl

2012-11-24 Thread Paul Makepeace
On Fri, Nov 23, 2012 at 12:01 AM, Uri Guttman u...@stemsystems.com wrote:
 On 11/23/2012 02:43 AM, Andrew Savige wrote:

 Live Perl Golf Apocalypse 2000 at TPC 4, aka uri's triumph.


 wow. that was a painful event. saved by damian's fill in talk and forgiven
 by gnat. it was a team failure, so i can't take all the credit. iirc nfs
 didn't work well on the donated boxes or some similar issue we couldn't test
 for. it was way too ambitious and should have been a much simpler contest.

Ah yes, good times. O'Reilly handed out some awards in the form of
book credits ($50?) for this, and being the epic procrastinator I
never got around to using it - 'til a few months ago, i.e. twelve
years later. Incredibly, and awesomely, O'Reilly honoured it.

Paul


Re: 25 Years of Perl

2012-11-23 Thread Paul Makepeace
I'd agree with you on python but I can say the Ruby community is packed
full of nutballs and is very entertaining. Probably not too surprising
considering ruby's perlish origins. So perhaps chalk that up to perl too ;)


Written on my phone
On Nov 23, 2012 6:57 PM, Uri Guttman u...@stemsystems.com wrote:

 On 11/23/2012 08:30 PM, James Laver wrote:

 On 24 Nov 2012, at 00:36, Uri Guttman u...@stemsystems.com wrote:


  yapc has yet to be properly copied. no one else delivers more bang for
 the buck and fun as well.

 mjd invented lightning talks and they are at many confs now, not just
 lang ones. another perl invention with no credit given.


 How are these perl inventions? They are community inventions.


 perl forms the core of the community and attracts the developers who add
 to the community. it is hard to separate them. i have told this to people
 about why i like perl and why perl has so many smart hackers. any community
 that would allow Acme:: and lauds it, has something special there. it stems
 from larry and timtowtdi and encouraging and allowing for creativity. humor
 is a part of that. i know larry fairly well and we all have seen his sense
 of humor. i met guido once at oscon and he seemed to have no fun even when
 putting a pie in dan sugalski's face. ask a python coder about the fun of
 the lang. ask them if they would sanction an Acme:: like name space. even
 the choice of Acme is funny!

 our community has more fun. that is a win for perl. :)

 uri




Re: 25 Years of Perl

2012-11-22 Thread Paul Makepeace
On Thu, Nov 22, 2012 at 6:05 PM, Sam Kington s...@illuminated.co.uk wrote:

 Some mention should be made also of the attempt to rewrite the entire Unix
 support structure in Perl - things like ls, find, head etc. I don't think
 this ever went very far, and it appears to be very difficult to Google if
 it's still around, but I remember this being important at the time.


http://search.cpan.org/dist/ppt/

And some history on what happened,
http://computer-programming-forum.com/53-perl/94afef039a9112e6.htm

Paul


Re: Duct Tape Quotation

2012-11-19 Thread Paul Makepeace
On Mon, Nov 19, 2012 at 3:03 PM,  andrew-per...@mail.black1.org.uk wrote:
 1995   Economist 1 JulyThe..servers that make up the most
 popular part of the Internet are often written in Perl, and
 virtually all Web-based information exchanges are handled with the 
 language.

How the mighty have fallen…

Paul



BritRuby 2013

2012-10-04 Thread Paul Makepeace
A niche perl-based language is having its first UK-wide conference
http://2013.britruby.com/cfp (with an all-star cast mostly from the
US, afaict)

:)

Paul


Re: Available...

2012-10-01 Thread Paul Makepeace
Do you shout your name because some recruiters shout PERL?


Re: Brainbench perl test?

2012-09-06 Thread Paul Makepeace
On Thu, Sep 6, 2012 at 12:56 PM, Uri Guttman u...@stemsystems.com wrote:
 maybe i overstepped in calling that a serious coder filter. i would never
 just use that determining a skilled coder. it could be useful to filter out
 the total losers. i speak to hiring managers all the time and they give out
 similar tests just to filter out the losers.

There seems to be some evidence that even trivial problems are a good
way of filtering,

http://www.codinghorror.com/blog/2010/02/the-nonprogramming-programmer.html
(and neighboring posts)

is an interesting  entertaining ( slightly disturbing) read.

I can't imagine scheduling an in-person interview without a phone
screen and ideally a github link beforehand.

Paul


Re: Brainbench perl test?

2012-09-06 Thread Paul Makepeace
On Thu, Sep 6, 2012 at 2:49 PM, David Hodgkinson daveh...@gmail.com wrote:
 I like the FizzBuzz test. Not far removed from what I was hit with today.

Talking of which, here's a fizzbuzz solution that's one of the most
amazing presentations I've seen. It's Ruby but if you understand
lambdas/coffeescript you can follow along,

http://experthuman.com/programming-with-nothing
http://rubymanor.org/3/videos/programming_with_nothing/ (video; more fun)

Paul


Re: Brainbench perl test?

2012-09-05 Thread Paul Makepeace
On Wed, Sep 5, 2012 at 9:35 AM, Abigail abig...@abigail.be wrote:
 Your first instinct should be Is there a generating function I can use?.

Try not to blow your cache pipeline with all that silly branching,

sub fib {
  my $n = shift;
  int(0.5 + (0.5+0.5*sqrt 5) ** $n / sqrt 5);
}

High five! :-)

Paul


Re: Brainbench perl test?

2012-09-04 Thread Paul Makepeace
On Tue, Sep 4, 2012 at 9:18 AM, David Hodgkinson daveh...@gmail.com wrote:
 When was the last time you recursed in day to day web type code?


A few weeks ago.

It's a flawed premise in any case. There's plenty of techniques and
ideas professionals don't make routine use of but you'd be pretty
unimpressed if they didn't know how to do it.

Paul


Re: Brainbench perl test?

2012-09-04 Thread Paul Makepeace
On Tue, Sep 4, 2012 at 9:59 AM, Chris Jack chris_j...@msn.com wrote:
 I haven't yet had a problem which I felt was worthwhile of a memo-ized 
 solution - but that might just be indicative of the sort of perl work I do.

While memoization is a perfect fit for this solution a) the ability to
spot the need for a cache b) have a stab at implementing it, would be
two things I'd be looking out for.

Just adding,

my %fib_cache;
sub fib {
   my $n = shift;
   return $fib_cache{$n} if defined $fib_cache{$n};
   # …
   $fib_cache{$n} = $answer;
}

would be a good start.

If you're working in the web and haven't added memcached to something,
that would strike me as surprising.

 If you haven't read up on web security issues, SQL injection is not 
 immediately obvious and there are various legitimate reasons for avoiding 
 bind variables.

If you're working in the web and you haven't read up on web security
issues, you need to go do that before applying for any jobs in web. If
you haven't worked in the web, fair enough, ish.

I do agree on pet subjects - I was amazed to be asked a bit fiddling
question in an interview last year (not that I was complaining, having
grown up on 8bit assembly…)

Paul



Re: Can I get some advice on best way to start Perl Programming

2012-08-31 Thread Paul Makepeace
On Fri, Aug 31, 2012 at 4:16 AM, Rick Deller r...@eligo.co.uk wrote:
 Hi all,

 I have brought  a couple of books on the subject which I'm reading through

 I'm very keen to learn more and how to do it

 Can anyone suggest more books or another way of doing it ?

You don't say specifically Perl so I'm going to suggest a similar language:

An excellent start to get your feet wet that takes about 15 minutes,
is quite fun, and you actually do some programming without having to
set everything up on your computer is, http://tryruby.org/

Paul


Re: Can I get some advice on best way to start Perl Programming

2012-08-31 Thread Paul Makepeace
On Fri, Aug 31, 2012 at 4:50 PM, Uri Guttman u...@stemsystems.com wrote:
 You don't say specifically Perl so I'm going to suggest a similar
 language:


 check the subject! :)

Oops!

Well the rest of ya can learn from the wonder of tryruby.org :)


Re: Brainbench perl test?

2012-08-28 Thread Paul Makepeace
On Tue, Aug 28, 2012 at 11:09 AM, Uri Guttman u...@stemsystems.com wrote:
 i also did it way back and didn't like it then. multiple choice tests in
 general suck for actual testing of real world skills and programming ones
 suck even more. no candidate i have reviewed in ages has ever mentioned
 brainbench nor has any client. so in my world it is a non-entity. i know of
 several take home tests from clients that i review or see the answers and
 they tell me much more than any 'cert' could do. so does reviewing of
 existing code samples. there is no reason to even consider a timed multiple
 choice test.

When I interviewed at the BBC they had me do Brainbench. It seemed
like a fair, reasonably challenging test. The BBC is a pretty decent
employer so I'd consider that a reason to do a timed multiple choice
test ;-)

From an employer's side - it's practically no cost to them on top of
their existing recruitment efforts, and has a bunch of benefits
associated with involving an unconnected third party.

Paul


Re: [OT] Prepaid mobile plans with data, possibly roaming

2012-08-23 Thread Paul Makepeace
The charge is to attempt to mitigate the Tragedy of the Commons which would
affect everyone else so just fork over the cash already ;)

In practice that all said I've never run into any restrictions with T
Mobile but I also don't take the piss so who knows...

Written on my phone
On Aug 22, 2012 11:29 PM, Toby Wintermute t...@wintrmute.net wrote:

 On 23 August 2012 00:41, Anthony Lucas anthonyjlu...@gmail.com wrote:
  They just want you to buy their tethering add-on and mifi products.

 It's probably simpler for me to just pay for the damn tethering
 add-on, but part of me is annoyed at the restriction and wishes to try
 to bypass it :)

 I'll try VPNing back to my shell account and see what happens.. can't
 be any slower than 3G already is..

 TC



Re: Professional Indemnity

2012-05-01 Thread Paul Makepeace
On Tue, May 1, 2012 at 12:43, Sue Spence s...@pennine.com wrote:
 On 1 May 2012 20:09, Dave Hodgkinson daveh...@gmail.com wrote:

 The renewal notice I just got made my eyes water. Two things:

 1. When you're not working for the BBC, what levels do you set it at?

 2. Are Caunce O'Hara still the go to people for this?


 How are you defining 'go to' ?  I haven't spoken with anyone who has
 actually needed to make a claim on their PI insurance and I didn't
 find any reviews I felt I could trust on the subject.  I recently
 found Caunce O'Hara rather expensive (seems I'm not the only one) and
 got my business insurance from Hiscox in the end.  Until I make a
 claim on the policy I can't say for sure whether they were the correct
 choice...

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

Paul



Re: Free online courses in computer science / maths + others

2012-04-26 Thread Paul Makepeace
On Thu, Apr 26, 2012 at 06:41, Adam Witney awit...@sgul.ac.uk wrote:

 Some of these courses may be of interest to the people here

 https://www.coursera.org/

 .. and they're free!

I'm most of the way through
https://class.coursera.org/nlp/auth/welcome Natural Language
Processing and it's been excellent.

Unless you're a prodigiously talented programmer with a solid maths
background I'd caution against doing more than one at a time with a
full time job: the assignments at least on this course are no joke.
Their 10-15 hrs/week estimate is about right, if possibly on the low
side if you want to score well.

Paul


Re: Programming Heresy

2012-03-30 Thread Paul Makepeace
On Fri, Mar 30, 2012 at 08:20, Uri Guttman u...@stemsystems.com wrote:
 in years (and decades) past, i did some coding on source printouts. i could
 do it anywhere including outside which i enjoyed immensely. my coding on
 paper was scribbles, crossed out code, arrows moving things around, very
 fugly pseudocode notation only i could decipher, etc. often it was just
 enough to make me remember my ideas which i could then type up on a
 keyboard. i could be very creative when coding on paper like that (in or
 outdoors) but i still have fond memories of outdoor sessions in the shade
 under sunny skies. :)

Me too. I actually found these paper sessions some of the most
productive ever. Just recently I had my head in a bunch of confusing
object relations and wished for the soothing sound of a dot matrix
(shows last time I did it) that would let me see wtf was going on…

Paul



Re: IPv6 addresses

2012-03-12 Thread Paul Makepeace
On Sun, Mar 11, 2012 at 15:43, Chris Dennis cgden...@btinternet.com wrote:
 Hello folks

 I'm hacking together a quick script to parse the output from the 'ip'
 command on Linux, e.g.

 $ ip a s
 1: lo: LOOPBACK,UP,LOWER_UP mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
 2: eth0: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc mq state UP qlen
 1000
    link/ether 00:19:b9:06:4c:86 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.7/24 brd 192.168.1.255 scope global eth0
    inet6 2001:dead:beef:cafe::1/64 scope global dynamic
       valid_lft 86147sec preferred_lft 14147sec
    inet6 fe80::1/64 scope link
       valid_lft forever preferred_lft forever

 -- which is straightforward.  But then I need to process the IPv6 addresses
 to be able to extract subnet prefixes etc.

$ /sbin/ifconfig  | perl -MRegexp::IPv6=\$IPv6_re -lne
'/(?:($IPv6_re)(\/\d+))/ and print net $1 size $2'
net fe80::fcff:ff:fe00:5272 size /64
net ::1 size /128

HTH,
Paul


 CPAN has so many IPv6-mangling modules that I don't know which to choose, or
 which will emerge as the best/most stable etc. in the future.  Certainly
 some of the ones I've looked at are badly written or badly documented or
 just plain broken.

 Any recommendations?

 cheers

 Chris
 --
 Chris Dennis                                  cgden...@btinternet.com
 Fordingbridge, Hampshire, UK



Re: [ANNOUNCE] London Perl Mongers Technical Meeting 2012-04-11

2012-03-05 Thread Paul Makepeace
On Thu, Mar 1, 2012 at 03:48, Peter Corlett ab...@cabal.org.uk wrote:
 On Wed, Feb 29, 2012 at 11:33:10AM +, Mike Whitaker wrote:
 [...]
 Joking aside - I don't think this is the kind of talk one attends because
 it will be directly useful in my day to day work, but rather because
 it's DC, and you don't get the chance very often

 I've seen a video of this talk, got to the end, pushed my brain back in
 through my ears, and decided to watch it again. The lucky people who got
 tickets for this are in for a treat.

I was going to ask if this talk was going to be taped (and also hoping
it wouldn't turn into a huge pro/con discussion at the same time)

If it's around on a back-channel I'd love to check it out too, pretty please :)

Paul


Who is NS admin for london.pm.org / Exonetric?

2012-02-15 Thread Paul Makepeace
I*'ve been an NS for london.pm.org for years and, after slightly fewer
years of noting it's been failing, am finally wondering who's in
charge / can fix the fact that 89.16.178.168 is being denied zone
transfers for london.pm.org. I'm assuming someone at Exonetric, the
other NSs that aren't Matthew.

One of my others, ns3.realprogrammers.com, doesn't exist any more so
ideally that'd be pulled from the list too while we're fixing things.

Paul

*not personally, ns1.realprogrammers :)


Re: Who is NS admin for london.pm.org / Exonetric?

2012-02-15 Thread Paul Makepeace
Fab, thanks, Mark -

transfer of 'london.pm.org/IN' from 178.250.72.132#53: Transfer
completed: 3 messages, 10 records, 411 bytes, 0.137 secs (3000
bytes/sec)

Paul

On Wed, Feb 15, 2012 at 15:28, Mark Blackman m...@exonetric.com wrote:
 Hi,

 Myself and Marcus Lauder handle the master NS for london.pm.org at Exonetric.

 I'm not sure how 89.16.178.168 dropped off the list of permitted AXFR clients,
 but it should be back on the list now and we've pulled ns3.realprogrammers.com
 from the NS list.

 I'm guessing you discovered we've been making big IP changes in the last week
 or so.

 Let us know what you find.

 Cheers,
 Mark

 On 15 Feb 2012, at 23:17, Paul Makepeace wrote:

 I*'ve been an NS for london.pm.org for years and, after slightly fewer
 years of noting it's been failing, am finally wondering who's in
 charge / can fix the fact that 89.16.178.168 is being denied zone
 transfers for london.pm.org. I'm assuming someone at Exonetric, the
 other NSs that aren't Matthew.

 One of my others, ns3.realprogrammers.com, doesn't exist any more so
 ideally that'd be pulled from the list too while we're fixing things.

 Paul

 *not personally, ns1.realprogrammers :)



Re: The proper way to open()

2012-02-01 Thread Paul Makepeace
On Feb 1, 2012 2:29 PM, Dominic Thoreau domi...@thoreau-online.net
wrote:

 On 1 February 2012 13:34, Smylers smyl...@stripey.com wrote:
  Yitzchak Scott-Thoennes writes:
 
  On Mon, Jan 30, 2012 at 9:12 AM, David Cantrell
  da...@cantrell.org.uk wrote:
 
   On Mon, Jan 30, 2012 at 05:03:47PM +, James Laver wrote:
  
On 30 Jan 2012, at 16:56, Dominic Thoreau wrote:
   
 open IN, '', $cfg || handle_that_error_sub;
   
No, explicitly not. The || operator is far too high precedence
binding. Use 'or' to remove your bug.
  
   No.  The correct solution to buggy code caused by precedence is not
   to invent a new level of precedence, but to use parens.
 
  That makes sense if you see the problem as being one of precedence.

 My personal style is to put brackets around the open portion of the
 call, but I understand the current trend is to remove these (for
 reasons that a: escape me, and b: I'm not that interested in anyway).

 open(IN, '', $cfg) || die $! made me do it;

 this would be fine, as would OR instead of the IIs.
 Personally I feel the brackets make things more explicit. At work I've
 in the past written complex DB constraints with lots of brackets, and
 then been annoyed when Postgres threw hem away, and replaced my
 explicit clause with something functionally identical, but impossible
 to read.

Done on perl code, that could make for an entertaining prank with Deparse
and a pre-commit hook...


 --


Re: The proper way to open()

2012-01-31 Thread Paul Makepeace
On Tue, Jan 31, 2012 at 14:29, Peter Corlett ab...@cabal.org.uk wrote:
 On Tue, Jan 31, 2012 at 01:42:05PM +, Peter Corlett wrote:
 On 31 Jan 2012, at 05:18, Avleen Vig wrote:
 [...]
 This is the problem with TMTOWTDI.
 There should just be one way to do it. Then we wouldn't have this problem.
 If you want Python, you know where you can find it.

 OK, on re-reading, that sounds a little bit grumpy.

 TMTOWTDI is what gives us the richness and flexibility of Perl and CPAN.
 Standardising on One True Way and being unforgiving of deviating from that
 norm prevents innovation and renovation of the language. Would you really
 still like to be writing in late-1990s Perl instead of Modern Perl?

 Take TMTOWTDI away, and it's no longer Perl. Python is better than a
 straightjacketed Perl.

I'd make a material bet Avleen was joking.

Not to mention, pretty much every modern language exhibits plurality
in implementation possibilities (PIMP? :).

Paul


Re: [ANNOUNCE] London Perl M[ou]ngers October Social - 2012-02-02 - Somers Town Coffee House, Euston, NW1 1HS

2012-01-30 Thread Paul Makepeace
 [ANNOUNCE] London Perl M[ou]ngers October Social - 2012-02-02 - Somers Town 
 Coffee House, Euston, NW1 1HS

Gives a new interpretation to Template::Manual, heh :)

That night's also my leaving dinner so if anyone fancies popping along
to Wong Kei's beforehand 7pm or after for pints, do drop by:
https://www.facebook.com/events/357889180907264/

Paul

On Mon, Jan 30, 2012 at 12:41, Leo Lapworth l...@cuckoo.org wrote:
 Hi all,

 The London.pm February social will be on Thursday the 2nd, at the Somers
 Town Coffee House, just around the corner from Euston station
 (now under new management).

 Somers Town Coffee House
 60 Chalton Street
 Euston, NW1 1HS
 http://london.randomness.org.uk/wiki.cgi?Somers_Town_Coffee_House,_NW1_1HS

 Unfortunately I can't make it, but don't let that stop you turning up,
 or maybe it will encourage more people to turn up, either way, have fun :)

 Standard blurb:

 Social meets are a chance for the various members of the group to meet
 up face to face and chat with each other about things - both Perl and
 (mostly) non-Perl - and newcomers are more than welcome. The monthly
 meets tend to be bigger than the other ad hoc meetings that take place
 at other times, and we make sure that they're in easy to get to
 locations and the pub serves food (meaning that people can eat in the
 bar if they want to). They normally start around 6.30pm (or whenever
 people get there after work) and a group tends to be left come closing
 time.


Re: 5 minimums for any perl script?

2012-01-30 Thread Paul Makepeace
On Mon, Jan 30, 2012 at 15:00, Sam Kington s...@illuminated.co.uk wrote:
 # Checking return values is a good thing. Checking the return value of
 # close or print STDERR is downright silly.

You've clearly not done much IPC…

P



Re: Tech Talk Slides

2012-01-27 Thread Paul Makepeace
On Fri, Jan 27, 2012 at 11:33, Dave Cross d...@dave.org.uk wrote:
 I hope the slides for the talks will appear online in the not too distant
 future.

Here's mine with a few fixes  annotations since last night,
http://paulm.com/talks/Cukes%20%20POW.pdf (5.8MB, yay PDF).

The bit I think I didn't make clear enough was that Cucumber consists
of two languages: the natural language spec you can show your boss,
and Ruby/Perl/etc you actually write the test code in. I've labeled
them on the slides now.

Paul


Re: Laptop Recommendation

2012-01-24 Thread Paul Makepeace
On Tue, Jan 24, 2012 at 17:40, Philip Skinner m...@philip-skinner.co.ukwrote:

 Apart from the lack of a # keyoh and a crap enter key.


My solution here was to select the US layout option. It's very similar, but
without those two deficiencies you mention. Con is learning the combo for
£. (Shift-Opt-4 on Colemak; maybe Qwerty too)

Infact anything to do with actually typing is generally pretty crappy. Home
 and end don't function as nature intended (really really really annoying,
 until you change it).


OS X has ^A, ^E, ^K baked (afaict) into the OS (surprising number of people
don't know/haven't realised this!) Enjoy!

Paul


Craigslist drops 100 Gs on Perl

2012-01-24 Thread Paul Makepeace
Wowzas: http://news.perlfoundation.org/2012/01/craigslist-charitable-fund-don.html

The Perl Foundation is proud to announce that the craigslist
Charitable Fund is supporting the Perl community with a generous
donation of $100,000 toward Perl5 maintenance and for general use by
the Perl Foundation.

Paul



Re: Testing databases with DBIx::Class

2012-01-10 Thread Paul Makepeace
On Tue, Jan 10, 2012 at 12:41, Nicholas Clark n...@ccl4.org wrote:
 On Tue, Jan 10, 2012 at 12:19:19PM +, Peter Sergeant wrote:
 On Tue, Jan 10, 2012 at 9:56 AM, Ian Knopke ian.kno...@gmail.com wrote:

  I need to test some DBIx::Class code where the database may not be
  available. I can set up something to generate a small, temporary
  SQlite db, but I was wondering what approaches others are currently
  using for this. DBD::Mock seems ok but not especially well suited for
  use with DBIx. What does the rest of the community currently do?
 

 I've tried a few approaches with this. Where I've used a different DB
 backend, I've been bitten by differences in the DB from Unicode handling to
 different feature sets. Where possible, a blank(ish) testing database
 running the same DB software as the target is infinitely preferable to
 faking it with a different system.

 Yes, at ex-employer, it came to pass that trying to test a MySQL database
 using fixtures in SQLite produced a steady stream of work trying to cope
 with differences between the two, which only emerged as one tried to write
 tests for more parts of the system.

Thirded, and not even the project that Pete  I have worked on together :)

All this portability hairiness notwithstanding, there's an argument to
be made that if your prod system is using one particular DB then the
test system should really be running that as well. If the tests pass
on a mock or similar in-RAM doodad or whatever that doesn't leave me
at least as confident about a deploy as if it'd successfully run on
the same platform as live.

Paul


Re: Should I work in the US or the UK? - which pays best? (slight diversion)

2011-12-15 Thread Paul Makepeace
On Thu, Dec 15, 2011 at 06:25, Toby Wintermute t...@wintrmute.net wrote:

 and hiring has been at a low rate due to the general global economic
 situation.


Not so in the US - unemployment in tech is about 0% as far as I've heard.
The H1-B work visa hit its cap in about 6-7 weeks this (fiscal) year.

Paul


Re: Should I work in the US or the UK? - which pays best? (slight diversion)

2011-12-14 Thread Paul Makepeace
On Wed, Dec 14, 2011 at 16:54, Dave Hodgkinson daveh...@gmail.com wrote:

 At current exchange rate it's expensive with a
 main course at my fave Irish pub coming in at €14 or so.


Not any more!

}:-)


Re: Blog Spam (Was: Telecommuting)

2011-12-13 Thread Paul Makepeace
On Tue, Dec 13, 2011 at 13:50, Smylers smyl...@stripey.com wrote:

 Nicholas Clark writes:

  I was also amused by the (current) second comment, which is actually
  spam:
 
      Thanks for taking the time to discuss about this, I feel strongly
      about it and love learning more on this topic. If possible, would
      you mind updating your blog with more information? It is extremely
      helpful for me.
 
  followed by a link to a completely unrelated e-commerce site.

 Yeah, blog spammers seem to have a battery of anodyne comments, with
 gushing so vague it could reasonably apply to information on a wide
 range of subjects.

One my blog got hit with (if 300 counts as a hit) was a series of
short comments like that but with exact one misspelling consisting of
a letter transposition. No link associated with it. Quite weird -
wasn't sure what it was trying to achieve, maybe poisoning
bayes/cluster filters with broken (but unusual) words so that they'd
be learnt over time as signals for ham.

Paul



Re: Blog Spam (Was: Telecommuting)

2011-12-13 Thread Paul Makepeace
On Tue, Dec 13, 2011 at 14:19, Ash Berlin ash_c...@firemirror.com wrote:

  One my blog got hit with (if 300 counts as a hit) was a series of
  short comments like that but with exact one misspelling consisting of
  a letter transposition. No link associated with it. Quite weird -
  wasn't sure what it was trying to achieve, maybe poisoning
  bayes/cluster filters with broken (but unusual) words so that they'd
  be learnt over time as signals for ham.
 
  Paul
 

 Never attribute to malice that which can be explained through
 incompetency.

 The other possibilities is some numpty bought an automated tool and forgot
 to enter the url properly.


Yeah, it wasn't the same data each time, it was a lot of different phrases,
some of which were quite idiomatic. But: exactly one transposition
misspelling (in a different word each time)--looked too deliberate to be a
mistake/incompetency


Re: Beware: NET-A-PORTER

2011-12-10 Thread Paul Makepeace
On Sat, Dec 10, 2011 at 12:46, Steve Mynott st...@gruntling.com wrote:
 Until you realise that it's pretty much a wash.

 What does the final line mean?

Six of one, half a dozen of the other.

http://www.usingenglish.com/forum/english-idioms-sayings/25582-call-wash.html

Paul


Re: Worst Recruitment Experience

2011-12-10 Thread Paul Makepeace
On Fri, Dec 9, 2011 at 12:53, Smylers smyl...@stripey.com wrote:
 My worst recruitment experience ...

This is a pretty entertaining story,

http://www.thesun.co.uk/sol/homepage/news/3990329/20-exec-axed-after-telling-jobseeker-off.html

Paul


Re: Beware: NET-A-PORTER

2011-12-09 Thread Paul Makepeace
On Fri, Dec 9, 2011 at 14:11, Avleen Vig avl...@gmail.com wrote:
 The true answer, of course, depends on your definition of half.

 US salaries (use payroll expense) is much higher than in the UK.
 Where in London I would pay a programmer or sysadmin about £45k - £55k, in
 New York I would pay at least $125k - $150k (about £78k - £93k).
 This sounds really great!
 Until you realise that it's pretty much a wash.

 You'll pay far less for some things in the UK than in the US (eg, food
 seems to generally be a lot cheaper in the UK), and vice versa (petrol in
 the US is cheaper than pissing in your own toilet). Having grown up in
 London (and lived there recently) and lived in quite a few major metro
 areas in the US, I can quite confidently say that both pay levels result in
 similar quality of life. No-one is getting rich.

 Then there are taxes that both you and the employer have to pay (generally
 UK employers pay less than US employers or a similar amount I believe,
 whereas UK employees pay much more).

 US employers have to pay large healthcare costs for their employees, and
 other benefits like commuter benefits where they get you cheaper travel
 on public transport, etc. There are many more things too.

I'm surprised you think food cheaper is cheaper in UK, unless you're
comparing LIDL with Trader Joe's. Finding somewhere decent to eat
requires some thought in London; requires no thought at all anywhere
I've been in California (OR seems pretty good too)

Your other points seem to show US is cheaper/ends up more $ in your
pocket, which I'd agree with and come to the conclusion I'd come to is
as a developer you're massively better off financially in the US. (Of
course, irrelevant if you don't want to live there.)

Add in the fact that the US has a track record of phenomenal success
in the tech sector there's a non-infinitisimal chance of a monster
payout if you're in there early/are good at negotiating. The UK/Europe
is hamstrung by its rather depressing attitude of gosh, if we're
REALLY lucky, we'll get bought by a US company! Says it all, really.

Paul



Re: london.pm

2011-12-06 Thread Paul Makepeace
On Tue, Dec 6, 2011 at 14:04, Dave Cross d...@dave.org.uk 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.


Nice thing about this is that Gmail auto-links it. (I never did get around
to patching Gmail to treat .pm as .pm.org - hey thought that counts right…)

P


Re: Exiting eval via next [perl v5.14]

2011-11-04 Thread Paul Makepeace
On Fri, Nov 4, 2011 at 14:49, Dave Hodgkinson daveh...@gmail.com wrote:
 A more enlightening error would be nice.


Wait, what, you want a language with exceptions?? Madness


Re: Impending arrival

2011-10-07 Thread Paul Makepeace
I'm primarily on T Mobile both in the UK and US but the phone came from 3
for reasons that will go unexplained for now.

I've had no problems with 3 in the UK and have heard Vodafone is worse.

Sent from Android
On Oct 7, 2011 3:29 AM, David Cantrell da...@cantrell.org.uk wrote:

 On Tue, Oct 04, 2011 at 02:38:43AM -0700, Paul Makepeace wrote:

  My 3-supplied UK HTC Desire isn't picking up 3G in the US so I'm stuck
 with
  Edge (as, say GPRS would be). Not horrible, but still. By comparison my
 US
  Nexus One picks up 3G on both sides of the Atlantic.

 I wouldn't touch 3, precisely because of nonsense like that.  Their
 network is rubbish even in the UK - so much so that they have roaming
 agreements *in the UK* - but roaming 3 customers don't get 3G.

 Another reason to not use them is that their name is rubbish.

 --
 David Cantrell | Bourgeois reactionary pig

Vegetarian: n: a person who, due to poor lifestyle choices,
  is more likely to get arse cancer than a normal person



Re: Impending arrival

2011-10-04 Thread Paul Makepeace
On Oct 4, 2011 12:46 AM, James Laver james.la...@gmail.com wrote:

 On 3 Oct 2011, at 22:04, David H. Adler wrote:



  More importantly, I would like to have a mobile phone while I'm over. My
  understanding is that I can pick up an inexpensive pay-as-you-go phone
  for the duration. Is there any particular carrier you would recommend
  (or, perhaps more importantly, would avoid)?

 For the amount of time you're here, it doesn't matter, really. Get a 3
sim, put 15 quid on it and you get unlimited internet though. As always,
make sure your phone supports the relevant GSM bands (I think all modern
smartphones ship with support for everything, anyway these days, though I'm
open to being corrected).

My 3-supplied UK HTC Desire isn't picking up 3G in the US so I'm stuck with
Edge (as, say GPRS would be). Not horrible, but still. By comparison my US
Nexus One picks up 3G on both sides of the Atlantic.

I'd second the 3 £15 SIM recommendation FWIW.

Paul


Re: Impending arrival

2011-10-04 Thread Paul Makepeace
On Tue, Oct 4, 2011 at 04:12, David Precious dav...@preshweb.co.uk wrote:

 I don't know if it'll be the cause, but you can switch between what type of
 networks it should connect to.

 If I switch mine to GSM/WCDMA auto then I get 3G (HSPDA) in supported areas,
 but often with a slightly weaker signal; if I set it to GSM-only, it gets a
 stronger signal, but with slower data.

 You can find it under Settings - Wireless  networks - Mobile networks -
 Network mode.

 More fun, though, is to dial *#*#4636#*#* to get into the testing widget,
 where you can get all sorts of info and set preferred network type, etc.

Interesting, thanks. When I select WCDMA only (it's defaulted to
preferred) it fails to connect and then reverts to preferred with the
Edge.

P


Re: amusing command sequence of the day

2011-09-27 Thread Paul Makepeace
Interesting - my reflexive response to the first would be

apt-get install sudo

..and take it from there

Sent from Android
On Sep 27, 2011 10:00 AM, David Alban exta...@extasia.org wrote:
 i typed the third command quite naturally. then i remembered:

 $ sudo -l
 -bash: sudo: command not found

 $ locate sudo | grep '/sudo$'
 locate: can not open `/var/lib/mlocate/mlocate.db': Permission denied

 $ sudo locate sudo | grep '/sudo$'
 -bash: sudo: command not found


 --
 Live in a world of your own, but always welcome visitors.
 ***
 Just say NO to a police state:

http://www.nytimes.com/2011/09/13/opinion/protect-our-right-to-anonymity.html


Re: Perl e-commerce?

2011-09-14 Thread Paul Makepeace
On Wed, Sep 14, 2011 at 11:47, Andrew Suffield
asuffi...@suffields.me.uk wrote:
 On Wed, Sep 14, 2011 at 12:36:23PM +0100, Peter Edwards wrote:
 That's why PHP is used

 PHP is a thorough and effective solution to the following problem,
 which is also its main design goal:

 How can stupid people create poor-quality web sites cheaply?

Jeez, really? *sigh*

P


Re: Writing About Perl

2011-08-23 Thread Paul Makepeace
On Tue, Aug 23, 2011 at 13:59, Pete Smith p...@cubabit.net wrote:
 Hey, don't take it so literally. My point was that being easy to get up and
 running is what made RoR so popular.

As it did PHP before that...


Re: LPW 2011 carpooling

2011-08-20 Thread Paul Makepeace
On Sat, Aug 20, 2011 at 00:17, Merijn Broeren meri...@iloquent.com wrote:
 [1] Private planes only, not really targetting the .pm audience :-)


Some of us are pilots and at least in the US it's pretty
cost-effective (and massively more fun, and massive less hassle) with
a full plane for journeys of even ~500miles.

Sadly in the EU/JAA there are totally retarded rules about flying in
clouds (IFR) between countries which makes the flight too dependent on
dodgy northern European weather. Dirk's Time to spare? Go by air! is
spot-on there.

Paul


Re: Using smart phones ...

2011-08-04 Thread Paul Makepeace
On Thu, Aug 4, 2011 at 11:35, Andrew Black andrew-per...@mail.black1.org.uk
 wrote:

 K-9 on anroid allows you to bottom post - no doubt that was becuase
 Jesse is the major light in that.


(So does the native Android Gmail app.)


Re: website maintenance gig available

2011-08-03 Thread Paul Makepeace
Yeah, but you have PHP self-listed as a skill :-)

On Wed, Aug 3, 2011 at 12:21, Dave Hodgkinson daveh...@gmail.com wrote:
 Your quoting is broken.


 On 3 Aug 2011, at 11:33, Ruud H.G. van Tol wrote:

 On 2011-08-01 19:11, Dave Hodgkinson wrote:

 please let me know off list

 Did you also mean that all who don't will not be considered?

 --
 Ruud




Re: PHP (was Re: website maintenance gig available)

2011-08-03 Thread Paul Makepeace
On Wed, Aug 3, 2011 at 13:55, Nicholas Clark n...@ccl4.org wrote:
 Isn't there some quote, roughly you don't program PHP, you ??? it until it
 works, possibly attributed to Randal Schwartz?

There's a little-known Google search trick: * can be used as a word substitute.

Try,

you don't code PHP you * it until it works

...confirms you are right.

That said, I think most PHP programmers accepted this openly before
anyone needed to say it.

Paul (who has given a why PHP is great talk too in case it sounds
like I'm starting a language flame war :))


Re: website maintenance gig available

2011-08-03 Thread Paul Makepeace
On Wed, Aug 3, 2011 at 14:06,  ian.doche...@nomura.com wrote:
 I agree with that, and the moronic email client that is forced upon me, but 
 there is little I can do about it!


You can use a different email address... I hear there are some free
ones still available.

P


Re: website maintenance gig available

2011-08-03 Thread Paul Makepeace
On Wed, Aug 3, 2011 at 15:18, Dave Cross d...@dave.org.uk wrote:
 p.s. I've just been browsing some list archives from 1998 - where I was
 top-posting from Outlook because it was the only mail client I was allowed
 to use. No-one objected then.

1998? Email clients? In them days we was glad to have enough memory to
run telnet!

Paul (who doesn't care partly since his email client turns cruft in -
Show quoted text - after the second time...)


Re: IMPORTANT(ish): Re: website maintenance gig available

2011-08-03 Thread Paul Makepeace
On Wed, Aug 3, 2011 at 18:33, Andrew Beattie and...@tug.com wrote:

 Ok.  Who stole all my whitespace?


Python programmers?

P (two in one day?!)


Re: mutt

2011-07-25 Thread Paul Makepeace
On Jul 25, 2011 6:31 AM, Dave Cross d...@dave.org.uk wrote:

 On 07/24/2011 11:00 PM, Paul Makepeace wrote:

 Gmail DTRT IMO by treating a subject line change as a new thread.


 But that's not the right thing. For example, this discussion has changed
subject but it's still all the same thread and should be displayed as such.

That's why I put 'IMO'.

(And didn't use 'is' ;))


 Dave...


Re: mutt

2011-07-25 Thread Paul Makepeace
On Mon, Jul 25, 2011 at 10:55, Peter Corlett ab...@cabal.org.uk wrote:

 The iOS mail client is best described as adequate. It's arguably better
 than Outlook, which seems to be the standard MUA these days.

Looking through my address book I'd say Gmail is the standard MUA these days.

Paul


Re: Gatwick

2011-07-25 Thread Paul Makepeace
Fun fact: Gatwick is the world's busiest single (operational) runway airport.

Yes, only one strip.

Makes it nice 'n easy to get around

On Mon, Jul 25, 2011 at 14:34, Smylers smyl...@stripey.com 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)?

 I don't think I've been to Gatwick before -- it isn't the obvious
 airport for somebody living in Leeds -- but I will be flying to Riga
 from there, so am currently trying to work out appropriate connecting
 trains and wondering whether I need to allow for several miles of
 travelators or anything in my timings.

 And any wisdom on likely time between scheduled touchdown on the return
 flight and being back at the station also appreciated, though I
 appreciate that's laughably hard to predict. I'll only have hand
 luggage, so does expecting to be at the platform in an hour sound
 reasonable?

 (I won't of course be depending on things being reasonable, and will add
 a margin of error to allow for unreasonableness, but it'd be handy to
 have some idea of the base time.)

 Thanks -- and looking forward to seeing many of you in Riga.

 Smylers
 --
 http://twitter.com/Smylers2



Re: Gatwick

2011-07-25 Thread Paul Makepeace
On Mon, Jul 25, 2011 at 15:49, Andy Wardley a...@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.)

P



Re: mutt

2011-07-24 Thread Paul Makepeace
Sent from Android
On Jul 24, 2011 10:46 PM, Nicholas Clark n...@ccl4.org wrote:

 On Sun, Jul 24, 2011 at 11:23:08PM +0200, Joel Bernstein wrote:
  On 24 July 2011 23:14, Mallory van Achterberg stommep...@stommepoes.nl
wrote:
   So what is this # key for mutt?
 
  Breaks the thread and creates a new one from the message. A
  client-side fix for incorrect References: headers.

 A client side fix fixes that client. (Which is useful, don't get me wrong)

 But online mail archives preserve the sender's faux pas in perpetuity.

 [Although I *also* think that the mail software's authors aren't innocent
 here. This happens often enough that the software ought to be able to spot
 you replied to this message, but changed the subject completely and
deleted
 all quoted text and then ask is this actually a new message?, and scrub
 the References: and In-Reply-To: if you tell it that it's not a reply.
 Software still hateful.]

Gmail DTRT IMO by treating a subject line change as a new thread.

Incidentally, an OCD mail admin can fire up mutt on mailman's list mbox and
do the # trick, then reindex the HTML archives. Not that I've ever done
that...

P


 Nicholas Clark


Re: [ANNOUNCE] Croyden.pm

2011-07-19 Thread Paul Makepeace
On Tue, Jul 19, 2011 at 16:59,  ian.doche...@nomura.com wrote:
 [Ian replied.] Perhaps it should be Croyd[oe]n.pm ?

Then surely just Croydön.pm?

A metal umlaut if ever there were one...

Paul

(http://en.wikipedia.org/wiki/Metal_umlaut)



Re: Slightly offtopic - coordinate conversions

2011-07-13 Thread Paul Makepeace
On Wed, Jul 13, 2011 at 02:29, Kieren Diment dim...@gmail.com wrote:

 gmail seems to understand top posting, versus bottom posting.  They do 
 struggle with inline posting mind you,

Not IME; there's even a bottom posting Lab (IIRC)

Even better, there's a Lab that'll only quote the selected text; I
used it on this message.

P



Re: Phenona

2011-06-14 Thread Paul Makepeace
On Tue, Jun 14, 2011 at 11:56, Adrian Lai p...@loathe.me.uk wrote:
 On 14 June 2011 10:42, Dirk Koopman d...@tobit.co.uk wrote:
 Anyone had a go with: http://www.phenona.com/ a perl cloud?



 Featured on el reg today:
 http://www.theregister.co.uk/2011/06/14/activestate_buys_teen_programmer/


http://onion.com/mwD2m6

:-)

P


Re: Someone needs to take jwz aside...

2011-06-10 Thread Paul Makepeace
On Fri, Jun 10, 2011 at 09:10, James Laver london...@jameslaver.com wrote:
 I'm actually liking it more than CPAN for publishing and installing stuff. 
 The only weak area is lack of search.cpan.org.

Why is search.cpan.org code (still) not open source?

P


Re: Someone needs to take jwz aside...

2011-06-08 Thread Paul Makepeace
On Wed, Jun 8, 2011 at 11:21, David Cantrell da...@cantrell.org.uk wrote:
 Of course, it's possible that the Comprehensive Python Archive Network
 or similar for ruby/javascript/java/C/whatever does exist but I just
 can't find it.  But then, if I can't find it, it's not much use.

(If you were a python programmer and yet had still somehow managed to
assiduously avoid all mentions of it, you could search for 'python
packages' (because that's what they're called in python) and would
find the top result is http://pypi.python.org/pypi)


Paul



Re: Cool/useful short examples of Perl?

2011-06-08 Thread Paul Makepeace
On Wed, Jun 8, 2011 at 13:17, Tom Hukins t...@eborcom.com wrote:
 On Wed, Jun 08, 2011 at 02:00:41PM +0200, Abigail wrote:
 I'd rather go for sacking people that don't know the difference
 between

     if (something) { ... }

 and

     unless (!something) { ... }

 It's sunny outside and pubs are open:  I can think of worse times to
 lose my job.

 Or does everyone think they are always equivalent?

 I'm not everyone, and with a language as flexible as Perl I hesitate
 to make strong statements involving words like always, but I don't
 recall encountering a situation where they differ.

$ perl -le 'print $_ == !!$_ ? , $_ == !!$_ ? yes : no for (-1,
0, 1, 2, undef)'
-1 == !!-1 ? no
0 == !!0 ? yes
1 == !!1 ? yes
2 == !!2 ? no
 == !! ? yes


FWIW,
$ python -c 'for x in -1, 0, 1, 2, None: nnx = not not x; print x,
==, nnx, ?, yes if x == nnx else no'
-1 == True ? no
0 == False ? yes
1 == True ? yes
2 == True ? no
None == False ? no

(Wait, what? Command line python? Semicolons? Ternary ops?)

Paul



Re: Cool/useful short examples of Perl?

2011-06-08 Thread Paul Makepeace
On Wed, Jun 8, 2011 at 14:15, Kaoru ka...@slackwise.net wrote:
 On Wed, Jun 8, 2011 at 1:41 PM, Paul Makepeace pa...@paulm.com wrote:
 $ perl -le 'print $_ == !!$_ ? , $_ == !!$_ ? yes : no for (-1,
 0, 1, 2, undef)'
 -1 == !!-1 ? no
 0 == !!0 ? yes
 1 == !!1 ? yes
 2 == !!2 ? no
  == !! ? yes

 Whether they are equal according to == shouldn't matter here, should
 it? What matters between if(something) and unless (!something) is
 whether something and !!something are the same boolean-wise.

 I think this code shows they are all the same?

Yes, you're right - perl doesn't use == semantics for that.


$ perl -e 'for (a, , -1, 0, 1, 2, undef) {
print $_: ;
if ($_) {
  unless (!$_) { print ok } else { print not ok }
} else {
  unless (!$_) { print not ok } else { print ok }
}
print \n }'
a: ok
: ok
-1: ok
0: ok
1: ok
2: ok
: ok

A legitimate use of unless + else! :-)

P



Re: Perl under MacOS X

2011-06-02 Thread Paul Makepeace
On Thu, Jun 2, 2011 at 09:37, Steve Mynott st...@gruntling.com wrote:

 Install Virtualbox or Vmware and use a linux perl.

Yes.

I wish I could reclaim the time wasted between me thinking ooh, cool,
I can do unix dev on my Mac directly (problems start here) to screw
all this, I'm running a VM (problems go away again*)

*well as much as ever with *nix

P


  1   2   3   4   5   6   7   8   >