[30885] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2130 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 15 14:10:17 2009

Date: Thu, 15 Jan 2009 11:09:12 -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           Thu, 15 Jan 2009     Volume: 11 Number: 2130

Today's topics:
    Re: Circular lists <jimsgibson@gmail.com>
    Re: Circular lists <jurgenex@hotmail.com>
        Cygwin or Windows: file permission functions are broken (Tim McDaniel)
    Re: how to encrypt password stored in ftp script <glex_no-spam@qwest-spam-no.invalid>
    Re: how to encrypt password stored in ftp script <woland99@gmail.com>
    Re: opening a file <cartercc@gmail.com>
    Re: opening a file xhoster@gmail.com
    Re: opening a file <cwilbur@chromatico.net>
    Re: opening a file <tim@burlyhost.com>
    Re: opening a file <cartercc@gmail.com>
        processing text <george@example.invalid>
    Re: set timeout module for Perl <tzz@lifelogs.com>
    Re: set timeout module for Perl <meneldor@gmail.com>
    Re: The single biggest STUPIDITY in Perl ... <uri@stemsystems.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 15 Jan 2009 09:36:50 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Circular lists
Message-Id: <150120090936506146%jimsgibson@gmail.com>

In article <alpine.LNX.2.00.0901151422200.6204@jvz.es>, gamo
<gamo@telecable.es> wrote:

> On Thu, 15 Jan 2009, gamo wrote:
> 
> Ok, I rewrote something to assure that there are not duplicates in %clist
> and run the test again, with similar results (speed, high use of mem).  
> 
> The thing could change radically if there is a method to canonicalize all
> the rotations of a list in a compact string. Did you say that is possible?

I did so several days ago. You can canonicalize or normalize your lists
by deciding upon a unique element within the list and rotating the list
so that element is first. You can do that by assigning a unique,
sequential key to each element and picking the element with the lowest
key as the first key. Since this element should always appear first,
you can save time in generating all of the lists, given the set of
elements, by just placing the lowest element in the first position and
then generating all of the permutations for the remaining elements.
This reduces your computational time from N! to (N-1)!.

As Xho pointed out, that method will still generate equivalent
"circular lists" if the first element is duplicated elsewhere in the
set. You might be able to reduce or eliminate generating duplicates if
you pick an element as the first element that does not have any
duplicates in the set, if that is possible.

-- 
Jim Gibson


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

Date: Thu, 15 Jan 2009 11:05:41 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Circular lists
Message-Id: <cu1vm4d1827sd01u6kukb3t5mtlp7r3euo@4ax.com>

cartercc <cartercc@gmail.com> wrote:
>On Jan 9, 5:45 am, gamo <g...@telecable.es> wrote:
>> I want to learn an effient way of handle circular lists.
>
>If you want a circular list, you use a counter and modulus it by the
>number of items in the list.
>
>For example, if you have a ten element list in an array, and your
>counter is modulus ten, 9 gets $array[9], but 10 gets (10 modulus 10 =
>0) $array[0].

You are falling for the same red herring that has plagued me for the
past days. This is not about circular lists, quite the opposite
actually.

From my understanding now (thanks again to xhoster for the explanation)
the OP is looking for all equivalence classes of all permutations of a
given list, where two (permutated) lists belong to the same equivalence
class if and only if those two lists can be transformed into each other
by rotating/circling their elements.

jue


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

Date: Thu, 15 Jan 2009 19:02:02 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Cygwin or Windows: file permission functions are broken
Message-Id: <gko17a$rd6$1@reader1.panix.com>

My apologies for asking a Cygwin- or Windows-specific question here,
but it's also Perl-specific, and I'm not sure of a better
easy-to-access place.

I looked in perlfaq5 and didn't see it discussed there, possibly
because it's a Cygwin or Windows problem in particular -- but this HAS
to be a common problem.  I tried some Googling, but it's hard to
search for "w", and I couldn't think of effective search terms.

I'm using a pretty recent Cygwin, but I don't know how to find out a
version number or date.  "cd"ed into an NTFS partition.  Environment
variable CYGWIN is "tty ntsec".

