[25060] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7310 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 26 11:05:51 2004

Date: Tue, 26 Oct 2004 08:05: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           Tue, 26 Oct 2004     Volume: 10 Number: 7310

Today's topics:
    Re: @ARGV not working <vek@station02.ohout.pharmapartners.nl>
    Re: @ARGV not working <wangtg@marvin.informatik.uni-stuttgart.de>
    Re: Change default @INC without recompiling? <spamtrap@dot-app.org>
    Re: Common file operations <usenet@morrow.me.uk>
        how to fix code running old perl version? <mikee@mikee.ath.cx>
    Re: how to fix code running old perl version? <mikee@mikee.ath.cx>
    Re: how to fix code running old perl version? <mritty@gmail.com>
        Inter Program Communication ... <stoill@unixsol.org>
    Re: localizing %SIG handlers (Anno Siegel)
    Re: MAIL recommendation <nospam@nospam.com>
    Re: MAIL recommendation <nospam@nospam.com>
    Re: MAIL recommendation <ron.parker@povray.org>
    Re: MAIL recommendation <nospam@nospam.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 26 Oct 2004 11:32:05 GMT
From: Villy Kruse <vek@station02.ohout.pharmapartners.nl>
Subject: Re: @ARGV not working
Message-Id: <slrncnsddl.627.vek@station02.ohout.pharmapartners.nl>

On 26 Oct 2004 10:48:13 +0200,
    Arndt Jonasson <do-not-use@invalid.net> wrote:


>
> I don't know why this should behave differently on two machines of the
> same kind, but maybe there are timing considerations (speculating wildly).
> (So why does @INC get printed? Maybe because it's much longer than @ARGV.)


The output overwritten by the next shell prompt, perhaps.


Villy


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

Date: 26 Oct 2004 16:45:36 +0200
From: Ting Wang <wangtg@marvin.informatik.uni-stuttgart.de>
Subject: Re: @ARGV not working
Message-Id: <bca654x35db.fsf@marvin.informatik.uni-stuttgart.de>

>I get the bad behaviour on Solaris (Perl 5.005) as well.
I do not get the bad behaviour on Solaris 2.8 (Perl 5.005).
print @ARGV;
works as expected


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

Date: Tue, 26 Oct 2004 09:31:56 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Change default @INC without recompiling?
Message-Id: <up6dnV-H44lQzOPcRVn-2A@adelphia.com>

David Coppit wrote:

> Is there any way to change the default @INC for all users, without
> recompiling?

You are asking an "XY" question. You have problem X, and you think that 
the solution is Y, so you're asking how to do Y. But, the solution to X 
is not really Y.

Fortunately, you've given plenty of information, so I can tell you the 
correct solution to X anyway. ;-)

> For now I've deleted the one in /System, but I think better solution would
> be to put /Library in front of /System in @INC.

No, the correct solution is to use the UNINST option when you install 
the module. That will look through @INC and uninstall any older versions 
it finds, before installing the newer version.

It's used in the final install step, like this:

make install UNINST=1

If you're using the CPAN shell, you can configure it to do this 
automatically, so you'll never have to worry about this again:

o conf make_install_arg UNINST=1
o conf commit

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Mon, 25 Oct 2004 23:34:51 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Common file operations
Message-Id: <blb052-3s6.ln1@osiris.mauzo.dyndns.org>


Quoth "Shmuel (Seymour J.) Metz" <spamtrap@library.lspace.org.invalid>:
> I'm trying to find Perl equivalents for some common operations in
> other languages. I'm also looking for some style guides.

The canonical style guide is perlstyle... :)

>  1. If I have a partial file name, how do I get the complete path?
>     I tried canon and glob, but both returned the partial name.

File::Spec->rel2abs

>  2. If I have a directory name and a file specification, ho do I find
>     all files in that directory matching the specification.

From what you say below ITYM 'all files in that directory or any
subdir'? If you don't, you can use glob (or <>).

>     File::Find and issuing an ls command seem like overkill. I could
>     use readdir if I don't need a recursive search, but I was hoping
>     for an equivalent of SysFileTree in OS/2.

File::Find or one of the modules built on it (e.g. File::Find::Rule) are
the only way (well, beyond rewriting File::Find yourself from readdir,
of course). Perl's interfaces are Unix-based; the only primitive for
reading directory entries in Unix is readdir.

OTOH if you don't care about portability you can probably find (or
fairly easily write: see perlxstut, perlxs; or Inline::C) an interface
to SysFileTree (that is, if you're actually working on OS/2 as opposed
to simply using it an an example).

Ben

-- 
               We do not stop playing because we grow old; 
                  we grow old because we stop playing.
                            ben@morrow.me.uk


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

Date: Tue, 26 Oct 2004 13:44:51 -0000
From: Mike <mikee@mikee.ath.cx>
Subject: how to fix code running old perl version?
Message-Id: <10nsl6jecc3u37c@corp.supernews.com>

