[13603] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1013 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 7 14:06:21 1999

Date: Thu, 7 Oct 1999 11:05:15 -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: <939319514-v9-i1013@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 7 Oct 1999     Volume: 9 Number: 1013

Today's topics:
    Re: (?p{}) was [Re: Backreference in Regex Code Block?] <ltl@rgsun5.viasystems.com>
    Re: (?p{}) was [Re: Backreference in Regex Code Block?] <kbandes@home.com>
    Re: Das GlasPerlenspiel <csaba.raduly@sophos.com>
        Delete a line in a file <gaetan@eii.fr>
    Re: Delete a line in a file <sariq@texas.net>
        exec() argument problem with ActiveState 520 (Scott Vance)
    Re: exec() argument problem with ActiveState 520 (Scott Vance)
    Re: Getting Win Perl working with MS Personal Web Serve (d.k. henderson)
    Re: Hash size limit ? (longish) (Ilya Zakharevich)
    Re: Help - Perl regular expression question! <ltl@rgsun5.viasystems.com>
    Re: How to secure PERL-Scripts <beaumontsystems@netscapeonline.co.uk>
        is this some version difference? <brodzik@kryos.colorado.edu>
    Re: Memory leak in assignment (Ilya Zakharevich)
        mkdir... and then!? emlyn_a@my-deja.com
    Re: Newbie Perler Needs simple parse help... <j.mcnocher@misd.lon.ac.uk>
    Re: Newbie Perler Needs simple parse help... <skilchen@swissonline.ch>
    Re: Newbie Perler Needs simple parse help... <sjohns17@uic.edu>
    Re: Newbie Perler Needs simple parse help... <bkovac@gmx.net>
        ODBC error retrieving large columns <babalorixa@poetic.com>
    Re: Passwords <ak@dasburo.de>
    Re: Perl Doc.. <sjohns17@uic.edu>
    Re: Perl Error as CGI under Apache/2 (Ilya Zakharevich)
    Re: Question about alarm and run away processes <ilya@speakeasy.org>
    Re: Redirecting output to /dev/null (Scot Hacker)
    Re: search a data base file <madebeer@igc.apc.org>
        STDERR output doesn't match $! <nbarner@uswest.com>
        test <us,ppp,webs@ix.netcom.com>
    Re: To Abigail re: reading current threads <AgitatorsBand@yahoo.com>
    Re: tool to convert BMPs to GIFs programatically? (J. A. Mc.)
    Re: tool to convert BMPs to GIFs programatically? <flavell@mail.cern.ch>
    Re: We do complex Perl Programming (Randal L. Schwartz)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 7 Oct 1999 15:55:14 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: (?p{}) was [Re: Backreference in Regex Code Block?]
Message-Id: <7tifp2$a8$1@rguxd.viasystems.com>

Bart Lateur <bart.lateur@skynet.be> wrote:
:>lt lindley wrote:

:>>The non-recursive case succeeds but
:>>:>still stops the recursion.
:>>
:>>I understood that.  I just don't see why I should have to provide
:>>for that case when I can't see any useful situation where you would
:>>write it without the |.

:>Because that may not be the case you want to check for.

:>Suppose you're looking for a pattern that starts with n "<"'s then one
:>"#", and finally n ">"'s, for example: "<<<<#>>>>".

:>Then the regex would become

:>	$foo = qr{ < $foo >		# Postponed $foo in brackets
:>		  | \#			# Or "#"
:>		 }px;


:>I don't want to match  "<<>>". I'm only interested in "<<#>>". Would you
:>deny me that possibility?

Ahh.  And now with that example under my belt I can see other
reasons too.  Thanks.

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: Thu, 07 Oct 1999 13:15:14 -0400
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: (?p{}) was [Re: Backreference in Regex Code Block?]
Message-Id: <37FCD522.59CC6070@home.com>

lt lindley wrote:
> :>$foo doesn't have to fail.  It just has to stop recursing.  That's
> :>why you have the | in it.  The non-recursive case succeeds but
> :>still stops the recursion.
> 
> I understood that.  I just don't see why I should have to provide
> for that case when I can't see any useful situation where you would
> write it without the |.