The current directory is owned by group Administrators; my user ID is
in group Administrators; group Administrators has full control.  So I
can do any regular commands that create or delete files (Cygwin touch,
CMD.EXE copy, anything).

But
    perl -e 'print(-w "." ? "yes\n" : "no\n")'
prints "no", and the same for -r and -x.
Possibly related to "ls -ld" outputting this:
    drwx------+ 30 ???????? none 0 Jan 15 11:44 .

I noticed this when I couldn't get File::Temp to work with DIR=>'.'
[footnote 2], because of its code

    # Check that the parent directories exist
    # Do this even for the case where we are simply returning a name
    # not a file -- no point returning a name that includes a directory
    # that does not exist or is not writable

    unless (-d $parent) {
      ${$options{ErrStr}} = "Parent directory ($parent) is not a directory";
      return ();
    }
    unless (-w $parent) {
      ${$options{ErrStr}} = "Parent directory ($parent) is not writable\n";
        return ();
    }
[footnote 1]


Question 1: is there any way I can get Perl's -r / -w / -x functions
to work?  Is this indeed an FAQ question, or should I actually file a
bug report with the Cygwin group?

Question 2: Is there another module that's shipped with Perl that I
could use instead of File::Temp?  I don't know of a way to tell all
the modules that are installed.  (I'd really prefer not to depend on
yet another module needing to be installed.)  IO::File::new_tmpfile()
doesn't take a directory name [2].  POSIX's
    char * tempnam(const char *tmpdir, const char *prefix)
is not implemented in module POSIX::...

I guess I'll just adapt the code from perlfaq5 ...

Question 3: ... but why is it wrapped in a BEGIN block?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[1] I consider that a design flaw.  I believe that the best way to
test that an operation will succeed is simply to try to do it, and
catch the failure.  (When the operation indicates all errors, and when
it is atomic, either succeeding completely or failing with no
residure.)

[2] There are reasons that I don't use TMPDIR, TEMP, or TMP.  They are
irrelevant to this problem.  Really. ...

 ... if you insist: I often run the Perl program outside of a Cygwin
window.  Even when TMPDIR is set in Windows syntax as C:\tmp, on
startup Perl transmogrifies it to /tmp (or whatever, per cygpath -u).
The Perl program calls non-Cygwin-aware programs, so they have to get
non-Cygwin paths like "e:\foo\bar" instead of "/CM/foo/bar".  Since
the Perl program is running in a cmd.exe window, Cygwin programs are
not in the Path ... meaning I can't just run "cygpath -w".  I don't
want to hard-code Path directories into the script.

But "." is a directory name that works in both Cygwin and non-Cygwin.
It's not much of a stretch to insist that they run the program in a
writable directory ... as long as Perl realizes that it's writable,
dammit!!1!

-- 
Tim McDaniel, tmcd@panix.com


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

Date: Thu, 15 Jan 2009 10:12:23 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: how to encrypt password stored in ftp script
Message-Id: <496f6068$0$89868$815e3792@news.qwest.net>

Woland99 wrote:
[...]
> value. Sorry if that is all gibberish - as I said security and
> encryprions are a bit of new area for me.

If you're actually dealing with sensitive data (SSN, medical
history, etc.) then you shouldn't be the one doing this project.
Find someone in your company who DOES know this and get them
to work on this with you.


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

Date: Thu, 15 Jan 2009 09:59:11 -0800 (PST)
From: Woland99 <woland99@gmail.com>
Subject: Re: how to encrypt password stored in ftp script
Message-Id: <498ce399-7208-46c3-a8a9-8b6ee0938ee7@p2g2000prf.googlegroups.com>

On Jan 15, 10:12=A0am, "J. Gleixner" <glex_no-s...@qwest-spam-
no.invalid> wrote:
> Woland99 wrote:
>
> [...]
>
> > value. Sorry if that is all gibberish - as I said security and
> > encryprions are a bit of new area for me.
>
> If you're actually dealing with sensitive data (SSN, medical
> history, etc.) then you shouldn't be the one doing this project.
> Find someone in your company who DOES know this and get them
> to work on this with you.

No worries - those are not personal data or credit card numbers.
I would not try do any such thing with my skills.


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