I have a server that I'm not able to upgrade at the moment
that is running perl 5.005. My other servers are running
either perl 5.6 or perl 5.8. I have some code that is
distributed to all servers that will not run on perl 5.0005
and gives the error:

Use of reserved word "our" is deprecated at mongen line 32.
Global symbol "$opt_d" requires explicit package name at mongen line 32.

For several items used by getopt. Does anyone know of a
quick fix for this?

Mike


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

Date: Tue, 26 Oct 2004 13:58:24 -0000
From: Mike <mikee@mikee.ath.cx>
Subject: Re: how to fix code running old perl version?
Message-Id: <10nsm007ahvqpd3@corp.supernews.com>

In article <10nsl6jecc3u37c@corp.supernews.com>, Mike wrote:
> I have a server that I'm not able to upgrade at the moment
> that is running perl 5.005. My other servers are running
> either perl 5.6 or perl 5.8. I have some code that is
> distributed to all servers that will not run on perl 5.0005
> and gives the error:
> 
> Use of reserved word "our" is deprecated at mongen line 32.
> Global symbol "$opt_d" requires explicit package name at mongen line 32.
> 
> For several items used by getopt. Does anyone know of a
> quick fix for this?
> 
> Mike

I decided to comment out 'use strict;' and change 'our $opt_v;'
to '$opt_v = 0;'.

Mike


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

Date: Tue, 26 Oct 2004 14:03:32 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: how to fix code running old perl version?
Message-Id: <UOsfd.3113$Xq3.2993@trndny01>

"Mike" <mikee@mikee.ath.cx> wrote in message
news:10nsm007ahvqpd3@corp.supernews.com...
> In article <10nsl6jecc3u37c@corp.supernews.com>, Mike wrote:
> > I have a server that I'm not able to upgrade at the moment
> > that is running perl 5.005. My other servers are running
> > either perl 5.6 or perl 5.8. I have some code that is
> > distributed to all servers that will not run on perl 5.0005
> > and gives the error:
> >
> > Use of reserved word "our" is deprecated at mongen line 32.
> > Global symbol "$opt_d" requires explicit package name at mongen line
32.
> >
> > For several items used by getopt. Does anyone know of a
> > quick fix for this?
>
> I decided to comment out 'use strict;' and change 'our $opt_v;'
> to '$opt_v = 0;'.

No no no!  Wrong solution!  Keep use strict, and use our's predecessor:
use vars qw/$opt_v/;  #this replaces our $opt_v;

Paul Lalli




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

Date: Tue, 26 Oct 2004 16:42:54 +0300
From: Stoill Barzakov <stoill@unixsol.org>
Subject: Inter Program Communication ...
Message-Id: <2u72iuF27g452U1@uni-berlin.de>

Slackware Linux + Konqueror

I've got an invoice shown on the Konqueror screen from some web/billing
frontend .  I'ts mostly text fields and few submit buttons .  I want to
collect info from Konqueror (it may include all the html content) and feed
It through already made Perl code to Fiscal Printer .

Direct print from Konqueror is not an option .  The Fiscal Printer doesn't
accept standart pure text print .  It has own language with CRC on every
command sent .

Is there a Perl module with capability to grab contents of the page shown in
Konqueror if I know Konqueror process ID ?

-- 
      ___     
     (o o)     Still confused ...
--ooO-(_)-Ooo--------------------------------------------------


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

Date: 26 Oct 2004 12:03:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: localizing %SIG handlers
Message-Id: <clleej$80c$1@mamenchi.zrz.TU-Berlin.DE>

Ilya Zakharevich  <nospam-abuse@ilyaz.org> wrote in comp.lang.perl.misc:
> [A complimentary Cc of this posting was sent to
> Anno Siegel
> <anno4000@lublin.zrz.tu-berlin.de>], who wrote in article
> <ckdtd2$of3$1@mamenchi.zrz.TU-Berlin.DE>:
> >     $SIG{ HUP} = \&global_handler;
> >     {
> >         local $SIG{ HUP} = \ &local_handler;
> >         # provoke and deal with one or more HUP signals
> >     }
> > 
> > The assumption is that $SIG{ HUP} is either the global or the local
> > handler at all times, so the (HUP) signal will always be caught, but
> > apparently that assumption isn't true.  "local" sets the handler
> > to undef, and then "=" sets it to \ &local_handler.  It is quite
> > possible for a signal to arrive when the hander is undefined, which
> > ends the program through an uncaught signal.
> 
> What you describe is a serious flaw in Perl signal-handling
> implementation.  But many more others may be present; it is very hard
> for unexperienced-in-asm C programmers (i.e., for most of us) to write
> signal-safe code.
> 
> The first thing to check is whether just *assignment* to $SIG{HUP} is
> a signal-safe operation (it may contain some more windows of
> vulnerability).  If it is safe (10^8 signals savely delivered is a
> good indication - should take couple of days on current OSes),