Well, for one thing, the non-recursive case is not necessarily empty, 
so you wouldn't want to assume "or nothing".  In other words, yes, 
you always want the |, but what's on the other side of it will vary
so I don't see how the language can make useful assumptions about
it.

In general, there are certain situations (such as left-recursion)
that can lead to infinite recursion in a top-down parser.  I don't
know that there's a reasonable default behavior the language can
provide - I think you just need to design your grammars (or 
patterns) carefully so you don't create these situations.

Ken Bandes


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

Date: Thu, 07 Oct 1999 15:48:15 +0100
From: Csaba Raduly <csaba.raduly@sophos.com>
Subject: Re: Das GlasPerlenspiel
Message-Id: <37FCB2AE.F0BA8FB5@sophos.com>

David Cassell wrote:
> 
> Fujitsu Australia Limited wrote:
> >
> > Is Perl the Glass Bead Game or is the Glass Bead Game available as a Perl
> > module?
> >
> > These rules, the sign language and grammar of the Game, constitute a kind of
> > highly developed secret language drawing upon several science and arts, but
> > especially mathematics and music, and capable of expressing and establishing
> > interrelationships between the contents and the conclusions of nearly all
> > scholarly disciplines, The Glass Bead Game is thus a mode of playing with
> > the total contents and values of our culture; it plays with them as, say, in
> > the great age of the arts painter might have played with the colors of his
> > palette. All the insights, noble thoughts, and works of art that the human
> > race has produced in its creative eras, all that subsequent periods of
> > scholarly study have reduced to concepts and converted to intellectual
> > property - on all this immense body of intellectual values the Glass Bead
> > Game player plays like an organist on the organ.
> >
> > Hermann Hesse
> > Das Glasperlenspiel
> > 1943
> 
Don't tell me there was perl in 1943 (on ENIAC, perhaps) ????
Larry didn't look THAT old to me :-)

Csaba

-- 
-----BEGIN GEEK CODE BLOCK----- 
Version 3.1
GCS/>GMU d- s:- a30 C++$ UL+ P+>+++ L++ E- W+ N++ o? K? w++>$ O++$ M-
V- PS PE Y PGP- t+ 5 X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK----- 

Csaba Raduly,    Software Developer (OS/2),    Sophos Anti-Virus
mailto:csaba.raduly@sophos.com            http://www.sophos.com/
US Support +1 888 SOPHOS 9            UK Support +44 1235 559933
Life is complex, with real and imaginary parts.


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

Date: Thu, 07 Oct 1999 18:28:48 +0200
From: Gaetan <gaetan@eii.fr>
Subject: Delete a line in a file
Message-Id: <37FCCA40.D338E545@eii.fr>

What can i do to delete just one line in a file.



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

Date: Thu, 07 Oct 1999 11:48:19 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Delete a line in a file
Message-Id: <37FCCED3.2A6ABD3@texas.net>

Gaetan wrote:
> 
> What can i do to delete just one line in a file.

You can RTFM.  Specifically, perlfaq5:

"How do I change one line in a file/delete a line in a file/insert a
line in the middle of a file/append to the beginning of a file?"

- Tom


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

Date: Thu, 7 Oct 1999 15:27:51 GMT
From: sasdsv@wnt.sas.com (Scott Vance)
Subject: exec() argument problem with ActiveState 520
Message-Id: <37fcb2b7.60491181@newshost.unx.sas.com>

Can anyone tell me why this little test program works fine 
with ActiveState perl (5.0 patchlevel 4 subversion 02) but
does not work with ActiveState perl (5.0 patchlevel 5 subversion 03)?

It seems that the parameters that get passed to editor are
different between the two versions, because the editor complains
about an invalid path name:

C:\My Documents\Files\UltraEdit\UEdit32.exe C:\My Documents\Perl\junk.pl contains an invalid path.


# Simple perl Program to load a file into an editor.

$Prog = "C:\\Program Files\\UltraEdit\\UEdit32.exe";
$FileLocation = "C:\\My Documents\\Perl";
$File = "junk.pl";

