[32337] in Perl-Users-Digest
Perl-Users Digest, Issue: 3604 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 3 06:09:22 2012
Date: Fri, 3 Feb 2012 03:09:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 3 Feb 2012 Volume: 11 Number: 3604
Today's topics:
Re: job cull; Warner Brothers; try this <tzz@lifelogs.com>
Re: job cull; Warner Brothers; try this <vilain@NOspamcop.net>
Re: job cull; Warner Brothers; try this <tzz@lifelogs.com>
Re: Multiline regex not matching <ben@morrow.me.uk>
Re: Multiline regex not matching (Seymour J.)
Re: Multiline regex not matching <ben@morrow.me.uk>
Re: Multiline regex not matching (Seymour J.)
Re: perl syntax check (David Combs)
Re: perl syntax check <tadmc@seesig.invalid>
Re: perl syntax check <ben@morrow.me.uk>
Re: perl syntax check (Seymour J.)
Re: perl syntax check <ben@morrow.me.uk>
Re: perl syntax check (Seymour J.)
Re: perl syntax check <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 01 Feb 2012 12:55:24 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: job cull; Warner Brothers; try this
Message-Id: <87aa52zbeb.fsf@lifelogs.com>
On Mon, 30 Jan 2012 19:43:36 +0000 (UTC) tmcd@panix.com (Tim McDaniel) wrote:
TM> In article <ge5jv8-rus.ln1@news.rtij.nl>,
TM> Martijn Lievaart <m@rtij.nl.invlalid> wrote:
>> On Fri, 27 Jan 2012 22:02:04 +0000, Rainer Weikusat wrote:
>>
>>> The people who posted the challenge
>>> presumably weren't interested in 'Charton Wilbers' 'rip free stuff off
>>> the internet' skills. Actually, I doubt anyone else was, either.
>>
>> I *expect* an applicant to be able to reuse code where ever possible. I
>> would give Charlton extra points for his solution.
TM> And then ask the candidate to implement it from scratch, or give them
TM> another problem for which there is no CPAN module. 'Cause it's nice
TM> to know that they'll be sensible about getting fast solutions where
TM> possible, but you do want to know their coding skills.
My favorite interview question, 5 years ago, was to implement a hash in
Perl that could map bidirectionally between keys and values. I said I'd
use Tie::Hash::TwoWay from CPAN. They asked me to write my own code.
I pointed out I was the author of the module and offered to walk them
through it.
Ted
------------------------------
Date: Wed, 01 Feb 2012 18:52:37 -0800
From: Michael Vilain <vilain@NOspamcop.net>
Subject: Re: job cull; Warner Brothers; try this
Message-Id: <vilain-FD7C4A.18523501022012@news.individual.net>
In article <87aa52zbeb.fsf@lifelogs.com>,
Ted Zlatanov <tzz@lifelogs.com> wrote:
> On Mon, 30 Jan 2012 19:43:36 +0000 (UTC) tmcd@panix.com (Tim McDaniel) wrote:
>
> TM> In article <ge5jv8-rus.ln1@news.rtij.nl>,
> TM> Martijn Lievaart <m@rtij.nl.invlalid> wrote:
> >> On Fri, 27 Jan 2012 22:02:04 +0000, Rainer Weikusat wrote:
> >>
> >>> The people who posted the challenge
> >>> presumably weren't interested in 'Charton Wilbers' 'rip free stuff off
> >>> the internet' skills. Actually, I doubt anyone else was, either.
> >>
> >> I *expect* an applicant to be able to reuse code where ever possible. I
> >> would give Charlton extra points for his solution.
>
> TM> And then ask the candidate to implement it from scratch, or give them
> TM> another problem for which there is no CPAN module. 'Cause it's nice
> TM> to know that they'll be sensible about getting fast solutions where
> TM> possible, but you do want to know their coding skills.
>
> My favorite interview question, 5 years ago, was to implement a hash in
> Perl that could map bidirectionally between keys and values. I said I'd
> use Tie::Hash::TwoWay from CPAN. They asked me to write my own code.
>
> I pointed out I was the author of the module and offered to walk them
> through it.
>
> Ted
Sweet. But I'll bet you still didn't get the job. Idiots who do
interviews oftentimes don't have a clue.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
------------------------------
Date: Thu, 02 Feb 2012 07:22:23 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: job cull; Warner Brothers; try this
Message-Id: <8739atqvb4.fsf@lifelogs.com>
On Wed, 01 Feb 2012 18:52:37 -0800 Michael Vilain <vilain@NOspamcop.net> wrote:
MV> In article <87aa52zbeb.fsf@lifelogs.com>,
MV> Ted Zlatanov <tzz@lifelogs.com> wrote:
>> My favorite interview question, 5 years ago, was to implement a hash in
>> Perl that could map bidirectionally between keys and values. I said I'd
>> use Tie::Hash::TwoWay from CPAN. They asked me to write my own code.
>>
>> I pointed out I was the author of the module and offered to walk them
>> through it.
MV> Sweet. But I'll bet you still didn't get the job. Idiots who do
MV> interviews oftentimes don't have a clue.
Nah, the interview went well; I was offered the job and I'm still
friends with the guy who interviewed me. It was a Java shop so in that
context it makes sense--only recently (with Google's Guava, Maven, etc.)
has Java had some kind of popular centralized module facility.
Ted
------------------------------
Date: Tue, 31 Jan 2012 20:40:17 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Multiline regex not matching
Message-Id: <h60mv8-7lt2.ln1@anubis.morrow.me.uk>
Quoth Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>:
> In <slrnjieqmt.2rk.tadmc@tadbox.sbcglobal.net>, on 01/30/2012
> at 10:07 PM, Tad McClellan <tadmc@seesig.invalid> said:
>
> >Nobody knows what string is in $testheader (because it is not loaded
> >up in Real Perl Code) so we cannot help with matching it...
>
> Okay, this time I'll provide a complete program instead of snippets.
> Where I'm stuck is in the discrepancy between the first and second
> test of $testheader
The problem is here:
> my $atomPat = qr/\s* $atextPat+ \s*/x;
This needs to be something more like
my $atomPat = qr/$FWS? $atextPat+ $FWS??/x;
(that double-? is *not* a typo). Otherwise the $atomPat in
> my $RecIdPat = qr/$CFWS ID $FWS (?:$atomPat | $msgIdPat)/imx;
swallows all of the whitespace following it (running over the newline),
and the non-optional $CWFS at the start of
> my $RecForPat = qr/$CFWS FOR $FWS (?: $RecPathPat | $MailboxPat)/imx;
has nothing to match, so the whole clause is skipped.
That ?? is like ? (0-or-one), but non-greedy. This means it matches as
little text as possible rather than as much as possible. I'm not certain
what the semantics of the RFCs' ABNF are supposed to be, exactly: it's
possible that most or all of the quantifiers should be non-greedy.
Usually it doesn't matter, of course, because there's some other
constraint that means the pattern can only match one way. In this case,
if you'd insisted on matching all available clauses by including the
semicolon, like this,
/... $RecIdPat? $RecForPat? ; /imx
the 'for' clause would have been forced to match, even though that meant
stealing some whitespace back from the 'id' clause.
Ben
------------------------------
Date: Wed, 01 Feb 2012 00:40:36 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Multiline regex not matching
Message-Id: <4f28d054$3$fuzhry+tra$mr2ice@news.patriot.net>
In <h60mv8-7lt2.ln1@anubis.morrow.me.uk>, on 01/31/2012
at 08:40 PM, Ben Morrow <ben@morrow.me.uk> said:
>The problem is here:
>> my $atomPat = qr/\s* $atextPat+ \s*/x;
>This needs to be something more like
> my $atomPat = qr/$FWS? $atextPat+ $FWS??/x;
Consulting RFC 5321, I see
Atom = 1*atext
which means that it should have been something like
my $atomPat = qr/$atextPat+/x;
I'm not sure why I had the \s* in there. Removing it resolved the
problem. Thanks.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Wed, 1 Feb 2012 18:03:34 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Multiline regex not matching
Message-Id: <mcbov8-q0a1.ln1@anubis.morrow.me.uk>
Quoth Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>:
> In <h60mv8-7lt2.ln1@anubis.morrow.me.uk>, on 01/31/2012
> at 08:40 PM, Ben Morrow <ben@morrow.me.uk> said:
>
> >The problem is here:
>
> >> my $atomPat = qr/\s* $atextPat+ \s*/x;
>
> >This needs to be something more like
>
> > my $atomPat = qr/$FWS? $atextPat+ $FWS??/x;
>
> Consulting RFC 5321, I see
>
> Atom = 1*atext
>
> which means that it should have been something like
>
> my $atomPat = qr/$atextPat+/x;
>
> I'm not sure why I had the \s* in there. Removing it resolved the
> problem. Thanks.
Well, 5322 is more liberal, and has
atom = [CFWS] 1*atext [CFWS]
though I'm not sure why you used \s+ rather than $CFWS.
Ben
------------------------------
Date: Thu, 02 Feb 2012 05:46:56 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: Multiline regex not matching
Message-Id: <4f29efb1$1$fuzhry+tra$mr2ice@news.patriot.net>
In <mcbov8-q0a1.ln1@anubis.morrow.me.uk>, on 02/01/2012
at 06:03 PM, Ben Morrow <ben@morrow.me.uk> said:
>Well, 5322 is more liberal,
For analyzing the Received header I need to use the RFC 5321
definition, since I'm primarily concerned with the ones inserted by
SMTP[1] servers. Then I need to throw in some ad hoc code to handle
nonstandard usages encountered in the wild :-(
> atom = [CFWS] 1*atext [CFWS]
That's misleading, because RFC 5322 uses dot-atom-text in places where
RFC 5321 would use Dot-string.What gets confusing is that the ABNF in
5321 has a few references to 5322.
[1] An RFC 5322 message can pass through other types of servers,
some of which also inseert a Received header field.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Tue, 31 Jan 2012 23:48:40 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: perl syntax check
Message-Id: <jg9uko$3cp$3@reader1.panix.com>
In article <slrnjhjiir.26l.willem@toad.stack.nl>,
Willem <willem@toad.stack.nl> wrote:
>
>Odd, it's supposed to send the compile time errors as well.
>Have you turned off 'pretty errors' in your browser?
What browsers have a "pretty errors" feature?
Would emacs be one of them?
Thanks,
David
------------------------------
Date: Tue, 31 Jan 2012 19:07:15 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: perl syntax check
Message-Id: <slrnjih42q.6hv.tadmc@tadbox.sbcglobal.net>
David Combs <dkcombs@panix.com> wrote:
> In article <slrnjhjiir.26l.willem@toad.stack.nl>,
> Willem <willem@toad.stack.nl> wrote:
>>
>>Odd, it's supposed to send the compile time errors as well.
>>Have you turned off 'pretty errors' in your browser?
>
> What browsers have a "pretty errors" feature?
>
> Would emacs be one of them?
emacs is a "browser"?
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
------------------------------
Date: Wed, 1 Feb 2012 01:42:33 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perl syntax check
Message-Id: <9thmv8-oi03.ln1@anubis.morrow.me.uk>
Quoth Tad McClellan <tadmc@seesig.invalid>:
> David Combs <dkcombs@panix.com> wrote:
> > In article <slrnjhjiir.26l.willem@toad.stack.nl>,
> > Willem <willem@toad.stack.nl> wrote:
> >>
> >>Odd, it's supposed to send the compile time errors as well.
> >>Have you turned off 'pretty errors' in your browser?
> >
> > What browsers have a "pretty errors" feature?
IE, most notably. By default it has a 'feature' which causes it to
ignore the body of any HTTP response which isn't a 200 in favour of a
built-in 'friendly' error page, *unless* the body returned is larger than
(IIRC) 1024 bytes. I believe recent versions of FF have picked up the
same nasty trick.
> > Would emacs be one of them?
Almost certainly not, though I don't use it so I don't know for sure.
> emacs is a "browser"?
w3-mode?
Ben
------------------------------
Date: Wed, 01 Feb 2012 08:06:39 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: perl syntax check
Message-Id: <4f2938df$1$fuzhry+tra$mr2ice@news.patriot.net>
In <9thmv8-oi03.ln1@anubis.morrow.me.uk>, on 02/01/2012
at 01:42 AM, Ben Morrow <ben@morrow.me.uk> said:
>IE, most notably. By default it has a 'feature' which causes it to
>ignore the body of any HTTP response which isn't a 200 in favour of a
>built-in 'friendly' error page, *unless* the body returned is larger
>than (IIRC) 1024 bytes. I believe recent versions of FF have picked
>up the same nasty trick.
Ouch! Can it be disabled?
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Wed, 1 Feb 2012 18:07:39 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perl syntax check
Message-Id: <bkbov8-q0a1.ln1@anubis.morrow.me.uk>
Quoth Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>:
> In <9thmv8-oi03.ln1@anubis.morrow.me.uk>, on 02/01/2012
> at 01:42 AM, Ben Morrow <ben@morrow.me.uk> said:
>
> >IE, most notably. By default it has a 'feature' which causes it to
> >ignore the body of any HTTP response which isn't a 200 in favour of a
> >built-in 'friendly' error page, *unless* the body returned is larger
> >than (IIRC) 1024 bytes. I believe recent versions of FF have picked
> >up the same nasty trick.
>
> Ouch! Can it be disabled?
Yes, I think the preference is called something like 'friendly HTTP
errors', but those writing websites can't assume their users have turned
it off. As a result, a lot of error pages now have something like
<!-- padding for IE
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<to 1024 bytes>
-->
somewhere in them.
Ben
------------------------------
Date: Wed, 01 Feb 2012 21:09:26 -0500
From: Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>
Subject: Re: perl syntax check
Message-Id: <4f29f056$2$fuzhry+tra$mr2ice@news.patriot.net>
In <bkbov8-q0a1.ln1@anubis.morrow.me.uk>, on 02/01/2012
at 06:07 PM, Ben Morrow <ben@morrow.me.uk> said:
> <!-- padding for IE
I should have veen clearer; I don't do windoze, but if a newer version
of FF is going to do that then I want to know how to tell it to be
honest.
BTW, I refer to that sort of behavior as either "user fiendly" or as a
"Molly Malone", from "she died of a faever".
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Thu, 2 Feb 2012 16:40:39 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: perl syntax check
Message-Id: <7tqqv8-nf02.ln1@anubis.morrow.me.uk>
Quoth Shmuel (Seymour J.) Metz <spamtrap@library.lspace.org.invalid>:
> In <bkbov8-q0a1.ln1@anubis.morrow.me.uk>, on 02/01/2012
> at 06:07 PM, Ben Morrow <ben@morrow.me.uk> said:
>
> > <!-- padding for IE
>
> I should have veen clearer; I don't do windoze, but if a newer version
> of FF is going to do that then I want to know how to tell it to be
> honest.
[I've replied by private mail, since this is now completely OT for
clpmisc. The short answer is I was mistaken about FF's behaviour.]
Ben
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 3604
***************************************