[18702] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 870 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 10 14:10:51 2001

Date: Thu, 10 May 2001 11:10:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989518224-v10-i870@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 10 May 2001     Volume: 10 Number: 870

Today's topics:
    Re: How capture PID's a la "ps" <goldbb2@earthlink.net>
    Re: I *really* don't understand this error message... <koos_pol@nl.compuware.com.NOJUNKMAIL>
    Re: I *really* don't understand this error message... <koos_pol@nl.compuware.com.NOJUNKMAIL>
    Re: Invoking Perl script from a web page <uri@sysarch.com>
    Re: Javascript or Perl ? (Randal L. Schwartz)
        Komodo output on the windows2000 console <crud_alex@yahoo.com>
    Re: latest stable version of Perl (Anno Siegel)
    Re: latest stable version of Perl (Abigail)
    Re: Local Time (Abigail)
        O_RDONLY" isn't numeric in entersub at .... <m.grimshaw@salford.ac.uk>
    Re: O_RDONLY" isn't numeric in entersub at .... (Clinton A. Pierce)
    Re: O_RDONLY" isn't numeric in entersub at .... <m.grimshaw@salford.ac.uk>
    Re: O_RDONLY" isn't numeric in entersub at .... nobull@mail.com
    Re: O_RDONLY" isn't numeric in entersub at .... <m.grimshaw@salford.ac.uk>
    Re: O_RDONLY" isn't numeric in entersub at .... <m.grimshaw@salford.ac.uk>
    Re: one click and execute on many boxes <mischief@velma.motion.net>
    Re: Pattern matching using variable ... <mischief@velma.motion.net>
    Re: Pattern matching using variable ... nobull@mail.com
    Re: Perl 5.6.1 on AIX 4.3.3 does not pass "make test" <ghook@us.noibm.com>
    Re: Question about "->" operator nobull@mail.com
    Re: Re: Is this a (var name/tr) bug, can anyone verify  ("Richard Stands")
        setting environment variables <fredrik@devibe.net>
    Re: weird error on @array syntax <ren@tivoli.com>
    Re: What's wrong with my loop? (John Joseph Trammell)
    Re: XS and varargs <dan@tuatha.sidhe.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 10 May 2001 11:17:09 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: How capture PID's a la "ps"
Message-Id: <3AFAB0F5.1AB6212A@earthlink.net>

bzelitc@attglobal.net wrote:
> 
> I am looking for a perl way to poll the system (NT or Unix) for
> process id's and their parents. Functionally, this would be somewhat
> like the command line "ps" or Windows Task Manager. The difference is
> that it would not be a snapshot, but a view over time. Any ideas?

Well, for finding the parents of processes, you can use getppid, but as
to finding the children of a process... you might want to simply look in
the source of ps... or in the source of top, which I suspect does
something close to what you want.

However, there is no way to get automatic notification for each time
that a new process is started, an old process dies, or is reaped.  The
best you can do in terms of getting a view over time is to take multiple
snapshots.  Some short-lived processes will slip through in between
calls, but this is unavoidable.

-- 
Shift to the left, shift to the right, mask in, mask out, BYTE, BYTE,
BYTE !!!


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

Date: Thu, 10 May 2001 15:22:45 +0200
From: Koos Pol <koos_pol@nl.compuware.com.NOJUNKMAIL>
Subject: Re: I *really* don't understand this error message...
Message-Id: <9de4m1$hfk@news.nl.compuware.com>

Samuel Kilchenmann wrote:

> The easiest remedy is to write
> print F (foo());
> 

Yes, yes, yes!
I already tried that and it worked. But I didn't had a clue as to why. But 
now I understand the mechanism. It is all about percieved reality: what is 
it and what do I think it is...
Thanks!

-- 
Koos Pol - Systems Administrator - Compuware Europe B.V. - Amsterdam
koos_pol@nl.compuware.com_NO_JUNK_MAIL



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

Date: Thu, 10 May 2001 15:24:52 +0200
From: Koos Pol <koos_pol@nl.compuware.com.NOJUNKMAIL>
Subject: Re: I *really* don't understand this error message...
Message-Id: <9de4pv$hfk@news.nl.compuware.com>