exec ($Prog, "$FileLocation\\$File");
 


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

Date: Thu, 7 Oct 1999 15:50:37 GMT
From: sasdsv@wnt.sas.com (Scott Vance)
Subject: Re: exec() argument problem with ActiveState 520
Message-Id: <37fec00f.63907454@newshost.unx.sas.com>

Something I forgot to mention in the first post...
It is the space between My and Document in the editor's 
path that caused the problems.  If you change the editor to 
something without spaces in the path (such as
$Prog = "C:\\Winnt\\Notepad.exe";) the program works.

Scott

On Thu, 7 Oct 1999 15:27:51 GMT, sasdsv@wnt.sas.com (Scott Vance) wrote:

>Can anyone tell me why this little test program works fine 
>with ActiveState perl (5.0 patchlevel 4 subversion 02) but
>does not work with ActiveState perl (5.0 patchlevel 5 subversion 03)?
>
>It seems that the parameters that get passed to editor are
>different between the two versions, because the editor complains
>about an invalid path name:
>
>C:\My Documents\Files\UltraEdit\UEdit32.exe C:\My Documents\Perl\junk.pl contains an invalid path.
>
>
># Simple perl Program to load a file into an editor.
>
>$Prog = "C:\\Program Files\\UltraEdit\\UEdit32.exe";
>$FileLocation = "C:\\My Documents\\Perl";
>$File = "junk.pl";
>
>exec ($Prog, "$FileLocation\\$File");
> 



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

Date: Thu, 07 Oct 1999 15:18:58 GMT
From: dalekh@hotmail.com (d.k. henderson)
Subject: Re: Getting Win Perl working with MS Personal Web Server
Message-Id: <8E5773854dkhenderson@207.14.233.125>

 
 .cgi c:\perl\bin\perl.exe


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

Date: 7 Oct 1999 17:52:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Hash size limit ? (longish)
Message-Id: <7timkp$mh4$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Csaba Raduly 
<csaba.raduly@sophos.com>],
who wrote in article <37FC89CD.1EE19540@sophos.com>:
> Another perl script parses it and produces perl include files
> with the following format:
> ----cut here-------------chapter32.exp----------
> %expected = (
>    'file1', 'virus1',
>    'file2', 'virus2',
> );
> ----cut here-------------chapter32.exp-end------

 ...

