[31892] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3155 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 30 18:09:27 2010

Date: Thu, 30 Sep 2010 15:09:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 30 Sep 2010     Volume: 11 Number: 3155

Today's topics:
        Bug in IO::Uncompress::Unzip::nextStream() ? <jl_post@hotmail.com>
    Re: Bug in IO::Uncompress::Unzip::nextStream() ? (Paul.Marques@btinternet.com\)
    Re: Claimed to be an "old hack" <tzz@lifelogs.com>
    Re: Need Regex for phone number <ernesto@ernestoreyes.com>
    Re: Need Regex for phone number <uri@StemSystems.com>
    Re: Need Regex for phone number <cwilbur@chromatico.net>
    Re: Need Regex for phone number <cwilbur@chromatico.net>
    Re: Need Regex for phone number <stanley@peak.org>
    Re: Need Regex for phone number <uri@StemSystems.com>
    Re: Need Regex for phone number <tzz@lifelogs.com>
    Re: Need Regex for phone number <uri@StemSystems.com>
    Re: Need Regex for phone number <hjp-usenet2@hjp.at>
    Re: Need Regex for phone number <ralph@happydays.com>
    Re: Need Regex for phone number <uri@StemSystems.com>
    Re: Need Regex for phone number <uri@StemSystems.com>
    Re: Time::Format::time with $SIG{__DIE__} problem <nospam-abuse@ilyaz.org>
    Re: Using a backref for arity <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 30 Sep 2010 12:39:34 -0700 (PDT)
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Bug in IO::Uncompress::Unzip::nextStream() ?
Message-Id: <00697e12-69ee-4aff-b3ae-a3c772f1ead8@l20g2000yqm.googlegroups.com>


Hi,

   Recently I've been using the IO::Uncompress::Unzip module to
manually unzip archived files out of *.zip files.

   After unzipping one file, I call $z->nextStream(), and if it
returns 1, I loop back and unzip the next file.

   However, I've discovered that $z->nextStream() seems to always
return 1, even though the "perldoc IO::Uncompress::Unzip"
documentation explicitly says that nextStream() returns 1 if a new
stream was found, and 0 if none was found.

   This behavior happens to me using both Strawberry Perl 5.10 (on
Windows 7), and Perl 5.12.2 (built for alpha-netbsd-thread-multi).

   Here is a test script that reproduces what I'm seeing.  To use it,
create a *.zip file with a small number of archive files, and then
pass in the *.zip file as its sole argument.  You will see the last
file in the *.zip archive repeated endlessly.


#!/usr/bin/perl
# File:  test_unzip.pl
# Purpose:  To demonstrate the correctness of the
#           IO::Uncompress::Unzip::nextStream() method.

use strict;
use warnings;

die "Usage:  perl $0 <file.zip>\n"  unless @ARGV == 1;
my ($zipFile) = @ARGV;

use IO::Uncompress::Unzip qw(unzip $UnzipError);

my $z = new IO::Uncompress::Unzip $zipFile
    or die "unzip failed: $UnzipError\n";

print "'$zipFile' contains the following file(s):\n";

my $numFiles = 0;

do
{
   $numFiles++;
   my $data = $z->getHeaderInfo();
   print "   $numFiles. $data->{Name}\n";
}
while ($z->nextStream() == 1);  # Always returns 1,
                                # and so will loop forever!

__END__

   If I run these commands:

      touch a b c
      zip blah.zip a b c
      perl test_unzip.pl blah.zip

I see the following output:

'blah.zip' contains the following file(s):
   1. a
   2. b
   3. c
   4. c
   5. c
   6. c
   7. c
   8. c
   9. c
   10. c
   11. c

 ... and so on.

   So is what I'm seeing a bug in IO::Uncompress::Unzip, or am I using
nextStream() incorrectly?  And if I do happen to be using it
incorrectly, how do I know how when I've reached the last stream?  (Or
how can I know how many streams there are, so I can know when to stop
looking for more?)

   Thanks,

   -- Jean-Luc


------------------------------