Date: Thu, 15 Jan 2009 08:18:45 -0800 (PST)
From: cartercc <cartercc@gmail.com>
Subject: Re: opening a file
Message-Id: <33d0fc63-4db3-4997-95a7-a6a2d5151ed1@i18g2000prf.googlegroups.com>

On Jan 15, 10:33=A0am, Charlton Wilbur <cwil...@chromatico.net> wrote:
> It's something that happens naturally when "professionals" don't stand
> up for themselves. =A0Your boss continues to do it because you allow him
> to do it, and it will stop when you stand up to him.

You are right, but there's another side. A 'professional' who 'stands
up' in situations like this isn't a professional.

A true professional focuses on the job at hand, not letting personal
circumstances or personalities get in the way. A professional gets the
job done regardless of the behavior of others. A professional makes
completion of the task at hand his number one priority. A professional
doesn't complain about the actions of others that make his job more
difficult.

I don't disagree with you. However, my point would be that the IT
professional is a real professional with regard to his approach to the
job. Unfortunately, business and managerial types don't seem to be
professionals. From my POV, it's not professional to fool around until
the last moment with a big project and then pass it off to someone
else, maybe with the hope that the blame for failure to meet the
deadline can be passed off as well.

Also, I would say that an IT worker that watches the clock and insists
on his rights is not a professional but merely a wage earner, and
deserves to be treated like a wage earner.

I would much rather have the reputation of someone that can be
depended on to do a job and do it right, than of someone who can't be
pushed around.

CC


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

Date: 15 Jan 2009 17:01:44 GMT
From: xhoster@gmail.com
Subject: Re: opening a file
Message-Id: <20090115120418.455$wx@newsreader.com>

Tim Greer <tim@burlyhost.com> wrote:
> xhoster@gmail.com wrote:
>
> > I've done the first
> > two.  I don't recall doing the third.  When I got warnings
> > about reads or writes on a closed filehandles, I immediately knew that
> > I screwed up, and it was pretty easy to figure out how.  (Just as I
> > would have had I checked and warned on the return value of open.)
> >
>
> I'd imagine it'd be easy enough to figure out in a lot of cases,
> especially if you use unique filehandle names and such, but if you
> didn't and the script grew, it could open the potential for problems to
> crop up that weren't immediately obvious, though I still imagine it
> wouldn't take very long to find the issue.

Oh, absolutely it could grow into more of a problem, if used
indiscriminately. My rule of thumb is that if the script is
important/permanent enough to save to disk and to do so with a filename
better than "foo.pl" or "asdf.pl", then I wouldn't use such shortcuts in
it.  But given the number of times I use -e or have scripts named foo.pl,
that still leaves a lot of scope where I rely on -w rather than checking
each open.

But the "sin" I do often engage in, even in permanent scripts, is not
reporting the file name that failed to open, but just $!.  The file name in
the open is often constructed by interpolation on the fly, and I don't feel
like having the same thing in two places where they could get out of sync,
or constructing temporary variables.  Usually I can figure it out just by
going to the offending line number; occasionally I have to change the die
to include more info and re-run the program.  This is where Fatal may be
handy, but last time I tried it I encountered some problem with it that I
can no longer recall.


Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Thu, 15 Jan 2009 12:40:45 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: opening a file
Message-Id: <86hc4031sy.fsf@mithril.chromatico.net>

>>>>> "cc" == cartercc  <cartercc@gmail.com> writes:

    cc> On Jan 15, 10:33 am, Charlton Wilbur <cwil...@chromatico.net> wrote:

    >> It's something that happens naturally when "professionals" don't
    >> stand up for themselves.  Your boss continues to do it because
    >> you allow him to do it, and it will stop when you stand up to
    >> him.

    cc> You are right, but there's another side. A 'professional' who
    cc> 'stands up' in situations like this isn't a professional.

Um, no.  A professional says "Yes, it's *possible* to do that, but
that's the wrong way to do it."

How long do you think a structural engineer would last if he signed off
on whatever the managers wanted, without pushing back when they wanted
to do something that was unsafe? 

How long do you think a doctor would last if he did everything the
patient wanted, regardless of whether it was in the patient's best
interest?