Rafael Garcia-Suarez wrote:

> perl thinks that you're calling a method foo::F, using the indirect
> method call syntax (mainly used for OO Perl programming).
> 
> Rewrite this as :
>   print F (foo());
> 
> Lookup "Method invocation" in perlobj for description of this syntax.
> 

Man I feel like an idiot. The solutions come in faster than I can respond 
to... :-)

-- 
Koos Pol - Systems Administrator - Compuware Europe B.V. - Amsterdam
koos_pol@nl.compuware.com_NO_JUNK_MAIL



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

Date: Thu, 10 May 2001 16:23:54 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Invoking Perl script from a web page
Message-Id: <x7pudhb29y.fsf@home.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> Simon Flack wrote:

  >> print "Content-Type: image/gif\n\n";
  >> open IMAGE, "/path/pic.gif";
  >> binmode IMAGE;
  >> print while <IMAGE>;

  BL> Don't forget about binmode on STDOUT.

  BL> 	print "Content-Type: image/gif\n\n";
  BL> 	binmode STDOUT;

  BL> And I really don' t like that "print while <IMAGE>" bit, but since this
  BL> is intended to send just a small image anyway, it doesn't hurt.

well, if that is the whole script, you could just do:

	$/ = undef ;
	print <IMAGE> ;

or even faster:

	read( IMAGE, $buf, -s IMAGE ) ;
	print $buf ;

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html


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

Date: 10 May 2001 07:01:13 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Javascript or Perl ?
Message-Id: <m1d79h8frq.fsf@halfdome.holdit.com>

>>>>> "Zlach" == Zlach  <zlach@yahoo.com> writes:

Zlach> I'd like to learn Javascript and Perl.
Zlach> And the question is which one to learn first ?

Well, everything you do in Javascript will also have to work with the
Javascript turned off or bypassed.  So learn Perl first: it's the more
important of the two.

For example, say you use Javascript to ensure that a number in a field
is between 1 and 10.  You'll *still* have to verify server-side that
the number is between 1 and 10, because I might have simply forced the
form values using a script of my own (or have Javascript turned off).
So you'll be writing everything twice -- get used to it.

And you can't use Javascript for critical things, because there
are many security-conscious net users these days that either have
Javascript turned off, or filtered at a corporate security firewall.

As one of my friends says, there are *more* people with Javascript
turned off today than ever before, and on each new CERT alert, even
more get the clue and disable it.

You'd be very unfriendly (and unusable) to have a "this site demands
javascript" on any of your pages.

Javascript is OK for frills.  Just don't make it essential to the
experience.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Thu, 10 May 2001 22:43:20 +0800
From: "´Z©Ò¤ô@!¡±o^" <crud_alex@yahoo.com>
Subject: Komodo output on the windows2000 console
Message-Id: <9de916$enb$1@taliesin.netcom.net.uk>

i debug from the komodo,start up the console windows,inputed what i
input,and the console windows closed right away after it's displayed
something on the screen,it's like i have about1/10 second to check out my
output
Can anyone teach me how the get rid of this ?
thanks in advance,i've checked out the properties option of the console
windows and i got no clue at all .....




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

Date: 10 May 2001 16:15:06 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: latest stable version of Perl
Message-Id: <9deeqa$ap1$3@mamenchi.zrz.TU-Berlin.DE>

According to Eli the Bearded  <elijah@workspot.net>:
> In comp.lang.perl.misc, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> > >>>>> "Brian" == Brian Cantin <dcantin@earthlink.net> writes:
> > Brian> So, if you were to pick a Perl version that you trusted in a
> > Brian> production environment, which one would it be?
> > I've never been happy with what I saw about 5.6.0, so I'm running
> > 5.5.3 until I decide 5.6.1 is fine.
> 
> I second the 5.005_03 recomentdation. I just wish the CPAN module
> wouldn't try to upgrade perl itself for me, even if some module
> claims to be dependent on it.

Newer CPANs don't do that anymore.  In the cpan shell, use "o conf"
to set the prerequisite policy to "ask".  Then upgrade CPAN.  Or get
the newest CPAN without using your current one.