Date: Thu, 30 Sep 2010 23:01:47 +0100
From: "Paul Marquess \(Paul.Marques@btinternet.com\)"
Subject: Re: Bug in IO::Uncompress::Unzip::nextStream() ?
Message-Id: <8EFB0D5A188D41EE872DBC432FE8F5A6@Delli>

This issue has been fixed in 2.030 of the this module.


Paul 

-----Original Message-----
From: jl_post@hotmail.com [mailto:jl_post@hotmail.com] 
Posted At: 30 September 2010 20:40
Posted To: comp.lang.perl.misc
Conversation: Bug in IO::Uncompress::Unzip::nextStream() ?
Subject: Bug in IO::Uncompress::Unzip::nextStream() ?



Hi,

   Recently I've been using the IO::Uncompress::Unzip module to manually
unzip archived files out of *.zip files.

   After unzipping one file, I call $z->nextStream(), and if it returns
1, I loop back and unzip the next file.

   However, I've discovered that $z->nextStream() seems to always return
1, even though the "perldoc IO::Uncompress::Unzip"
documentation explicitly says that nextStream() returns 1 if a new
stream was found, and 0 if none was found.

   This behavior happens to me using both Strawberry Perl 5.10 (on
Windows 7), and Perl 5.12.2 (built for alpha-netbsd-thread-multi).

   Here is a test script that reproduces what I'm seeing.  To use it,
create a *.zip file with a small number of archive files, and then pass
in the *.zip file as its sole argument.  You will see the last file in
the *.zip archive repeated endlessly.


#!/usr/bin/perl
# File:  test_unzip.pl
# Purpose:  To demonstrate the correctness of the
#           IO::Uncompress::Unzip::nextStream() method.

use strict;
use warnings;

die "Usage:  perl $0 <file.zip>\n"  unless @ARGV == 1; my ($zipFile) =
@ARGV;

use IO::Uncompress::Unzip qw(unzip $UnzipError);

my $z = new IO::Uncompress::Unzip $zipFile
    or die "unzip failed: $UnzipError\n";

print "'$zipFile' contains the following file(s):\n";

my $numFiles = 0;

do
{
   $numFiles++;
   my $data = $z->getHeaderInfo();
   print "   $numFiles. $data->{Name}\n";
}
while ($z->nextStream() == 1);  # Always returns 1,
                                # and so will loop forever!

__END__

   If I run these commands:

      touch a b c
      zip blah.zip a b c
      perl test_unzip.pl blah.zip

I see the following output:

'blah.zip' contains the following file(s):
   1. a
   2. b
   3. c
   4. c
   5. c
   6. c
   7. c
   8. c
   9. c
   10. c
   11. c

 ... and so on.

   So is what I'm seeing a bug in IO::Uncompress::Unzip, or am I using
nextStream() incorrectly?  And if I do happen to be using it
incorrectly, how do I know how when I've reached the last stream?  (Or
how can I know how many streams there are, so I can know when to stop
looking for more?)

   Thanks,

   -- Jean-Luc



------------------------------

Date: Thu, 30 Sep 2010 14:34:42 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Claimed to be an "old hack"
Message-Id: <87fwwr58kt.fsf@lifelogs.com>

On Thu, 30 Sep 2010 17:52:11 +0000 (UTC) Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote: 

IZ> On 2010-09-28, Ben Morrow <ben@morrow.me.uk> wrote:
>>> >> >     (A && B) || C
>>> >> >
>>> >> > which is a nasty shorthand for
>>> >> >
>>> >> >     if (A) {
>>> >> >         B
>>> >> >     }
>>> >> >     else {
>>> >> >         C
>>> >> >     }
 ...
IZ> I did not mean "value judgement" here.  I meant semantic: your
IZ> "equivalence" holds only if B always succeeds if A succeeds.

I think this is one of the areas where Lisp's prefix notation is
significantly clearer than any of the alternatives, e.g.

(setq result (or (and A B) C))

I wish Perl had a simple way to construct boolean logic in prefix
notation.  A plain function would not work, of course.

Ted


------------------------------