> over the entire virus collection, and passed it through
> yet another perl script to generate a big exp file
> (and I mean big: it's over 3M in size)
> But when I try to include the big one using do,
> the hash appears to be empty.

What do you mean?  You have a Perl script which is 3M long, which
contains text similar to the above one, and and you 'do' this script?

> I started to chop it down to see where it stops working. 
> Apparently the limit is around 1761 lines or a file of 93500 bytes.
> I suspect the problem isn't some limit in the hash size;
> rather an input buffer size limit (?)

None that I know of.

Ilya

P.S.  I did

perl -wle "print '%expected = ('; $c=0; print qq(   'file$c', 'virus$c',) while $c++ < 100000; print ');'" >o.pl

perl -wle "do 'o.pl'; print scalar keys %expected"
100000

This is as expected...

Ilya


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

Date: 7 Oct 1999 14:47:33 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: Help - Perl regular expression question!
Message-Id: <7tibq5$si6$1@rguxd.viasystems.com>

Larry Rosler <lr@hpl.hp.com> wrote:
:>In article <7th6sk$hjs$2@rguxd.viasystems.com> on 7 Oct 1999 04:17:24 
:>GMT, lt lindley <ltl@rgsun40.viasystems.com> says...
:>> Larry Rosler <lr@hpl.hp.com> wrote:
:>> 
:>> :>s/($bigger)|$pattern/defined $1 ? $1 : $replacement/ego;
:>> 
:>> Ilya and Rick Delany pointed out to me that there exists a bug
:>> where $1 is not always reset on unsuccessful partial matches
:>> (I can't think of a better phrase to describe it at the moment).
:>> The bug makes me leary of depending on the defined'ness of $1.

:>Avoiding a bug is not a valid criterion for evaluating a potential 
:>solution to a problem.  Workarounds can be discussed afterwards.  
:>Anyhow, the code works in my tests.

Hee Hee.  When you deliver that program to your coworker and
she complains that it doesn't work right every time, you can
just say that your solution is valid.  It isn't your fault that
there is a bug in perl.  :-)

I know you didn't mean that as evidenced by your willingness
to discuss workarounds afterwards, but it was too fat and juicy
a target to resist.  No offense meant.


[snip]
:>I benchmarked both, and yours is more than twice as fast (not counting 
:>any time required to split the larger pattern into three pieces).

Those assertions in the re engine are really fast.  I am continuously
amazed.

:>> Potential missed overlaps was the only one I could think of
:>> on first blush.

:>I can't think of how that can happen with either approach.

If the replacement string overlapped (contained a subset or superset)
of the string it was replacing, then after a substitution, there may
exist a new target for replacement.  

-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: Thu, 7 Oct 1999 16:28:31 +0100
From: "beaumontsystems" <beaumontsystems@netscapeonline.co.uk>
Subject: Re: How to secure PERL-Scripts
Message-Id: <37fcae8d@plato.netscapeonline.co.uk>

Norbert Schuldt <schuldt@balticom.de> wrote in message
news:37FC6A8A.CF93358B@balticom.de...
> Hi Folks,
>
> I've installed certain domains (customers) on my IIS. The homedirs are
> all
> located on one physical drive. All customers use their own cgi-bin dir.
> ActivePerl is installed.
>
> Now there might be one problem : Using the system() command in PERL one
> customer can easily get the other one's information (files) or even
> "damage" the
> server. Is there any possibility to give a cgi-bin access to the
> customers
> which is "secure" ??

Allowing CGI programs is one of the (potentially) biggest security holes one
can have. It's more a question of (a) configuring the web server properly
(securely) and (b) taking certain measures in the CGI programs (regardless
of
language) to reduce risk. It's probably a question better put to other NGs
(for IIS and CGI).

>
> Please also reply by mail
>
> TIA
> Norbert




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

Date: Thu, 07 Oct 1999 11:10:11 -0600
From: "M. J. Brodzik" <brodzik@kryos.colorado.edu>
Subject: is this some version difference?
Message-Id: <37FCD3F3.7101C7B2@kryos.colorado.edu>

Hi,

I've been successfully using a Julian date convertor (I got it years
ago, and the author didn't sign it) in .pl files, via

 ...
require "jdate.pl";
 ...
$todays_jday = &today();

However, recently I started started using the pragma use strict, in a
perl module that was require'ing jdate.pl, and for the life of me
couldn't get visibility to the subroutines in jdate, although I could
see it's one state variable ($brit_jd) using the fully qualified name
($jdate::brid_jd).  Whenever I tried invoking one of the subroutines, I
kept getting errors about it being an undefined subroutine.  I was doing
this:

use strict;
require "jdate.pl";
 ...
$todays_jday = &jdate::today();

So I took a look at the subroutine definitions in jdate, and saw that
they
were declared like this:

sub main'today {
 ...
}

and, given the Camel book's comment that this is an old way to fully
qualify identifiers, I removed all of the "main'"s, which eliminated the
undeclared subroutine errors.

I'm curious for an explanation why this is so.  Can someone enlighten
me?

Thanks in advance,
Mary Jo


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

Date: 7 Oct 1999 17:42:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Memory leak in assignment
Message-Id: <7tim1f$me9$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Dan Sugalski 
<dan@tuatha.sidhe.org>],
who wrote in article <8_1L3.80$ck6.12727@news.rdc1.ct.home.com>:
> > I think there is some discussion of overhead of Perl storage in
> 
> >    perldoc perddebug
> 
> I'll go you one better. Let's take a look at sv.h:

Do not if you do not know how .c files threat sv.h.  Your calculations
are wrong.  Mine are correct.  ;-)

xiv is a cheating: no storage for xiv_pv and xiv_cur (sp?) is actually
allocated.  Similarly for xnv.

Ilya


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