Eleven, signalling at a rate of 100 ticks per second.  One can signal
faster, but (as far as I can see) only with a busy timer.  Is there
anything particular to 10^8 or is it just an arbitrary big number?

I don't know if plain assignment is safe, but it (and your derived
method below) are by orders of magnitude safer than local().  At a
rate of 100 signals per sec, local()izing the hander in a tight loop
crashes in less than a second.  With your method (or explicit
assignment), it ran through a lengthy phone call.  (How's that for
precision timing? :)

> I would think that this would be safe too:
> 
>   #!/usr/bin/perl -w
>   use strict;
>   sub DESTROYER::DESTROY {shift->()}
>   sub ON_DESTROY (&) {bless shift, 'DESTROYER'}
>   sub LOCAL_SIG (&$) {my $s=pop; my $o = $SIG{$s}; $SIG{$s}=shift;
> 		      ON_DESTROY {$SIG{$s}=$o || 'DEFAULT'}}
> 
>   $SIG{HUP} = \&global_sig;
>   {  my $on_leave = LOCAL_SIG {warn 'got SIG'} 'HUP';
>      # Do something...
>   }

Ah... so you oblige the user to accommodate an additional variable
in the scope of the local handler.

I had tried to employ DESTROY for this purpose, but made the handler
itself a code object.  I had given up on that approach since anyone
can keep a copy of the handler (and may have reasons to), preventing
DESTROY to be called, I had given up on that approach.  Next time I'll
remember that trick of yours.

Anno


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

Date: Tue, 26 Oct 2004 09:05:16 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: MAIL recommendation
Message-Id: <1098795946.229656@nntp.acecape.com>

> How about a bit more efficiently? Though it's still a perl group. Why
> don't you just killfile[1] everyone and just talk to those who have the
> same opinion as you?


didn't read his post, just saw there was one....besides not looking for same
opinions...looking for opinions....




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

Date: Tue, 26 Oct 2004 09:11:41 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: MAIL recommendation
Message-Id: <1098796331.421933@nntp.acecape.com>

> >the FAQ always have to have the final word on all?  i seriously have a
hard
> >time understanding this group.
>
> I think this is seriuously reciprocal!

well michele, i was hoping you would stop reading my posts too....but if you
really want to lay cards on the table, lets!  and this purely opinion, and
not emotional or the likes.  it's a pure observation

to me, community is newsgroups, open discussion, free thoughts floating back
and forth, helping any type of newbie no matter how simple his/her question
was, yet sniffing out the actual homework people.

but in spouting FAQ, FAQ, FAQ...i'm sorry guys/gals, and i sincerely don't
mean this with the venom a few of you have thrown at me, this is more like
goose-stepping to me.  you know there are a few people here who have
answered my questions and moved on.   i asked "what do you like for
this...." and they answered....

sorry for it sounding like lecturing, but it really seems like "free
thought" discussion is second priority here....

i'll leave you with this...someone pointed out to me the "lurking before you
post" guideline.  never heard of it, but after this experience, you bet i'll
never forget it.  may i suggest you do the same, see what some of the other
programming groups do?  you'll find stupid "dooooh" posts from EVERYONE.
but you'll find so few of them illicit terse responses.  that keeps everyone
coming coming back for more, knowing that an answer is always just a few
clicks away, that keeps more software flowing, and so on and so on and so
on.

just a thought.....




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

Date: Tue, 26 Oct 2004 08:11:36 -0500
From: Ron Parker <ron.parker@povray.org>
Subject: Re: MAIL recommendation
Message-Id: <slrncnsj88.ikd.ron.parker@mail.parkrrrr.com>

On Tue, 26 Oct 2004 11:12:34 +0200, Robert Sedlacek wrote:
> Ron Parker wrote:
> 
>> Wouldn't it be easier and just as effective to unsubscribe?
> 
> I want to read this group, it seems to me he doesn't, so: No.

My apologies for my imprecision: I meant for him to unsubscribe, since 
to killfile everyone here who doesn't agree with him would have roughly
the same effect.

-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbf 1}hollow interior{media{emission 3-T}}}#end 
Z(-x-x.2x)camera{location z*-10rotate x*90normal{bumps.02scale.05}}


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

Date: Tue, 26 Oct 2004 09:48:11 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: MAIL recommendation
Message-Id: <1098798522.491099@nntp.acecape.com>

> My apologies for my imprecision: I meant for him to unsubscribe, since
> to killfile everyone here who doesn't agree with him would have roughly
> the same effect.


again, read my my post...not looking for people to agree with me....looking
for "opinions" on products, methods, etc.  but obviously you miss the point
of what a newsgroup (for developers) is really for




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

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 V10 Issue 7310
***************************************


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