Date: Thu, 30 Sep 2010 11:24:55 -0700 (PDT)
From: lotug <ernesto@ernestoreyes.com>
Subject: Re: Need Regex for phone number
Message-Id: <dcab59e2-961d-47bb-875e-04888b4a7396@h37g2000pro.googlegroups.com>

Thanks, that seems to work.

On Sep 27, 5:25=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth lotug <erne...@ernestoreyes.com>:
>
>
>
> > On Sep 27, 7:04=A0am, Justin C <justin.1...@purestblue.com> wrote:
> > > On 2010-09-23, lotug <erne...@ernestoreyes.com> wrote:
>
> > > > I need Regex to indentify 3108222400 phone number.
>
> > > You could try:
> > > if ($_ =3D~ /3108222400/) {
>
> > > or did you have something else in mind?
>
> > Sorry, I guess I assumed to much.
> > Yes, I was looking for regex that would identify the phone number in a
> > txt string regardless of how it was formatted. Different people input
> > phone numbers in different ways. Also, I have regex that identifies a
> > phone number in a string, but I'm looking for perl regex that will
> > identify this particular number within a text string.
>
> > 3108222400
> > (310) 822-2400
> > 1(310) 822-2400
> > 1-310-822-2400
>
> For those forms, something like
>
> =A0 =A0 /1? [-(]? 310 [-)]? \s* 822 -? 2400/x
>
> may be sufficient, though it will catch strings like '-310)8222400'
> that you don't want.
>
> > Etc., etc.
>
> You will need to make a complete list of all the forms you want to
> catch, and create a regex that matches them. Probably the best way is a
> simple alternation, which you can build like
>
> =A0 =A0 my @cases =3D (
> =A0 =A0 =A0 =A0 "3108222400",
> =A0 =A0 =A0 =A0 "(310) 82202400",
> =A0 =A0 =A0 =A0 "1(310) 822-2400",
> =A0 =A0 =A0 =A0 "1-310-822-2400",
> =A0 =A0 );
> =A0 =A0 my ($pattern) =3D map qr/$_/, join "|", map "\Q$_", @cases;
>
> Ben



------------------------------

Date: Thu, 30 Sep 2010 14:35:36 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Need Regex for phone number
Message-Id: <8762xnw03r.fsf@quad.sysarch.com>

>>>>> "JS" == John Stanley <stanley@peak.org> writes:

  JS> Do I have that about right?

no. i know charlton (i placed him there) and his type of question is
extremely valuable in screening candidates. it isn't about knowing phone
numbers or styles, it is a basic simple parsing question that any decent
perl hacker should be able to do. and if they have questions, that shows
an inquiring mind which is good too. if you spend more than 10 minutes
on that (hell, 30 seconds!) it is a bad sign if you expect to be
hired. i don't use such questions but i always review candidate code and
i ask questions about how and why they coded something. i learn more
about candidates from their code than any other aspect of interviewing
them. and yes, i interview plenty of candidates as part of my business.

uri


-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 30 Sep 2010 14:39:40 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Need Regex for phone number
Message-Id: <86mxqz849f.fsf@mithril.chromatico.net>

>>>>> "JS" == John Stanley <stanley@peak.org> writes:

    JS> Ten seconds. /([2-9]\d\d)/. But that requires an "esoteric
    JS> knowledge" of the NANP, that area codes don't start with 0 or 1,
    JS> and that they changed to allow 2-9 as a middle digit. Do I win?

Nope.  You missed the "validate it" part completely.

And you seem to have willfully missed the point elsewhere, too.  Hint:
this is not a major programming challenge for the company at large.
It's a fairly simple problem that weeds out the people with no Perl
knowledge or experience to speak of.

Further, if the interviewer tells you that it's a toy problem to
evaluate the way you approach problems, haranguing him about how asking
that toy problem is going to hamper the country's entry into
international markets is one of the few wrong approaches you can take.

Charlton



-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Thu, 30 Sep 2010 15:00:35 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Need Regex for phone number
Message-Id: <86iq1n83ak.fsf@mithril.chromatico.net>

>>>>> "UG" == Uri Guttman <uri@StemSystems.com> writes:

    UG> it isn't about knowing phone numbers or styles, it is a basic
    UG> simple parsing question that any decent perl hacker should be
    UG> able to do. 

Precisely.  It's a toy problem that any competent Perl programmer should
be able to come up with a reasonable solution to within 10 minutes.

Its principal goal - which it performs admirably - is to eliminate
candidates who are good enough at putting keywords on their resumes and
speaking bafflegab to HR people to get to the interview, but who do not
have any actual hands-on Perl skills.  

Charlton



-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Thu, 30 Sep 2010 13:01:59 -0700
From: John Stanley <stanley@peak.org>
Subject: Re: Need Regex for phone number
Message-Id: <alpine.LRH.2.00.1009301230510.6911@shell.peak.org>

On Thu, 30 Sep 2010, Charlton Wilbur wrote:

>>>>>> "JS" == John Stanley <stanley@peak.org> writes:
>
>    JS> Ten seconds. /([2-9]\d\d)/. But that requires an "esoteric
>    JS> knowledge" of the NANP, that area codes don't start with 0 or 1,
>    JS> and that they changed to allow 2-9 as a middle digit. Do I win?
>
> Nope.  You missed the "validate it" part completely.

I quote you: "So substitute 'well-formed' for 'valid' in the spec. 
Sheesh." I didn't "miss it completely". You, yourself, removed the "valid" 
requirement. Do you routinely change the specs and then forget you changed 
them?

From this exchange, I learn that my prospective employer is inconsistent 
in producing specifications for the software he wants me to write. He 
changes his mind on a daily basis, forgets he changed his mind, and uses 
incorrect and misleading definitions for those specs he does write. It 
would be a very poor programming environment and I'd be better off 
looking elsewhere, because even if I nailed the specs on something, I'd 
have "completely missed" something I was specifically told was NOT a 
requirement yesterday.

> ... haranguing him about how asking
> that toy problem is going to hamper the country's entry into
> international markets is one of the few wrong approaches you can take.

Where did you see me say anything about discussing your failure to plan 
for the company's entry into a global marketplace with you? I told you 
what _I_ see as the skills you are looking for. You do realize, I hope, 
that the "interview process" is a two-edged sword, and what the candidate 
gleans from his interviewer is just as important as what you get from him.

By all means, keep presenting toy problems as if they are real, change the 
spec at whim, and fail to define the standards you want followed.


------------------------------

Date: Thu, 30 Sep 2010 16:08:19 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Need Regex for phone number
Message-Id: <87iq1nuh8s.fsf@quad.sysarch.com>

>>>>> "JS" == John Stanley <stanley@peak.org> writes:

  JS> From this exchange, I learn that my prospective employer is
  JS> inconsistent in producing specifications for the software he wants me
  JS> to write. He changes his mind on a daily basis, forgets he changed his
  JS> mind, and uses incorrect and misleading definitions for those specs he
  JS> does write. It would be a very poor programming environment and I'd be
  JS> better off looking elsewhere, because even if I nailed the specs on
  JS> something, I'd have "completely missed" something I was specifically
  JS> told was NOT a requirement yesterday.

you just blew the interview. NEXT!!

  JS> By all means, keep presenting toy problems as if they are real, change
  JS> the spec at whim, and fail to define the standards you want followed.

you haven't done much screening of perl candidates it seems. or talked
to many who do.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 30 Sep 2010 15:09:47 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Need Regex for phone number
Message-Id: <874od756yc.fsf@lifelogs.com>

On Thu, 30 Sep 2010 15:00:35 -0400 Charlton Wilbur <cwilbur@chromatico.net> wrote: 

CW> Precisely.  It's a toy problem that any competent Perl programmer should
CW> be able to come up with a reasonable solution to within 10 minutes.

CW> Its principal goal - which it performs admirably - is to eliminate
CW> candidates who are good enough at putting keywords on their resumes and
CW> speaking bafflegab to HR people to get to the interview, but who do not
CW> have any actual hands-on Perl skills.  

The Brainbench Perl tests are also good at filtering out the rabble.
It's a commercial service so YMMV but for me it's been helpful.

Ted


------------------------------

Date: Thu, 30 Sep 2010 16:28:27 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Need Regex for phone number
Message-Id: <87bp7fugb8.fsf@quad.sysarch.com>

>>>>> "TZ" == Ted Zlatanov <tzz@lifelogs.com> writes:

  TZ> On Thu, 30 Sep 2010 15:00:35 -0400 Charlton Wilbur <cwilbur@chromatico.net> wrote: 
  CW> Precisely.  It's a toy problem that any competent Perl programmer should
  CW> be able to come up with a reasonable solution to within 10 minutes.

  CW> Its principal goal - which it performs admirably - is to eliminate
  CW> candidates who are good enough at putting keywords on their resumes and
  CW> speaking bafflegab to HR people to get to the interview, but who do not
  CW> have any actual hands-on Perl skills.  

  TZ> The Brainbench Perl tests are also good at filtering out the rabble.
  TZ> It's a commercial service so YMMV but for me it's been helpful.

i dislike them in particular and pretty much any multiple choice
automated test. they don't show how someone thinks or codes. code
review and coding assignments of simple problems are much better
indicators. i actually would downgrade anyone who promoted their
brainbench score. it's as useful as msce's! and i know people who will
NOT hire someone dumb enough to get an msce! :)

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 30 Sep 2010 22:40:07 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Need Regex for phone number
Message-Id: <slrnia9td7.bb2.hjp-usenet2@hrunkner.hjp.at>