Date: Thu, 07 Oct 1999 16:50:01 GMT
From: emlyn_a@my-deja.com
Subject: mkdir... and then!?
Message-Id: <7tiivi$ulo$1@nnrp1.deja.com>

I'm sorta new to perl, but I CANNOT find help for this seemingly simple
problem:

I need to mkdir under an existing directory called "users" (in the root
dir) using a $NewUser variable as the name. Creating the directory is no
problem, except it doesn't create the directory UNDER "users", it just
creates it in the root folder.

This is a problem, because then I need to create a new FILE within this
newly-created directory. Is creating a new file (thefile.dat) under an
existing directory done like this below?

open (DATAFILE, ">/users/NewUser/thefile.dat")

Wouldn't a mkdir be similar?

I'm sure this is simple to all you Perl gurus, but I'm having a really
tough time telling perl to separate literal strings from paths (it
creates a folder called "/users/$NewUser/"). I looked into the
ENV{'PATH'}, but there are no clear examples of how this is used - and
I've looked!

Any help would be greatly appreciated.

Frustr


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 7 Oct 1999 16:28:54 +0100
From: "Joe!" <j.mcnocher@misd.lon.ac.uk>
Subject: Re: Newbie Perler Needs simple parse help...
Message-Id: <7tiebc$3id$1@canard.ulcc.ac.uk>

Bruno Kovac wrote in message <7tiaen$glu$1@as102.tel.hr>...
>Can someone help me make a simple parse....
>
>I got ip address list.. in a file I open that.. read lines...
>and now I need to strip last number in ip..
>
>ie: 124.56.34.56
>
>how can I remove .56 ?
>tnx...
>with split()?
>please reply me a simple looking code and optimized... tnx
>
Bruno,

Try the following:
=====================
#
 .
 .
 .
$File = "ip.txt" ; #or whatever the file is called
open(INFILE,$File) or die "File $File not found !!" ;
while(<INFILE>) {
 $Addr = $_ ;
 print "Full: $Addr" ; #If required ??
 chomp($Addr) ;      # Perl5 cmd (or chop) - not really necessary but it
removes newline etc
 ($X,$Y,$Z) = split(/\./,$Addr) ; #Need to escape the "dot" char
 $NetAddr = "$X\.$Y\.$Z" ;       #Concat the first 3 parts of the Addr as
requested
 print "NetW: $NetAddr\n\n" ;   #print the NW addr or do whatever with it
}
 .
 .
 .
==================
This may not be the best perl scripting in the world, but I hope it is of
use to you.

Regards -- Joe!




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

Date: Thu, 07 Oct 1999 15:41:39 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Newbie Perler Needs simple parse help...
Message-Id: <Ta3L3.22755$m4.84057310@news.magma.ca>

Bruno Kovac wrote in:
news:7tiaen$glu$1@as102.tel.hr
>
>I need to strip last number in ip
>ie: 124.56.34.56
>
$ip = "124.56.34.56"
$class_c = substr($ip, 0, rindex($ip, '.'));
print $class_c, "\n";
==>
124.56.34





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

Date: Thu, 7 Oct 1999 10:38:49 -0500
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: Newbie Perler Needs simple parse help...
Message-Id: <Pine.A41.4.10.9910071033350.219760-100000@tigger.cc.uic.edu>

On Thu, 7 Oct 1999, Bruno Kovac wrote:

> Can someone help me make a simple parse....
> 
> I got ip address list.. in a file I open that.. read lines...
> and now I need to strip last number in ip..
> 
> ie: 124.56.34.56
> 
> how can I remove .56 ?
> tnx...
> with split()?

first of all, read:

perldoc -f split
perldoc -f perlre

> please reply me a simple looking code and optimized... tnx

Kind of demanding, aren't we? But I'll be nice. The split implementation
would be something like:

$last = (split /\./, $ip)[-1];

A regexp implementation might look like:

$ip =~ s/\.(\d{1,3})$/$1/;

BTW, these are just quick dash-offs, not necessarily "optimized" :)

-Seth
 www.pdamusic.com



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