Anno


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

Date: Thu, 10 May 2001 16:48:41 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: latest stable version of Perl
Message-Id: <slrn9flhj9.7ok.abigail@tsathoggua.rlyeh.net>

Eli the Bearded (elijah@workspot.net) wrote on MMDCCCVII September
MCMXCIII in <URL:news:eli$0105081722@qz.little-neck.ny.us>:
:}  In comp.lang.perl.misc, Randal L. Schwartz <merlyn@stonehenge.com> wrote:
:} > >>>>> "Brian" == Brian Cantin <dcantin@earthlink.net> writes:
:} > Brian> So, if you were to pick a Perl version that you trusted in a
:} > Brian> production environment, which one would it be?
:} > I've never been happy with what I saw about 5.6.0, so I'm running
:} > 5.5.3 until I decide 5.6.1 is fine.
:}  
:}  I second the 5.005_03 recomentdation. I just wish the CPAN module
:}  wouldn't try to upgrade perl itself for me, even if some module
:}  claims to be dependent on it.


If you upgrade your Perl, your CPAN.pm will no longer try to upgrade
perl if a module claims to be dependent on it...



Abigail
-- 
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub  {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


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

Date: Thu, 10 May 2001 17:09:45 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Local Time
Message-Id: <slrn9fliqp.7ok.abigail@tsathoggua.rlyeh.net>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDCCCVIII September
MCMXCIII in <URL:news:u26ift4ve825kvv4qpb9a85l6n9ri06v8m@4ax.com>:
??  Todd Smith wrote:
??  
?? >I really don't think that anybody's credit card info or medical records 
?? >could be stolen because somebody uses `date` instead of 'localtime'
??  
??  Let's put it this way: how can you be absolutely 100% sure that the
??  "date" program is indeed the harmless system date program, and not
??  something malicious installed in your PATH by a hacker?



About as sure as I am that "perl" is indeed the harmless perl program,
and not something malicious installed by a hacker.

By the time an attacker gets to install a program in your PATH, you
are comprimised already. Don't give yourself a false sense of security
that using "localtime" gives you any additional security.

That's like saying you won't get pregnant the first time.


Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


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

Date: Thu, 10 May 2001 17:01:47 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: O_RDONLY" isn't numeric in entersub at ....
Message-Id: <3AFABB6B.9E634F72@salford.ac.uk>

Hi all,

O_RDONLY" isn't numeric in entersub at
/usr/local/lib/perl5/5.00502/IP22-irix/DB_File.pm line 255

The above is what I get in my apache error logs from time to time.  The
CGI script does however work fine.  The offending snippet of script is:

#######
        &open_user_db(O_RDONLY, 0444);

sub open_user_db
{
        if(!($lockuserdb = &q_tiedb(\%USER, $q_userdb, $_[0], $_[1])))
        {
                &q_head;
                print "Error: unable to open user database<P>";
                &q_tail(@lockfiles);
        }
        push(@lockfiles, $lockuserdb);
}

#######

&q_tiedb is in an external module and is:

#########

sub q_tiedb
{
my($D, $dbb, $modea, $modeb) = @_;
        tie(%{$D}, DB_File, $dbb, $modea, $modeb) || return 0;
        return &q_lock_files($dbb);
}

In another CGI script (part of the same suite), I use exactly the same
code character for character and it calls the same function from the
same external module yet does not write the same errors to the apache
error log.

I've always opened and read my databases in this manner yet this is the
first time I've noticed this error.

Any ideas?



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

Date: Thu, 10 May 2001 16:52:46 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: O_RDONLY" isn't numeric in entersub at ....
Message-Id: <yHzK6.13226$V5.2483717@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <3AFABB6B.9E634F72@salford.ac.uk>,
	Mark Grimshaw <m.grimshaw@salford.ac.uk> writes:
> Hi all,
> 
> O_RDONLY" isn't numeric in entersub at
> /usr/local/lib/perl5/5.00502/IP22-irix/DB_File.pm line 255
> 

O_RDONLY is a constant used by fcntl, sysopen and other routines.  To
have the constant available in your program put:

	use Fcntl;

Somewhere near the beginning of your code.  It happens to work because
O_RDONLY is usually defined as 0 (but don't rely on that).

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours  *and*
  clintp@geeksalad.org         Perl Developer's Dictionary -- May 2001
"If you rush a Miracle Man,     for details, see http://geeksalad.org     
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Thu, 10 May 2001 17:57:55 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: O_RDONLY" isn't numeric in entersub at ....
Message-Id: <3AFAC893.3C956B90@salford.ac.uk>

Tried that but still the same error message.


"Clinton A. Pierce" wrote:

> [Posted and mailed]
>
> In article <3AFABB6B.9E634F72@salford.ac.uk>,
>         Mark Grimshaw <m.grimshaw@salford.ac.uk> writes:
> > Hi all,
> >
> > O_RDONLY" isn't numeric in entersub at
> > /usr/local/lib/perl5/5.00502/IP22-irix/DB_File.pm line 255
> >
>
> O_RDONLY is a constant used by fcntl, sysopen and other routines.  To
> have the constant available in your program put:
>
>         use Fcntl;
>
> Somewhere near the beginning of your code.  It happens to work because
> O_RDONLY is usually defined as 0 (but don't rely on that).
>
> --
>     Clinton A. Pierce              Teach Yourself Perl in 24 Hours  *and*
>   clintp@geeksalad.org         Perl Developer's Dictionary -- May 2001
> "If you rush a Miracle Man,     for details, see http://geeksalad.org
>         you get rotten Miracles." --Miracle Max, The Princess Bride



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

Date: 10 May 2001 18:01:46 +0100
From: nobull@mail.com
Subject: Re: O_RDONLY" isn't numeric in entersub at ....
Message-Id: <u9itj9jfyd.fsf@wcl-l.bham.ac.uk>

Mark Grimshaw <m.grimshaw@salford.ac.uk> writes:

> O_RDONLY" isn't numeric in entersub at

See?  We told you that not using strict would come back to bite you.

If you'd used strict you'd have got a _much_ more helpful error :-)

"bareword "O_RDONLY" not allowed"

OK so perhaps the error itself isn't very useful but if you then look
up its meaning in the perldiag manual, or if you've enabled verbose
error messages with "use diagnostics" you'll find:

  (F) With "strict subs" in use, a bareword is only allowed as a
  subroutine identifier, in curly brackets or to the left of the "=>" symbol.
  Perhaps you need to predeclare a subroutine?

So what the error is really saying is that you've failed to declare
(or import a declaration of) the O_RDONLY function.
 
> The offending snippet of script is:
> 
>         &open_user_db(O_RDONLY, 0444);

BTW: Is there any reason why are you instructing Perl to suppress the
prototype of the open_user_db() function?

> In another CGI script (part of the same suite), I use exactly the same
> code character for character and it calls the same function from the
> same external module yet does not write the same errors to the apache
> error log.

It is in the nature of errors resulting from forgetting to declare
something that the error is reported in the line where you try to make
use of the thing you forgot to declare even though there is nothing
wrong with that line.

I agree it would be much better if Perl were to report the error in
the line where you would have declared/imported the thing, had you not
forgotten to do so. :-)

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 10 May 2001 18:28:26 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: O_RDONLY" isn't numeric in entersub at ....
Message-Id: <3AFACFBA.3F31AC3@salford.ac.uk>

> See?  We told you that not using strict would come back to bite you.
> 

Golly! - turned on strict in my script then hurriedly turned it off...
:)