How long do you think a lawyer would last if he did everything his
client wanted, legal or not, without advising the client of the
ramifications of his actions?

    cc> A true professional focuses on the job at hand, not letting
    cc> personal circumstances or personalities get in the way. A
    cc> professional gets the job done regardless of the behavior of
    cc> others. A professional makes completion of the task at hand his
    cc> number one priority. A professional doesn't complain about the
    cc> actions of others that make his job more difficult.

No, a professional considers his responsibility to the client and to the
profession.  A professional refuses to do things that will injure the
client or the profession.  

    cc> I would much rather have the reputation of someone that can be
    cc> depended on to do a job and do it right, than of someone who
    cc> can't be pushed around.

Alas, then, that you're getting the reputation of someone who can be
depended on to put in the hours, but who produces shoddy work.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Thu, 15 Jan 2009 10:21:36 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: opening a file
Message-Id: <Q8Lbl.28047$Jy.14149@newsfe06.iad>

cartercc wrote:

> On Jan 15, 12:02 am, Peter Scott <Pe...@PSDT.com> wrote:
>> You're an accident waiting to happen.  When it does, I only hope that
>> you realize that it was a consequence of your poor discipline and not
>> the computer victimizing you.
> 
> I think you may have missed the context of my comments. When I write a
> one-time throw-away script FOR ME to transform some data from one form
> to another, I often don't check the return value of open. THIS IS /
> NOT/ THE SAME AS PRODUCING CODE FOR OTHERS TO USE! If the script
> doesn't work, then I've made an error, so I find the error and fix it.
> All I'm saying is that I'm comfortable working this way and find the
> consequences acceptable, in part because open is very reliable and
> almost never fails.

As strange as it sounds (and I would personally never intentionally fail
to check a return on a call, but), I could actually see how doing the
more reckless programming for yourself (only), will get you familiar
with some of the more crytic bugs and errors that aren't obvious, if
you end up troubleshooting or fixing other people's code for your
actual job.  Then again, I could see this backfiring by not having that
logic default from your head into the code you're writing.  You don't
have to go as far as to make too detailed error logging or reporting
either, so I always add something helpful, even if it's in my own
scripts.  Force of good habit, even in your own quick, trivial code, is
a good thing, but I don't mean it in a way that everyone needs to (but
that they probably should).  Anyway, as long as it's just your own code
that other people won't use or aren't paying you for, I say do what you
want.
-- 
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting.  24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!


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

Date: Thu, 15 Jan 2009 10:39:14 -0800 (PST)
From: cartercc <cartercc@gmail.com>
Subject: Re: opening a file
Message-Id: <a998e4bb-8147-4016-9a87-4c67687fb6a0@i24g2000prf.googlegroups.com>

On Jan 15, 12:40=A0pm, Charlton Wilbur <cwil...@chromatico.net> wrote:
> =A0 =A0 cc> You are right, but there's another side. A 'professional' who
> =A0 =A0 cc> 'stands up' in situations like this isn't a professional.
>
> Um, no. =A0A professional says "Yes, it's *possible* to do that, but
> that's the wrong way to do it."

Which is not what you implied. You implied that if the developer
refused to work on a project with an unreasonable deadline, the
manager would stop imposing unreasonable deadlines. In my case, it was
*possible* to complete the assignment, but only so by working over the
weekend.

> How long do you think a structural engineer would last if he signed off
> on whatever the managers wanted, without pushing back when they wanted
> to do something that was unsafe?

Not the same thing at all. In this case, I referred to an inconvenient
deadline, not an impossible or unsafe deadline.

> How long do you think a doctor would last if he did everything the
> patient wanted, regardless of whether it was in the patient's best
> interest?

Not the same thing. In fact, doctors do work impossible hours. If the
doctor said, 'I'm not going to take care of this patient because it
will cause me personal inconvenience,' how long do you think he would
last? Besides, there was no question (in my case) of inconsistency
between what was best for the enterprise and best for the manager --
coding up the job had absolute priority, regardless of my convenience.

> How long do you think a lawyer would last if he did everything his
> client wanted, legal or not, without advising the client of the
> ramifications of his actions?

Not nearly the same thing. In my case, working over the weekend was
not illegal, and I took comp time to make up the hours. Nothing about
the project was illegal.