Date: Thu, 7 Oct 1999 18:53:57 +0200
From: "Bruno Kovac" <bkovac@gmx.net>
Subject: Re: Newbie Perler Needs simple parse help...
Message-Id: <7tij5k$ee3$1@as102.tel.hr>


Samuel Kilchenmann <skilchen@swissonline.ch> wrote in message
news:Ta3L3.22755$m4.84057310@news.magma.ca...
> Bruno Kovac wrote in:
> news:7tiaen$glu$1@as102.tel.hr
> >
> >I need to strip last number in ip
> >ie: 124.56.34.56
> >
> $ip = "124.56.34.56"
> $class_c = substr($ip, 0, rindex($ip, '.'));
> print $class_c, "\n";
> ==>
> 124.56.34

All clear :)
This looks like like the best soulution for me ;)
tnx.
Tnx allot to all!!




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

Date: Thu, 07 Oct 1999 17:16:50 GMT
From: Babalorixa <babalorixa@poetic.com>
Subject: ODBC error retrieving large columns
Message-Id: <7tikhj$2g$1@nnrp1.deja.com>

Using perl win32 and the ODBC module:

Error: [911] [1] [0] "Could not allocate enough memory (-3 bytes) for
column 15.

when executing:
          if ($db->Sql($SqlStatement)){
              print "SQL failed.\n";
              print "Error: " . $db->Error() . "\n";
              $db->Close();
              exit;
          };

The column in question is a memo field that is the most essential part
of the query.  The driver is "Interbase 4.x Driver by Visigenic".  The
field is defined as type BLOB and the subtype TEXT.

This is happening for each important query I am trying to run.

Changing the field type isn't a viable option as far as I know.

Any suggestions on getting this data out?

Thanks


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 07 Oct 1999 18:35:29 +0200
From: Alexander Knack <ak@dasburo.de>
To: q2020262 <namecity@my-deja.com>
Subject: Re: Passwords
Message-Id: <37FCCBD1.2A346C@dasburo.de>

perldoc -f crypt!

my $plain = 'har har 99';

my $crypted = crypt ($plain , time());
print "$crypted\n";

if ($crypted eq crypt ($plain, $crypted)) {
  print "jup\n";
}
else {
  print "nop\n";
}

-- 
+--------------------------------------------------------------------+
| Alexander Knack  ........Entropie erfordert keine Wartung .........|
|  dasburo.de      ..................................................| 
+--------------------------------------------------------------------+


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

Date: Thu, 7 Oct 1999 10:40:56 -0500
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: Perl Doc..
Message-Id: <Pine.A41.4.10.9910071040230.219760-100000@tigger.cc.uic.edu>

On Thu, 7 Oct 1999, Bruno Kovac wrote:

> where can I get list of perl commands and help for each command?

perldoc perlfunc
perldoc -f <function>

-Seth
 www.pdamusic.com



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

Date: 7 Oct 1999 17:39:39 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Error as CGI under Apache/2
Message-Id: <7tilsr$mdd$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<reedjd@bitsmart.com>],
who wrote in article <7ti9ga$n5j$1@nnrp1.deja.com>:
> You're right, but I'm unsure how to proceed to fix it.
> 
> I have the line:
> SET PERLLIB_PREFIX=f:/;c:\emx\
> setup in the CONFIG.SYS file so it should set the environment variable
> globally.

> So, now I'm wondering where I can set various needed perl environment
> variables that Apache will be able to read them for it's CGI execution
> environment.

This is an Apache question, not a Perl question.  But note that as a
temporary workaround you may want to but

  BEGIN { $ENV{PERLLIB_PREFIX} = '...' }

into your scripts.

Ilya


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

Date: Thu, 07 Oct 1999 18:03:52 GMT
From: Ilya <ilya@speakeasy.org>
Subject: Re: Question about alarm and run away processes
Message-Id: <rvpo48ajd6e79@corp.supernews.com>

In comp.lang.perl.misc M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
> In article <rvncbf73n8a49@corp.supernews.com>,
> Ilya  <ilya@speakeasy.org> wrote:
>>
>>
>>I process a lot of sar data with a perl script. I have seen cases where the
>>sar data is incomplete or corrupt and the sar process hangs and begins to
>>increase CPU consumption until it hits 99%. 
>>
>>I would like to use the alarm function to check if I am dealing with a
>>run-away process and if it is indeed a run-away, kill it. 