On 2010-09-30 19:00, Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>> "UG" == Uri Guttman <uri@StemSystems.com> writes:
>    UG> it isn't about knowing phone numbers or styles, it is a basic
>    UG> simple parsing question that any decent perl hacker should be
>    UG> able to do. 
>
> Precisely.  It's a toy problem that any competent Perl programmer should
> be able to come up with a reasonable solution to within 10 minutes.

The problem is that there are way too many programmers which then take
their solution to your "toy problem" and apply it to the real world.
There are a lot of registration forms which require a phone number as a
mandatory field but don't accept my phone number because it it has too
few or too many digits or I have formatted it differently than the
programmer expected (and of course he doesn't tell me what he expects -
he just tells me "please enter a valid phone number" and deletes the
other 20 fields I have already entered. There are also forms which don't
accept email addresses with a "+" in the local part, or punctuation in a
house number. And so on.

	hp




------------------------------

Date: Thu, 30 Sep 2010 16:52:27 -0400
From: Ralph Malph <ralph@happydays.com>
Subject: Re: Need Regex for phone number
Message-Id: <20c00$4ca4f88c$ce534406$574@news.eurofeeds.com>

On 9/30/2010 4:28 PM, Uri Guttman wrote:
>>>>>> "TZ" == Ted Zlatanov<tzz@lifelogs.com>  writes:
>
>    TZ>  On Thu, 30 Sep 2010 15:00:35 -0400 Charlton Wilbur<cwilbur@chromatico.net>  wrote:
>    CW>  Precisely.  It's a toy problem that any competent Perl programmer should
>    CW>  be able to come up with a reasonable solution to within 10 minutes.
>
>    CW>  Its principal goal - which it performs admirably - is to eliminate
>    CW>  candidates who are good enough at putting keywords on their resumes and
>    CW>  speaking bafflegab to HR people to get to the interview, but who do not
>    CW>  have any actual hands-on Perl skills.
>
>    TZ>  The Brainbench Perl tests are also good at filtering out the rabble.
>    TZ>  It's a commercial service so YMMV but for me it's been helpful.
>
> i dislike them in particular and pretty much any multiple choice
> automated test. they don't show how someone thinks or codes. code
> review and coding assignments of simple problems are much better
> indicators. i actually would downgrade anyone who promoted their
> brainbench score. it's as useful as msce's! and i know people who will
> NOT hire someone dumb enough to get an msce! :)
What about the many people who have these as they were required
by a former employer? Do they also get to miss out on the
experience of working next to a morbidly obese mouthbreather
that smells of faeces?