>   (F) With "strict subs" in use, a bareword is only allowed as a
>   subroutine identifier, in curly brackets or to the left of the "=>" symbol.
>   Perhaps you need to predeclare a subroutine?

curly braces did the trick - thanks.

> BTW: Is there any reason why are you instructing Perl to suppress the
> prototype of the open_user_db() function?

?????

> 
> > In another CGI script (part of the same suite), I use exactly the same
> > code character for character and it calls the same function from the
> > same external module yet does not write the same errors to the apache
> > error log.

What I meant was that the use of exactly the same functions did not
write ANY error/warning messages etc. to the error logs.


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

Date: Thu, 10 May 2001 18:48:36 +0100
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: O_RDONLY" isn't numeric in entersub at ....
Message-Id: <3AFAD474.CEDBF959@salford.ac.uk>


> curly braces did the trick - thanks.
> 

&open_user_db({O_RDONLY}, 0444);

 - for the first time then I ended up with the error message (only in
the apache error log):
Odd number of elements in hash assignment...

think I'll just use the numerical value instead.


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

Date: Thu, 10 May 2001 17:04:08 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: one click and execute on many boxes
Message-Id: <tflig8p17qgue2@corp.supernews.com>

Eric Bohlman <ebohlman@omsdev.com> wrote:
> Naoko Ozeki <ayumi.ozeki@verizon.net> wrote:
>> Basically, we've been doing this manually:
>> 1. Login to box one as a user A; run some script; exit
>> 2. Login to box two as a user B; run some script; exit
>> 3. Login to box three as a user C; run some script; exit
>> etc., etc.
>> Now I'm wondering how I can have a perl script on a web server (box zero)
>> that can do the above in one shot - ideally some cgi script is presented to
>> a browser as a link, and thus a single click of a link will execute all the
>> things mentioned above, and shows the return code (or some fancy stuff).
>> This saves tremendous amount of admin work we do often.