> =A0 =A0 cc> A true professional focuses on the job at hand, not letting
> =A0 =A0 cc> personal circumstances or personalities get in the way. A
> =A0 =A0 cc> professional gets the job done regardless of the behavior of
> =A0 =A0 cc> others. A professional makes completion of the task at hand h=
is
> =A0 =A0 cc> number one priority. A professional doesn't complain about th=
e
> =A0 =A0 cc> actions of others that make his job more difficult.
>
> No, a professional considers his responsibility to the client and to the
> profession. =A0A professional refuses to do things that will injure the
> client or the profession.

And I suppose you have never faced a circumstance that required your
services after hours or during scheduled off time? Do you think it
proper to refuse to work simply because the off-hours duties were
directly caused by your manager's procrastination?
 =A0
> =A0 =A0 cc> I would much rather have the reputation of someone that can b=
e
> =A0 =A0 cc> depended on to do a job and do it right, than of someone who
> =A0 =A0 cc> can't be pushed around.
>
> Alas, then, that you're getting the reputation of someone who can be
> depended on to put in the hours, but who produces shoddy work.

I didn't say that the end product was shoddy. In fact, the end project
was exactly what it was supposed to be -- an Excel file with rows and
columns of numbers. What I said was that the coding was crap -
inefficient, redundant, undocumented, brittle, not scalable - just
like most first versions of software. Before documentation, before
modularization, before refactoring, etc. There is a big difference
between producing a product that meets the functional requirements and
doing so with good code. How many times has your first effort been
perfect? In most cases, the first effort does little more than
validate the specification.

I have the reputation of beating deadlines, not producing shoddy
products. Obviously, I'd fail the deadline rather than producing
something that didn't work.

CC


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

Date: Thu, 15 Jan 2009 12:08:15 -0700
From: George <george@example.invalid>
Subject: processing text
Message-Id: <1fzijwu2xu3lm$.1n2mf1qkwruig.dlg@40tude.net>


I thought I was past trouble working with simple file manipulations, but I
seem to be stumped here again:


#!/usr/bin/perl
use strict;
use warnings;

   my $filename = 'larry1.txt';
   my $outfile = 'processed1.txt'
   open my $fh, '<', $filename or die "cannot open $filename: $!";
   open my $gh, '>', $outfile or die "cannot open $filename: $!";
   while (<$fh>) {
       s/%%/%\n/;
       print $gh, $_;
   }
   close($fh)
   close($gh)

# perl larry1.pl


C:\MinGW\source> perl larry1.pl
"my" variable $filename masks earlier declaration in same scope at
larry1.pl lin
e 7.
"my" variable $filename masks earlier declaration in same statement at
larry1.pl
 line 7.
syntax error at larry1.pl line 7, near "open "
Can't use global $! in "my" at larry1.pl line 7, near "$filename: $!"
syntax error at larry1.pl line 14, near ")
   close"
Execution of larry1.pl aborted due to compilation errors.

C:\MinGW\source>

larry1.txt is 61 k of Larry Wall quotes, delimited by %% :

%%
if (instr(buf,sys_errlist[errno]))  /* you don't see this */
             -- Larry Wall in eval.c from the perl source code