> Start with the FAQ entry, which I found in seconds with
> 'perldoc -q timeout':

> perlfaq8:  How do I timeout a slow event?


=head2 How do I timeout a slow event?

Use the alarm() function, probably in conjunction with a signal
handler, as documented L<perlipc/"Signals"> and chapter 6 of the
Camel.  You may instead use the more flexible Sys::AlarmCall module
available from CPAN.


Not very descriptive, is it?

	==============================================================
	Paper money eventually returns to its intrinsic value -- zero.
                 				  -Voltaire
	==============================================================


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

Date: Thu, 07 Oct 1999 17:12:36 GMT
From: bounce.waxwing@dnai.com (Scot Hacker)
Subject: Re: Redirecting output to /dev/null
Message-Id: <8w4L3.11176$L4.780885@typ12.nn.bcandid.com>

On Wed, 06 Oct 1999 14:21:56 GMT, Clinton Pierce wrote:

>Almost!  When system() is passed a list, it doesn't hand the command to
>the shell for processing, it just exec's the program "hey" with the right
>arguments.  The shell gets no chance to do the "/dev/null" redirection
>because it's never called.

Ah... makes sense.

>If you had put that all together as one string, the shell gets to do the
>redirection and then run your program:
>
>$ControlSP = "hey SoundPlay set file of track 0 to file\($Current\) >
>/dev/null";
>system ($ControlSP);
>
>(Not tested, please verify...)


Well, this definitely stops the reply messages from coming back, which is
excellent, but it also fails to pass the value of $Current, so the audio 
player doesn't receive a filename. So now it looks like I just need to do
as above, but still have that $Current variable interpolated (is that the
right word?) correctly somehow. How do I do that?

Many thanks,

Scot


-- 

The BeOS Tip Server: http://www.betips.net/
The BeOS Bible: http://www.birdhouse.org/beos/bible/
The Alt.OS Usability Challenge: http://www.betips.net/challenge/


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

Date: Thu, 07 Oct 1999 09:35:37 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: search a data base file
Message-Id: <APC&1'0'50775dd2'8e5@igc.apc.org>

lowdogg wrote:
>search a flat file database and 
>if a component in database is already present
> not to print it
> but for some reason it still prints 
> no matter if the component is present or not 

I had a bit of trouble understanding your post.  This is what I make of it:

You have a permanent set of 'items' in a database.  You are going
through another list of items. For each item in your second list, if it 
exists in the database you do nothing, and if it doesn't you print it. 

> I have tryed the grep function a foreach loops 
> but none seem to work 

Posting some of your own code would be helpful.

> please help me

#!/usr/local/bin/perl -w

@db_list = qw ( one two three );
@second_list = qw ( three four five );

foreach $item (@db_list) { 
  $seen_in_db{ $item } = 1;
}

print "simple way\n";
foreach $item (@second_list) {
  print $item, "\n" unless exists($seen_in_db{$item});
}

# less-simple way
print "less simple way\n";
print join "\n", grep { ! exists($seen_in_db{$_}) } @second_list;
print "\n";
__END__
simple way
four
five
less simple way
four
five


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

Date: Thu, 07 Oct 1999 12:21:30 -0500
From: Natalya Barner <nbarner@uswest.com>
Subject: STDERR output doesn't match $!
Message-Id: <37FCD69A.E022B598@uswest.com>

I'm trying to write some code which will output the OS error message if
a system call fails.
The problem I'm having is that the message going to STDERR is not the
same message that's getting stored in $!.

Here's the code:
    #!/usr/local/bin/perl
    $rc = system("mkdir mydir");
    if ($rc)
    {
        print "couldn't do it: $!\n";
    }

And here's the output:
    mkdir: cannot create mydir: File exists
    couldn't do it: No such file or directory

Any help greatly appreciated.

--
Natalya Barner
Bass & Associates Consultant
-----------------------------
US West Information Technologies
nbarner@uswest.com




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