> Look into Net::Telnet.

Good idea, but if you're looking for a little more security,
TMTOWTDI. My team often sets up RSA authentication for SSH,
then we pass a command across from the SSH client command
line. THis all works beautifully with OpenSSH, and can be
called via system.

Chris

-- 
You must not lose faith in humanity. Humanity is an ocean;
if a few drops of the ocean are dirty, the ocean does not
become dirty.  -- Mohandas K. Gandhi



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

Date: Thu, 10 May 2001 16:45:42 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Pattern matching using variable ...
Message-Id: <tflhdma3riv791@corp.supernews.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
> Vishwanath Sen wrote:

>>$pattern = "abc";
>>
>>if ($tmp1 =~  /$pattern/) {
>>  print "match found \n";
>>}
>>
>>Basically in the pattern matching if condition I want to use pattern
>>defined in $pattern. So what will that if condition look like ?

> That's it.

> Also check out the /o option, if $pattern won't ever change during the
> life of the script. It might speed up the match a bit.

> But I think that recent versions of perl have a bit of an optimizer
> built in, so that it doesn't recompile the regex if the scalar hasn't
> changed, so the time difference with or without /o needn't be that big
> any more.

It can still help some if you're using a normal scalar. However, in
recent versions, we have qr//, which lets you pre-compile a regex
before the match.

    my $string = 'foobarbaz';
    my $pattern = qr/(foo)/;
    $string =~ s/$pattern.*/$1/;
    print $string . "\n";

prints: 'foo\n'

This doesn't look much different, but it's supposed to make a time
difference without limiting you to never changing the regex.

Here are my abbreviated results with 5.5.3 :

    Benchmark: running qr, scalar, each for at least 10 CPU seconds...
        qr: 10 wallclock secs @ 11711.40/s (n=122267)
    scalar: 12 wallclock secs @ 22441.22/s (n=227554)

And here using 5.6.0 :

    Benchmark: running qr, scalar, each for at least 10 CPU seconds...
        qr: 11 wallclock secs @ 12295.51/s (n=126029)
    scalar: 11 wallclock secs @ 22140.40/s (n=221404)

It seems the scalar method is actually faster, although I had
heard the opposite. Here's the code I used:

    #!/usr/local/bin/perl -w
    use strict;
    use Benchmark;

    timethese( -10,
        {
        'qr' => \&qr,
        'scalar' => \&scalar,
        }
    );

    sub qr {
        my $string = 'foobarbaz';
        my $pattern = qr/(foo)/;
        $string =~ s/$pattern.*/$1/;
    }

    sub scalar {
        my $string = 'foobarbaz';
        my $pattern = '(foo)';
        $string =~ s/$pattern.*/$1/;
    }

Even moving the capturing parentheses into the substitution
operator and adding /o to the qr/, it is roughly half as fast
as using a scalar.

Chris

-- 
Product shown enlarged to make you think you're getting more.



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