------------------------------

Date: Thu, 30 Sep 2010 17:27:10 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Need Regex for phone number
Message-Id: <877hi2vs5t.fsf@quad.sysarch.com>

>>>>> "RM" == Ralph Malph <ralph@happydays.com> writes:

  RM> What about the many people who have these as they were required
  RM> by a former employer? Do they also get to miss out on the
  RM> experience of working next to a morbidly obese mouthbreather
  RM> that smells of faeces?

you failed the interview. get out of here.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 30 Sep 2010 17:30:23 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Need Regex for phone number
Message-Id: <8739sqvs0g.fsf@quad.sysarch.com>

>>>>> "PJH" == Peter J Holzer <hjp-usenet2@hjp.at> writes:

  PJH> On 2010-09-30 19:00, Charlton Wilbur <cwilbur@chromatico.net> wrote:
  >>>>>>> "UG" == Uri Guttman <uri@StemSystems.com> writes:
  UG> it isn't about knowing phone numbers or styles, it is a basic
  UG> simple parsing question that any decent perl hacker should be
  UG> able to do. 
  >> 
  >> Precisely.  It's a toy problem that any competent Perl programmer should
  >> be able to come up with a reasonable solution to within 10 minutes.

  PJH> The problem is that there are way too many programmers which then take
  PJH> their solution to your "toy problem" and apply it to the real world.
  PJH> There are a lot of registration forms which require a phone number as a
  PJH> mandatory field but don't accept my phone number because it it has too
  PJH> few or too many digits or I have formatted it differently than the
  PJH> programmer expected (and of course he doesn't tell me what he expects -
  PJH> he just tells me "please enter a valid phone number" and deletes the
  PJH> other 20 fields I have already entered. There are also forms which don't
  PJH> accept email addresses with a "+" in the local part, or punctuation in a
  PJH> house number. And so on.

you are missing the point. it is NOT a real world problem. it is just an
exercise given during an interview. it is meant to see HOW the candidate
solves a problem and thinks about it. good questions about formats are a
plus. not even being able to code up a basic simple parser for a basic
number is bad. this thread is crazy. charlton knows the difference
between real world and interview. the OP actually may not. his spec was
left out and he deservedly got a bunch of silly answers. he still never
addressed any real world issues here.

sheesh.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Thu, 30 Sep 2010 18:09:23 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Time::Format::time with $SIG{__DIE__} problem
Message-Id: <slrnia9kii.luc.nospam-abuse@powdermilk.math.berkeley.edu>

On 2010-09-29, Keith Thompson <kst-u@mib.org> wrote:
> See also the "%SIG" section of "perldoc perlvar", and the BUGS section
> at the very end:
>
>        Having to even think about the $^S variable in your exception
>        handlers is simply wrong.  $SIG{__DIE__} as currently
>        implemented invites grievous and difficult to track down
>        errors.  Avoid it and use an "END{}" or CORE::GLOBAL::die
>        override instead.

IMO, tchrist was too opinionated.  There WAS a problem; it was solved
by introduction of $^S.  Case closed.

  (But I'm, of course, biased to the merits of $^S. ;-)

Yours,
Ilya


------------------------------

Date: Thu, 30 Sep 2010 18:13:27 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Using a backref for arity
Message-Id: <slrnia9kq7.luc.nospam-abuse@powdermilk.math.berkeley.edu>

On 2010-09-29, Akim Demaille <akim.demaille@gmail.com> wrote:
> Hi all,
>
> The following does not work.  This was expected, but since pre is
> sometimes surprisingly powerful, I meant to make sure.  The idea is to
> handle with the s operator strings of x's preceded by their number
> (and for instance to replace them with X).  For instance "{2}xxx"
> should give "XXx".  So I tried this:
>
> echo "{2}xxx" | perl -p -e 's/\{(\d+)\}x{\1}/"X" x $1/ge
>
> Sure it does not work (I get the original string back).  Yet, I would
> have expected Perl to complain about my use of the backref as an
> argument for the arity (this is 5.10.0).  What the heck did it
> understand?

This is a horrible backward-compatibility hack (I suspect introduced
about Perl3 for Perl2-compatibility - or somesuch).  If it is not in
EXACTLY the documented syntax, { is interpreted as a literal.

Yours,
Ilya


------------------------------

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 3155
***************************************


home help back first fref pref prev next nref lref last post