Date: Thu, 7 Oct 1999 10:58:45 -0500
From: "Enter your name here" <us,ppp,webs@ix.netcom.com>
Subject: test
Message-Id: <7tig12$45r@dfw-ixnews17.ix.netcom.com>






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

Date: Thu, 07 Oct 1999 18:01:42 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: To Abigail re: reading current threads
Message-Id: <ae5L3.379$Q11.71296@news.shore.net>

George Jempty <jb4mt@verbatims.com> wrote:
: Thanks so much; now, even though I don't address Uri directly, I get abusive
: email from him.  And in the meantime you have shown yourself to be an
: insufferable brown-nosing hypocrite.

Yer gettin to be pretty insufferable there yerself, pally...

--Art
-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Thu, 07 Oct 1999 15:28:25 GMT
From: xxxxx@cris.com (J. A. Mc.)
Subject: Re: tool to convert BMPs to GIFs programatically?
Message-Id: <3801baef.1536474@news2.lvdi.net>

On 7 Oct 1999 04:05:01 -0500, abigail@delanet.com (Abigail) wrote:

>Scott McMahan (scott@aravis.softbase.com) wrote on MMCCXXVI September
>MCMXCIII in <URL:news:EDpK3.1178$H32.71815@newshog.newsread.com>:
>__ 
>__ But GIFs are patent-protected, or something, and require a license
>__ from whoever has the legal rights to them, aren't they? Can you
>__ make freeware that supports GIFs without having to pay
>__ for the rights to them?
>
>Yes.  But you cannot make everything.
>
Wanna bet? <G>

Seriously, there is a suite of programs from a JPEG group that will
convert any jpg to a bmp or V.V. - on the fly. Several 'options' are
available in the process.

I used it on a Visual dBASE program that would only display .bmp files
in order to save disk space. Images were stored as .jpg, with the file
name in a field. When the record was called, the utility converted the
named .jpg to a "Pic01.bmp" and the data and screen were 'refreshed'.

Look for something like bmp2jpg and you should find the suite.



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

Date: Thu, 7 Oct 1999 18:00:02 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: tool to convert BMPs to GIFs programatically?
Message-Id: <Pine.HPP.3.95a.991007174943.22932A-100000@hpplus01.cern.ch>

On Thu, 7 Oct 1999, J. A. Mc. wrote:

> On 7 Oct 1999 04:05:01 -0500, abigail@delanet.com (Abigail) wrote:
> 
> >Scott McMahan (scott@aravis.softbase.com) wrote on MMCCXXVI September
> >MCMXCIII in <URL:news:EDpK3.1178$H32.71815@newshog.newsread.com>:
> >__ 
> >__ But GIFs are patent-protected, or something, and require a license
> >__ from whoever has the legal rights to them, aren't they? Can you
> >__ make freeware that supports GIFs without having to pay
> >__ for the rights to them?
> >
> >Yes.  But you cannot make everything.

> Wanna bet? <G>

I can't help suspecting that there has been a failure of information
transfer here.  I interpreted Abigail's comment as referring back the 
earlier point made, that there is nothing preventing you from creating
GIF format, since the patent claims refer to a specific compression
algorithm, and you don't have to use that algorithm.  (I'm sure Abigail
will be quick to correct me if I misinterpreted the message ;-)

> Seriously, there is a suite of programs from a JPEG group that will
> convert any jpg to a bmp or V.V. - on the fly. 

An amusing party trick, but what use in this context?  Images that are
good for GIF or PNG representation are usually very unsuitable as JPEGs,
and vice versa (see Tom Lane's JPEG FAQ). 




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

Date: 07 Oct 1999 08:32:07 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: We do complex Perl Programming
Message-Id: <m1wvszchl4.fsf@halfdome.holdit.com>

>>>>> "David" == David Cassell <cassell@mail.cor.epa.gov> writes:

David> Oh.  I thought they meant 'complex' programming.  As in
David> 'a large part of it is imaginary'.   :=)

Real expenditures, imaginary P/E ratios. :)

-- 
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: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 1013
**************************************


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