Date: 10 May 2001 17:44:41 +0100
From: nobull@mail.com
Subject: Re: Pattern matching using variable ...
Message-Id: <u9n18ljgqu.fsf@wcl-l.bham.ac.uk>

Bart Lateur <bart.lateur@skynet.be> writes:

> Vishwanath Sen wrote:
> 
> >$pattern = "abc";
> >
> >if ($tmp1 =~  /$pattern/) {
> >  print "match found \n";
> >}
> >
> >Basically in the pattern matching if condition I want to use pattern
> >defined in $pattern. So what will that if condition look like ?

> Also check out the /o option, if $pattern won't ever change during the
> life of the script. It might speed up the match a bit.

I recommend against using the /o qualifer ever.  There's nothing AFAIK
that can't be done more clearly and safely using the qr// quoting
operator instead.

> Oh, and the *contents* of $pattern should look like what you'd enter in
> a normal regex. That needn't be the same as what you enter in the
> string. For example, in order to match a backslash, you need two
> backslashes in the pattern:
> 
> 	/\\/
> 
> but in order to get two backslashes into a string, you generally need 4
> backslashes:
> 
> 	$pattern = '\\\\';

Again the qr// quoting operator avoids this problem.

 	$pattern = qr/\\/;

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 10 May 2001 11:18:03 -0500
From: "Gary R. Hook" <ghook@us.noibm.com>
Subject: Re: Perl 5.6.1 on AIX 4.3.3 does not pass "make test"
Message-Id: <3AFABF3A.60373476@us.noibm.com>

Jens-Uwe Mager wrote:
> 
> On 9 May 2001 10:36:03 -0300, Tony Fitzgerald <jaf@unb.ca> wrote:
> >I am trying to install latest stable perl on AIX.  The make compiles
> >cleanly with only a few (I) information messages suggesting additional
> >optimization could be obtained using MAXMEM option.  Am using the IBM
> >compiler (not gcc).  The make test, however, reported failures and
> >running the "./perl harness" in the ./t directory indicated that perl
> >failed 6/258 or was 97.67% "okay" of test scripts, and 21/12601 or
> >99.83% ok for subtests.  Some of the tests produced core files.
> 
> I would suspect that this is compiler related, I did compile perl 5.6.1
> and it passed all tests. I used the old xlc 3.1.4.8 to do it, though.

Good point.  What level, _exactly_, of the compiler is being used?  The
first step would be to get the latest PTFs for the compiler and
rebuild.

-- 
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
________________________________________________________________________


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

Date: 10 May 2001 17:50:45 +0100
From: nobull@mail.com
Subject: Re: Question about "->" operator
Message-Id: <u9k83pjggq.fsf@wcl-l.bham.ac.uk>

"Gregory Toomey" <gtoomey@usa.net> writes:

> "Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
> news:m1k83q4o21.fsf@halfdome.holdit.com...

> > Prior to that, you had to use the other kind of dereferencing:
> >
> >    &{$coderef}(@args)
> >
> > This cleaned it up to:
> >
> >   $coderef->(@args)

> It make possible the 'apply' function which we were discussing in this forum
> a few weeks ago:
> 
> sub apply (&$) {
>     local $_ = $_[1];
>     $_[0]->();
>     $_;
> }

Actually, as I pointed out in at least one of the three threads about
the apply function I prefer to use the old &{$_[0]} idoim here.  

This is because $_[0]->() implies to my mind a function that takes an
formal argument list (which happens to be empty), whereas &{$_[0]}
implies to my mind a subroutine that communicates with the calling
environment via shared (global) variables (in this case $_).

There's also a small (~1 microsecond on my box) run-time saving for
not setting up an empty @_. 

BTW: Would some XS guru _please_ go over to clp.moderated an critique
my XS implementation of apply() before I send it to the List::Utils
maintainer?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 10 May 2001 17:12:00 +0000 (UTC)
From: rstands@hotmail.com ("Richard Stands")
Subject: Re: Re: Is this a (var name/tr) bug, can anyone verify it???
Message-Id: <F144lUwViKaZxVn3Qzh000028f0@hotmail.com>