%%
if (rsfp = mypopen("/bin/mail root","w")) {     /* heh, heh */
             -- Larry Wall in perl.c from the perl source code
%%
If you consistently take an antagonistic approach, however, people are
going to start thinking you're from New York.   :-)
             -- Larry Wall to Dan Bernstein in
<10187@jpl-devvax.JPL.NASA.GOV>
%%

I wanted to use them as a randomsig for dialog, which wants a single %
between quotes.

I tried the open statements a few different ways and get essentially the
same complaints from perl.exe.:-(

Thanks for your comment.

-- 
George

To those of you who received honours, awards and distinctions, I say well
done. And to the C students, I say you, too, can be president of the United
States.
George W. Bush

Picture of the Day http://apod.nasa.gov/apod/


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

Date: Thu, 15 Jan 2009 11:47:15 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: set timeout module for Perl
Message-Id: <86wscwjwbg.fsf@lifelogs.com>

On Thu, 15 Jan 2009 12:47:32 +0100 Joost Diepenmaat <joost@zeekat.nl> wrote: 

JD> Anio <meneldor@gmail.com> writes:
>> It work very good! But sometimes it exits with "User defined signal 1"
>> immediately and i cant understand why. Any ideas?

JD> You have to set $SIG{USR1} *before* fork()ing, since there is no
JD> guarantee that 'kill "USR1",$parent;' is executed before the signal
JD> handler is installed, otherwise.

I did not order things correctly, sorry Anio--and thanks, Joost, for
explaining.

On Thu, 15 Jan 2009 00:28:52 +0100 Hans Mulder <hansmu@xs4all.nl> wrote: 

HM> Ted is storing the parent PID in a variable, so that the child knows
HM> what process to send its signal to:

HM>     kill(USR1, $pid);

HM> Of course he could also use the getppid function:

HM>     kill(USR1, getppid());

HM> That might work better if his parent process has exited and the PID $pid
HM> has been reassigned to a new process.

Yes, that's better.  You might want to avoid sending a USR1 signal to a
process that is not expecting it, so I'd save the parent PID anyway and
check that it's equal to getppid() before sending the signal.

Ted


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

Date: Thu, 15 Jan 2009 10:43:17 -0800 (PST)
From: Anio <meneldor@gmail.com>
Subject: Re: set timeout module for Perl
Message-Id: <676c545f-6aa4-402a-bf9d-4a3cb54c9817@o4g2000pra.googlegroups.com>

On 15 =F1=CE, 19:47, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Thu, 15 Jan 2009 12:47:32 +0100 Joost Diepenmaat <jo...@zeekat.nl> wro=
te:
>
> JD> Anio <menel...@gmail.com> writes:
> >> It work very good! But sometimes it exits with "User defined signal 1"
> >> immediately and i cant understand why. Any ideas?
>
> JD> You have to set $SIG{USR1} *before* fork()ing, since there is no
> JD> guarantee that 'kill "USR1",$parent;' is executed before the signal
> JD> handler is installed, otherwise.
>
> I did not order things correctly, sorry Anio--and thanks, Joost, for
> explaining.
>
> On Thu, 15 Jan 2009 00:28:52 +0100 Hans Mulder <han...@xs4all.nl> wrote:
>
> HM> Ted is storing the parent PID in a variable, so that the child knows
> HM> what process to send its signal to:
>
> HM> =9A =9A kill(USR1, $pid);
>
> HM> Of course he could also use the getppid function:
>
> HM> =9A =9A kill(USR1, getppid());
>
> HM> That might work better if his parent process has exited and the PID $=
pid
> HM> has been reassigned to a new process.
>
> Yes, that's better. =9AYou might want to avoid sending a USR1 signal to a
> process that is not expecting it, so I'd save the parent PID anyway and
> check that it's equal to getppid() before sending the signal.
>
> Ted

Many thanks to all. Now all works as expected :)


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

Date: Thu, 15 Jan 2009 13:47:17 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: The single biggest STUPIDITY in Perl ...
Message-Id: <x73afk76fe.fsf@mail.sysarch.com>

>>>>> "BC" == Bernie Cosell <bernie@fantasyfarm.com> writes:

  BC> Uri Guttman <uri@stemsystems.com> wrote:
  BC> } but the number of differences are more common:
  BC> } 
  BC> } 	arrays				lists
  BC> } 	------				-----
  BC> } 	can change size			fixed size
  BC> } 	allocated from the heap		allocated on the stack
  BC> } 	freed later by			freed after expression is done
  BC> } 		 garbage collector
  BC> } 	lives between statements	lives in a single part of an expression
  BC> } 	can take references		no referencing
  BC> } 	can be passed around code	can only be used one time
  BC> } 						in its expression
  BC> } 	can be given a name		no name is possible
  BC> } 	can make nested trees		lists are one dimensional

  BC> You left out:
  BC>     evaluates to # of elements    evaluates to last element
  BC>      in scalar context              in scalar context

incorrect. there is no such thing as a list in scalar context. it is
just a series of comma ops in that situation, no list is ever created.

uri

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


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

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:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#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 2130
***************************************


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