[QUOTE]
Please consider not posting html enabled postings.
This is not suggested for USENET posts. Not a real
big deal but you may not know what your post looks
like for non-html newsreaders:
[/QUOTE]

Sorry, i was using MS hotmaul, shouldn't be a prob anymore. thanks for the 
heads-up!

-Rich
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


-- 
Posted from [63.66.71.66] by way of f144.law11.hotmail.com [64.4.17.144] 
via Mailgate.ORG Server - http://www.Mailgate.ORG


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

Date: Thu, 10 May 2001 19:58:13 +0200
From: Fredrik de Vibe <fredrik@devibe.net>
Subject: setting environment variables
Message-Id: <3AFAD6B5.ED50CE78@devibe.net>

Hi

There's probably a simple solution to this, but I just can't find it.
How do I set environment variables (like *nix' export, i.e. 'export
PRINTER=printername') in perl?
I tried $ENV{'PRINTER'} = "printername";, but that only worked while
I was inside the script. Anybody know how to make this "permanent"?


--Fredrik



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

Date: 10 May 2001 09:59:43 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: weird error on @array syntax
Message-Id: <m3vgn9ntb4.fsf@dhcp9-172.support.tivoli.com>

On Thu, 10 May 2001, mjd@plover.com wrote:

> In article <tfje1h1l5962a2@corp.supernews.com>,
> Craig Berry <cberry@cinenet.net> wrote:
> 
>>In brief, the Perl compiler cannot, at compiler time, see any other
>>reference to @a anywhere in your program, so it leaps to the
>>conclusion that you are trying to write a literal '@' rather than
>>trying to interpolate @a.
> 
> Wrong.  Perl never does this.  @ in a string is *always* interpreted
> as an array interpolation, since version 5.000.

Um... perl -le 'print "@"'

> See 
> 
>         http://perl.plover.com/at-error.html
> 
> for complete details.

Where you will find this sentence:

  Perl is trying to decide whether @plover should be taken literally
  or whether it should try to insert the value of the array @plover.

Which is the same thing that Craig stated that you said was wrong.
Now, admittedly, in the context of "@" followed by a valid identifier
name, they're *both* wrong, but only because Perl is choosing between
array interpolation or an error (prior to 5.6.1) -- choosing the
literal in that case is never an option (as of Perl 5).

-- 
Ren Maddox
ren@tivoli.com


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

Date: Thu, 10 May 2001 14:36:43 GMT
From: trammell@bayazid.hypersloth.invalid (John Joseph Trammell)
Subject: Re: What's wrong with my loop?
Message-Id: <slrn9fl7ib.9g.trammell@bayazid.hypersloth.net>

On Thu, 10 May 2001 13:47:44 +1000, Vaughan McAlley wrote:
> Hello,
> 
> This code doesn't give me my beloved Internal Server Error, but the loop
> doesn't run. I've checked the syntax against the obscure examples about five
> times and can't find anything wrong. What's the matter?
> 
> @POSTAGE{'0airmail', 'NZairmail', 'NZecon_air', '1airmail', '1econ_air',
> '4airmail', '4econ_air', '4seamail', '5airmail', '5econ_air', '5seamail'} =
> ('', '', '', '', '', '', '', '', '', '', '' );

This fills in %POSTAGE.

>     foreach my $temp (@POSTAGE) {

This loops over @POSTAGE.  Did you mean "foreach my $temp (keys %POSTAGE) {"?

> #       $temp = <CHARGES>;   # read in the postage from charges file
>         print "This loop is running<BR>\n";
>     }
> 



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

Date: Thu, 10 May 2001 15:20:26 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: XS and varargs
Message-Id: <_kyK6.53803$Ce4.4588753@news1.rdc1.ct.home.com>

agnes@talarian.com wrote:

> So I am trying to write a perl wrapper around a set of C functions using XS.
> I ran into a problem with a "print-like" function that takes a format argument
> followed by a vararg list. From the perlxs manual, using an ellipsis should
> work. But the only example given assume that the programmer actually knows
> what will be in the list.

This is documented in the perlxs chunk of the docs. Check out the bits 
in the "variable-length parameter lists" section specifically.

						Dan


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

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.  

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


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