[7618] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1244 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 29 12:17:19 1997

Date: Wed, 29 Oct 97 09:00:35 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 29 Oct 1997     Volume: 8 Number: 1244

Today's topics:
     ------ C o m p r e h e n s i v e  I n t e r n e t   P r (Joe Bob)
     Re: 500 server error invoking perl script <djb@16straight.com>
     Re: ANNOUNCE: IndexMaker 2.0: an index.html maker from  (Jason Gloudon)
     Re: Best way to comma seperate a number? <webmaster@dynamicweb.com>
     Bug in DynaPerl.pm? <tdonlan@storystreet.com>
     Re: detecting reload (Jason Gloudon)
     Re: detection of first execution since login (Steve Grantz)
     Re: Help me optimize this functionality? (Toutatis)
     Re: Help me optimize this functionality? (Jonathan Feinberg)
     Re: Help me optimize this functionality? (John L. Allen)
     HELP: EXCEL Postprocessing on Unix (Bernhard Ehrminger)
     Re: How to send keystrokes from Perl to Win95 app (Ronald L. Parker)
     Interesting PERL command - need help <paul.george@gsc.gte.com>
     Re: Interesting PERL command - need help <smantri@osf1.gmu.edu>
     Re: Internal Server Error (Bill Mitchell)
     Re: perl and gifs or ftp (Jason Gloudon)
     Perl Positions in Pa. <edpbala@fast.net>
     perl script memory leak (Keith Willis)
     Re: perl script memory leak (Mike Heins)
     Re: perl script memory leak (Jason Gloudon)
     pod2html for all files in a directory structure <vandevegt@lucent.com>
     Serving Perl on Win95 <jdscheel@tasc.com>
     Re: Serving Perl on Win95 <ryan@ramresearch.com>
     System Call restart on SIGALRM <jklein@alerts.co.il>
     using -s to get file size (JoyDivisin)
     Re: Zipping files on a UNIX system, with a cgi Perl scr <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 29 Oct 1997 16:38:02 GMT
From: sysadmin@villageidiot.com (Joe Bob)
Subject: ------ C o m p r e h e n s i v e  I n t e r n e t   P r o g r a m m e r 's   R e s o u r c e -------
Message-Id: <3457662a.1988960@news.mindspring.com>



Digital Tool is an 2.5 year old web site that is slowly but steadily
evolving into a comprehensive internet programmer's resource...

We are in the process of updating and adding a chat facility, and we
are bolstering our VB, NT, IIS, Access, and VBA related links...

Best of all, you don't have to deal w/ too many ads. spinning
graphics, or outdated links (currently ~2.3%) out of >800 links...

All browsers are welcome, but of course, the more fun experience comes
w/ Nav 3+ and MSIE 3+...

Best, Tom Porter, Ph.D.
http://www.dtool.com

THE DIGITAL TOOL
Electric Fence

SPAM Bait: root@mailloop.com,jorge@mailloop.com,jorgeh@earthlink.net
mabel@SALLYNET.COM , iq2000@usa.net ,  remove@hotmail.com


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

Date: Wed, 29 Oct 1997 09:43:23 -0500
From: Dan Birchall <djb@16straight.com>
To: lusk@dg-rtp.dg.com
Subject: Re: 500 server error invoking perl script
Message-Id: <34574B8B.31DF@16straight.com>

lusk@dg-rtp.dg.com wrote:

> when I invoke a url to a simple hello world script,
> I get a 500 server error, and the error log sez:
> 
>   httpd: could not create new process: 193
> 
> I don't see anybody else having any trouble, so I 
> must be doing something simple wrong.  Can anybody
> help me?

A couple possibilities come to mind immediately:

1. Is the script world-executable (chmod 755)?
2. Does it call any other programs?  (I know, a
   "hello world" program really shouldn't! ;)  If
   so, are their permissions correct?
3. Is the server very heavily loaded?
4. Is the server's process table too small?
5. Does the server have a per-user process
   limit, and if so, is the process limit for the
   user ID that the httpd runs as too small?

-Dan

-- 
Dan Birchall - Internet Sysadmin, 16 Straight Communications
520 Fellowship Road, Suite A-112, Mount Laurel NJ 08054-3400
djb@16straight.com, (609) 231-7887, (888) 416-7878, NIC: DJB


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

Date: 29 Oct 1997 14:45:22 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: ANNOUNCE: IndexMaker 2.0: an index.html maker from PDF, HTML and other files
Message-Id: <637i62$lkc$3@daily.bbnplanet.com>

Fabrizio Pivari (pivari@geocities.com) wrote:
: Hi,

: I'm glad to announce the version 2.0 of IndexMaker a perl script to make
: an index.html file from PDF, HTML and other files.
: At the moment, it uses the /Author field and the first /Title field in
: every matched PDF files, the <TITLE> </TITLE> field in every matched
: HTML files and the name of the file in the others.
: It should work with PERL 4 and 5.

: What's new with version 2.0
: New input files format: HTML, OTHER 

: This is the URL where you can find the tool
: http://www.geocities.com/CapeCanaveral/Lab/3469

: Enjoy it!

: Send me your suggestions.

Post this to the correct newsgroup comp.lang.perl.announce :).

Jason Gloudon


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

Date: Wed, 29 Oct 1997 11:24:52 -0500
From: "JG Motolanez" <webmaster@dynamicweb.com>
Subject: Re: Best way to comma seperate a number?
Message-Id: <637ns5$639$1@news2.digex.net>


Eric wrote in message <62ekss$1s1$1@gte2.gte.net>...
>>
>>    This one will do it for you:
>>
>>        sub commify {
>>            local $_  = shift;
>>            1 while s/^(-?\d+)(\d{3})/$1,$2/;
>>            return $_;
>>        }
>>
>>        $n = 23659019423.2331;
>>        print "GOT: ", commify($n), "\n";
>>
>>        GOT: 23,659,019,423.2331
>>[snip rest of faq answer]
>
>Okay, I found this in the FAQ.  Why does it work?  More specifically, why
does:
>
> 1 while s/^(-?\d+)(\d{3})/$1,$2/;
>
>do what it does??  What is that 1 doing in there?
>
>-- Eric

This might help.
It'll show you how $_, $1 and $2 change as the while loop executes.

sub commify {
        local $_ = shift;
        #1 while s/^(-?\d+)(\d{3})/$1,$2/;
        printf "%25s\n",$_;
        while ( s/^(-?\d+)(\d{3})/$1,$2/ ){
                printf "%25s\t%15s\t%15s\n",$_,$1,$2;
        }
        return $_
}
$n = '-12444555345.6789';
$result = commify($n);
$sep = '='x71;
print "$sep\n";
print "GOT: $result\n";

--
JG Motolanez
DynamicWeb Enterprises, Inc.





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

Date: Wed, 29 Oct 1997 10:06:20 -0500
From: Ted Donlan <tdonlan@storystreet.com>
Subject: Bug in DynaPerl.pm?
Message-Id: <345750EC.32E7@storystreet.com>

To Anyone,

I am using the perl module DBI.pm with the necessary driver
for Oracle (retrieved from the site http://www.hermetica.com/
technologia/DBI/).

The problem lies in the use of the module in standard perl5 format.
After merely typing "use DBI;", the interpreter returns an
error at run time with the following statement:

Can't load '/usr/local/lib/perl5/site_perl/sun4-solaris/auto/DBI/DBI.so'
for module DBI: ld.so.1: perl5: fatal: relocation error: symbol not
found: Perl_diehook: referenced in
/usr/local/lib/perl5/site_perl/sun4-solaris/auto/DBI/DBI.so at
/usr/local/lib/perl5/DynaLoader.pm line 140.

Is the DynaLoader buggy or am I doing something wrong.  I thank anyone
in advance for their concern into this matter.

-Ted
tdonlan@storystreet.com


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

Date: 29 Oct 1997 14:29:28 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: detecting reload
Message-Id: <637h88$lkc$1@daily.bbnplanet.com>

Mike Rambour (me@no-spam.com) wrote:
: I have a script that outputs data to a data file and creates a web
: page on the fly.  Its all working but if the user presses the reload
: button on his browser it reloads the thing and I end up with duplicate
: data in my data file since the data is passed as hidden text fields.

:  Is there a way to detect a reload, I tried looking at REQUEST_METHOD
: but it shows a POST not a reload...

I believe you want to ask this question on comp.infosystems.www
This is a CGI question not a Perl question. 
Try comp.infosystems.www.authoring.cgi.


Jason Gloudon


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

Date: 29 Oct 1997 16:42:44 GMT
From: sgrantz@visi.com (Steve Grantz)
Subject: Re: detection of first execution since login
Message-Id: <637p24$o82$1@darla.visi.com>

Chenyang Xu (chenyang@mashie.ece.jhu.edu) wrote:
: On Sun, 26 Oct 1997, Tom Phoenix wrote:
: 
: > On Sat, 25 Oct 1997, Chenyang Xu wrote:
: > 
: > > On UNIX, is there a way for a perl script to find out whether its
: > > current execution is the first execution since the recent user login?
: > 
: > upon startup. If that won't do what you want, can you let us know what
: > you're trying to accomplish? Good luck!
: > 
: 
: Many thanks for your input. I am using a SGI workstation. What I am trying
: to accomplish is to write a simple message script using perl. The script
: is put in the .login (or .cshrc). I only want my message to be displayed
: when I login. Without a detection of first execution since login, my
: message will be displayed everytime when I open a new window which is
: quite annoying. I have tried to put it in the .profile but it doesn't

Why not have the login script write to a file called lastday
and put in today's date, or some such thing. Then have the message script
check the date in lastday to determine whether is should execute?

This would make midnight logins annoying, but it is some kind of
workaround.

-g


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

Date: 29 Oct 1997 15:28:16 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Help me optimize this functionality?
Message-Id: <toutatis-ya023180002910971628160001@news.euro.net>

Doug Seay <seay@absyss.fr> wrote:
> Toutatis wrote:
> > Mattias.Lonnqvist@-NO-SPAM-.uidesign.se wrote:

> > > translates %0a - %ff to upper caps.

> > Probably
> > s/%([\da-fA-F]{2})/lc(pack('c', hex ($1))/ge;
> > would do what you want.
> 
> 
> Close, but I think
> 
>         s/(%[\da-fA-F]{2})/uc($1)/ge;
> 
> will work better.

You are right concerning the original question. I actually misunderstood
it. Nevertheless, since I expect he wants to feed his values to a stupid
URL-decode routine (one that only understands uppercase hex values), this
little routine *might* actually do what he wants, by providing a smarter
routine for doing the job. Doesn't need the uc or lc part anymore
probably...

-- 
Toutatis


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

Date: 29 Oct 1997 15:45:11 GMT
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Help me optimize this functionality?
Message-Id: <637lm7$3hh$1@gte2.gte.net>

mattias.lonnqvist@-NO-SPAM-.uidesign.se said...
> Currently I have a small function which translates certain sequences of
> chars,
> or to be precise, it translates %0a - %ff to upper caps.

s/(\%[0-9a-f][0-9a-f])\b/\U$1/g;

and, in English...

s { # substitute
    ( # save the following in $1
        \%       # a literal percent sign
        [0-9a-f] # a hex digit
        [0-9a-f] # another hex digit
    )
    \b  # only if that's the whole word (e.g., not %4cats)
  }
  {
    \U$1  # with the parenthesized expression converted to uppercase
  }gx;    

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Manhattan, NY


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

Date: 29 Oct 1997 09:59:22 -0500
From: allen@gateway.grumman.com (John L. Allen)
Subject: Re: Help me optimize this functionality?
Message-Id: <637j0a$kaa@gateway.grumman.com>

In article <345735DD.1763E0A2@absyss.fr>, Doug Seay  <seay@absyss.fr> wrote:
>> Mattias.Lonnqvist@-NO-SPAM-.uidesign.se wrote:
>> 
>> > Currently I have a small function which translates certain sequences of
>> > chars,
>> > or to be precise, it translates %0a - %ff to upper caps.
>
>Toutatis wrote:
>>
>> Probably
>> s/%([\da-fA-F]{2})/lc(pack('c', hex ($1))/ge;
>> would do what you want.
>
>Close, but I think
>
>	s/(%[\da-fA-F]{2})/uc($1)/ge;
>
>will work better.

And 

	s/(%[\da-fA-F]{2})/\U$1/g;

will work faster.

John.









-- 
_/JohnL\_allen@gateway.grumman.com <Sun>: 9.5 billion pounds per sec to energy
~\Allen/~Fax: 516-575-7428    <Universe>: 1e22 stars = 22 solar masses per sec


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

Date: 29 Oct 1997 14:37:09 GMT
From: bernhard@perm.geologie.uni-freiburg.de (Bernhard Ehrminger)
Subject: HELP: EXCEL Postprocessing on Unix
Message-Id: <637hml$g6t$1@n.ruf.uni-freiburg.de>

Hi,

I have the task of preparing a big bunch of Excel
files with lots of worksheets within each file for
a statistical analysis package (reading ASCII) on a Unix host.

I know there are tools like "OLE Automation extensions"
which allow something like this 
(copied from http://tigger.rdg.ac.uk/perl/Perl-Win32/oleauto.html):

use OLE;
     $excel = CreateObject OLE 'Excel.Application'
             or warn "Couldn't create new instance of Excel App!!";
     $excel->Workbooks->Open( 'test.xls' );
     $excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)->{Value} = 'foo';
     $excel->Workbooks(1)->Worksheets('Sheet1')->Cells(1,2)->{Value} = 'bar';
     $excel->Save(); $excel->Quit();

As far as I know, this tool is designed for Windows NT or Windows 95?
What further Perl-modules do I need for applying OLE.pm on Unix?


I would be glad for any recommendations, examples or comments on this!

with best regards Bernhard


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

Date: Wed, 29 Oct 1997 14:56:08 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: How to send keystrokes from Perl to Win95 app
Message-Id: <34574c50.2651072@news.supernews.com>

On Wed, 29 Oct 1997 10:42:39 GMT, ebohlman@netcom.com (Eric Bohlman)
wrote:

>Ronald L. Parker (ron@farmworks.com) wrote:
>: On 27 Oct 1997 14:00:45 GMT, "L. Dwynn Lafleur" <lafleur@usl.edu>
>: wrote:
>
>: >can I open Notepad and then issue a command in the script to insert a text
>: >string into the Notepad document?
>
>: Try using Win32::API and use the SendMessage or PostMessage function.
>:
>Using SendMessage() or PostMessage() aren't particularly good ways of
>sending keystrokes to applications because they bypass a bunch of queuing,
>translation and state-maintenance mechanisms.  

Agreed.  OTOH, you don't need to send any keystrokes to insert a text
string (assuming the text is in the clipboard; you can put it there
from Perl with Win32::Clipboard.) Of course, the original poster did
mention keystrokes specifically, but it may have been out of ignorance
of other methods.  Depending on what he wants to do, SendMessage or
PostMessage might be better.  Perhaps I should have been clearer.



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

Date: Wed, 29 Oct 1997 09:19:18 -0500
From: Paul George <paul.george@gsc.gte.com>
Subject: Interesting PERL command - need help
Message-Id: <345745E6.638BA58B@gsc.gte.com>


--------------8A9331BE71B1CD94FD92F7D6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I found some code :

open (MAIL, "|");

print MAIL "To: $address";
print MAIL "From: $return";
print MAIL ......
 .
 .
 .
close(MAIL);

I tried the same thing but it never sent the mail.  I changed it to

open(MAIL, "| mail -t $address");
print MAIL "From: $return";
 .
 .
close(MAIL);

and it did send the mail.

Does anyone know what this command does?   open(MAIL, "|");

Thanks in advance.


--------------8A9331BE71B1CD94FD92F7D6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
I found some code :

<P><TT><FONT COLOR="#000099">open (MAIL, "|");</FONT></TT><TT><FONT COLOR="#000099"></FONT></TT>

<P><TT><FONT COLOR="#000099">print MAIL "To: $address";</FONT></TT>
<BR><TT><FONT COLOR="#000099">print MAIL "From: $return";</FONT></TT>
<BR><TT><FONT COLOR="#000099">print MAIL ......</FONT></TT>
<BR><TT><FONT COLOR="#000099">.</FONT></TT>
<BR><TT><FONT COLOR="#000099">.</FONT></TT>
<BR><TT><FONT COLOR="#000099">.</FONT></TT>
<BR><TT><FONT COLOR="#000099">close(MAIL);</FONT></TT><TT></TT>

<P><TT>I tried the same thing but it never sent the mail.&nbsp; I changed
it to</TT><TT></TT>

<P><TT>open(MAIL, "| mail -t $address");</TT>
<BR><TT>print MAIL "From: $return";</TT>
<BR><TT>.</TT>
<BR><TT>.</TT>
<BR><TT>close(MAIL);</TT><TT></TT>

<P><TT>and it did send the mail.</TT><TT></TT>

<P><TT>Does anyone know what this command does?&nbsp;&nbsp; open(MAIL,
"|");</TT><TT></TT>

<P><TT>Thanks in advance.</TT>
<BR><TT></TT>&nbsp;</HTML>

--------------8A9331BE71B1CD94FD92F7D6--



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

Date: Wed, 29 Oct 1997 10:55:10 -0500
From: shiva mantri <smantri@osf1.gmu.edu>
To: Paul George <paul.george@gsc.gte.com>
Subject: Re: Interesting PERL command - need help
Message-Id: <Pine.OSF.3.95q.971029104751.16765A-100000@osf1.gmu.edu>

open (MAIL, "|");

is wrong. "|" is pipe command like in UNIX. if u dont have any arguments
after | it wont do any thing. 

"|" its a pipe command. anything on the left side of the | command will be
output to the arguments on the right side. so if u dont have anything on
rightside it wont do anything. 

some common | commands 
ls | lpr -Psomething ///to print the output to a printer
cat filename | mail username  // to mail the contents of a file to a
user..

so when u used MAIL | mail username it sent a mail..

shiva
 
 On Wed, 29 Oct 1997, Paul George wrote:

> I found some code :
> 
> open (MAIL, "|");
> 
> print MAIL "To: $address";
> print MAIL "From: $return";
> print MAIL ......
> .
> .
> .
> close(MAIL);
> 
> I tried the same thing but it never sent the mail.  I changed it to
> 
> open(MAIL, "| mail -t $address");
> print MAIL "From: $return";
> .
> .
> close(MAIL);
> 
> and it did send the mail.
> 
> Does anyone know what this command does?   open(MAIL, "|");
> 
> Thanks in advance.
> 
> 

Shiva Mantri  
---
7032738119,7039938736



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

Date: 29 Oct 1997 15:36:25 GMT
From: mitchell@leadbelly.math.ufl.edu (Bill Mitchell)
Subject: Re: Internal Server Error
Message-Id: <MITCHELL.97Oct29103625@leadbelly.math.ufl.edu>

In article <633a31$s1c$1@news01.btx.dtag.de> GEBiernat@t-online.de (Gunther E. Biernat) writes:

> 
> The "Internal Server Error" is what you'll get from the HTTP server 
> whenever a script fails to give a _correct_ and _complete_ result.
> 

It might be helpful to be more precise.  If the script executes
(whether or not correctly and completely) and prints a line such as 
"Content-type: text/html\n\n", then you should see whatever output is
passed.   If it does not execute, or if something else is printed
first, then you will see the "Internal Server Error".
--
    Bill Mitchell
    Dept of Mathematics,        The University of Florida
    PO Box 118105, Gainesville, FL 32611--8105
    mitchell@math.ufl.edu	(352) 392-0281 x284

  


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

Date: 29 Oct 1997 14:38:48 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: perl and gifs or ftp
Message-Id: <637hpo$lkc$2@daily.bbnplanet.com>

Andrew Taylor (aktaylor@austin.ibm.com) wrote:
: I would like to be able to read in a manipulate a gif file in perl! 
: Does anyone know of any perl modules that already allow you to do this?

: Also, I would like my perl script to be able to ftp (not tftp) to an ftp
: server, login as some user/password, and then do puts and gets.  Anyone
: know of any perl modules that already do this?

: -- Andrew

Try looking in the "obvious places" like www.perl.com. Not so obvious is the
 CPAN module archive.

Jason Gloudon


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

Date: Wed, 29 Oct 1997 09:35:43 -0800
From: EDP Contract Services <edpbala@fast.net>
Subject: Perl Positions in Pa.
Message-Id: <345773EF.7098@fast.net>

Enjoy the flexibility of consulting while benefiting 
from the stability of working with an industry leader.  

If you are a highly skilled Information Technology 
professional programming in Perl / JAVA or Web Design
who wants to apply your expertise and master emerging
technologies while earning compensation commensurate
with your experience, email your resume to the attention
of Jeff at: edpbala@fast.net

Positions require 2+ years paid professional experience.

Detailed descriptions available below, or visit our website at:

http://edpcs.com/bin/search.pl?edp403

Job Code:  3271/rdbms/1029
Duration:  6 Months
Position:  Programmer / Analyst
Duties:    International pharmaceutical development
           and design company is seeking a candidate
           to enhance and develop a gui application
           using Perl and CGI under UNIX. Should
           have some relational database exposure.
           Application is a document management system.
           Back end database is Oracle. 
           Knowledge of documentum is a plus.
Note:      Possible 6 month extension
Requires:  UNIX, CGI Script, WEB and RDBMS experience
Location:  Northwest Philadelphia Suburbs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Job Code:  3120/C/1029
Duration:  3 Months
Position:  Sr. Programmer / Analyst
Duties:    Major international pharmaceutical
           company is looking for a candidate to
           develop test suites for Year 2000
           compliance. test environment is Unix
           (solaris) on sun work stations. Test
           experience is helpful. Working knowledge
           of Pearl and or Web devlopement is a
           big plus. If person works out will be
           extended 1year plus. Good communications
           skills are a must.
Requires:  UNIX and C experience
Location:  Nothern Philadelphia Suburbs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Job Code:  2870/c/1029
Duration:  2 Months
Position:  Programmer / Analyst
Duties:    Major pharmaceutical development and
           design corporation looking for 
           candidate to enhance prototype
           application
Requires:  C, UNIX, RDBMS and Perl experience 
Location:  Northern Philadelphia Suburbs 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Job Code:  2796/perl/1029
Duration:  4 Months
Position:  Sr. Programmer / Analyst
Duties:    International pharmaceutical
           development company seeks candidate
           to develop and integrate advanced
           software of Bacteria hyperlinking
           system. 
Requires:  C, UNIX, Perl and RDBMS experience 
Location:  Northern Philadelphia Suburbs 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Job Code:  2780/web/1029
Duration:  6 Months
Position:  Programmer / Analyst
Duties:    Development of Scientific applications
Requires:  C, UNIX , PERL and Web experience 
Location:  Northern Philadelphia Suburbs 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
For the past 20 years we have been placing seasoned 
Information Technology professionals in long-term 
consulting contracts with our Fortune 500 client 
companies in the Philadelphia (PA/NJ/DE) area. 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please forward resume to:

Jeff , Technical Recruiting
EDP Contract Services
401 City Ave., Suite 915
Bala Cynwyd, PA 19004
610 667-8735 (fax)     610 667-2990 (voice)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
U.S. Citizenship, Green Card, F-1 or TN eligibility required




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

Date: Wed, 29 Oct 1997 13:54:06 GMT
From: keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
Subject: perl script memory leak
Message-Id: <345a3d88.184932558@elf.bri.hp.com>


I have this fairly noddy little script which repeatedly connects to a
daemon, sends it a command, and displays the returned text in a curses
window.  When it's running, it very gradually leaks memory, and if I
watch it in top or whatever, it increases in size.  Can anyone spot
the dumb mistake I am almost certain to have made?  Any creative
criticism of the overall script design also welcome, BTW!

-------------------------------8<-------------------------------------
#!/usr/bin/perl -w
use strict;
use subs qw(InitWindows InitSignals PutLine PutTimeString);

use Curses;
use Date::Format;
use IO::Socket;


my ($line, $cmnd, $sock, $sleepcounter, $curse, $mywin, $subwin);

$cmnd  = "SHOW\n";

InitWindows;
InitSignals;

# iterate the following loop until a caught signal arrives
while(1)
{
  $sock = IO::Socket::INET->new(PeerAddr => $ENV{'MYDAEMON_HOST'},
                                PeerPort => $ENV{'MYDAEMON_PORT'},
                                Proto    => 'tcp')|| die "socket: $!";

  syswrite $sock, $cmnd, length($cmnd);

  $subwin->move(0, 0);
  while (defined($line = <$sock>)) 
  {
    if ($line !~ /~/) { PutLine; }  # '~' is the EOT marker
    else              { last; }
  }
  $sock->close || die "close: $!";

  PutTimeString;
  $sleepcounter = 5;
  while ($sleepcounter > 0)
  {
    sleep(1);
    PutTimeString;
    $sleepcounter--;
  }
}
endwin;
exit;


sub InitWindows
{
  $curse  = new Curses;
  $mywin  = newwin(13,90,0,0);
  $subwin = $mywin->subwin(11,88,1,1);
  $mywin->box('|','-');
  $mywin->refresh;
}

sub InitSignals
{
  $SIG{TERM}  = \&StopHandler;
  $SIG{QUIT}  = \&StopHandler;
  $SIG{ABRT}  = \&StopHandler;
  $SIG{INT}   = \&StopHandler;
  $SIG{HUP}   = \&StopHandler;
  $SIG{WINCH} = \&WinHandler;
}

sub PutLine
{
  chomp $line;
  $subwin->addstr($line);
  $subwin->addch("\n");
}

sub PutTimeString
{
  $subwin->move(10, 43);
  $subwin->addstr(ctime(time));
  $subwin->refresh;
}

sub StopHandler
{
  endwin;
  exit;
}

sub WinHandler
{
  $mywin->clear;
  $mywin->box('|','-');
  $mywin->refresh;
}

----------------------------------------------------------------------
The above message reflects my own views, not those of Hewlett Packard.
When emailing me, please note that there is no '.junk' in my address.


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

Date: 29 Oct 1997 14:40:00 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: perl script memory leak
Message-Id: <637hs0$sgh$1@vixen.cso.uiuc.edu>

Keith Willis (keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com) wrote:
: 
: I have this fairly noddy little script which repeatedly connects to a
: daemon, sends it a command, and displays the returned text in a curses
: window.  When it's running, it very gradually leaks memory, and if I
: watch it in top or whatever, it increases in size.  Can anyone spot
: the dumb mistake I am almost certain to have made?  Any creative
: criticism of the overall script design also welcome, BTW!

Perhaps never undefining your objects and letting them go out of scope?

Regards,
Mike Heins


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

Date: 29 Oct 1997 15:17:16 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: perl script memory leak
Message-Id: <637k1s$lkc$4@daily.bbnplanet.com>

Mike Heins (mheins@prairienet.org) wrote:
: Keith Willis (keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com) wrote:
: : 
: : I have this fairly noddy little script which repeatedly connects to a
: : daemon, sends it a command, and displays the returned text in a curses
: : window.  When it's running, it very gradually leaks memory, and if I
: : watch it in top or whatever, it increases in size.  Can anyone spot
: : the dumb mistake I am almost certain to have made?  Any creative
: : criticism of the overall script design also welcome, BTW!

: Perhaps never undefining your objects and letting them go out of scope?
$sock = IO::Socket::INET->new(PeerAddr => $ENV{'MYDAEMON_HOST'},
                                PeerPort => $ENV{'MYDAEMON_PORT'},
                                Proto    => 'tcp')|| die "socket: $!";

Were you referring to this ? I believe that by replacing sock with a new
reference the reference to previous object that all references to the old
object should have gone away, and it should be marked for desctruction.
I'm guessing it's the lazy Perl garbage collection that may be what's at 
work here ? (or not at work depending on which way is up for you).

Jason Gloudon


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

Date: Wed, 29 Oct 1997 09:11:06 -0600
From: "J.M. VandeVegt" <vandevegt@lucent.com>
To: vandevegt@lucent.com
Subject: pod2html for all files in a directory structure
Message-Id: <34575209.1CD97B8@lucent.com>

I am trying to create a set of HTML files from the POD found in all the
files in my library install directory.

I am certain that the last time I did this, all I did was simply execute
pod2html in <prefix>/lib, and it created an HTML file for each file that
contained POD, and it created index.html. This was version 5.00393.

I am not able to replicate this behavior in 5.00401.

Am I stuck doing something like
find . -type f -exec pod2html --infile={} --outfile={}.html \;
???????

Any help appreciated. Thanks.

--
|----Jim VandeVegt----| Computer Systems Engineer |===UNIX--WWW--FTP--EMAIL===|
|-Lucent Technologies-|    vandevegt@lucent.com   |\\\\\\Nothing But Net//////|
|Bell Labs Innovations|                      |
|-----Omaha Works-----|-----------------#include ---------------|





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

Date: Wed, 29 Oct 1997 09:10:09 -0500
From: Jim Scheel <jdscheel@tasc.com>
Subject: Serving Perl on Win95
Message-Id: <345743C1.184E@tasc.com>

Hi All,

  I'd like to run a few Perl scripts from a local Netscape browser.  I
have Perl32 installed, but I can only run Perl scripts from the DOS
command line.  Is there a way to run Perl from Netscape with everything
contained on a Win95 platform (i.e., not connected to a Unix box)?

  Thanks for your help, Jim


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

Date: Wed, 29 Oct 1997 11:33:04 -0500
From: "Ryan McGuigan" <ryan@ramresearch.com>
Subject: Re: Serving Perl on Win95
Message-Id: <637o92$7bg$1@news.fred.net>

>Hi All,
>
>  I'd like to run a few Perl scripts from a local Netscape browser.  I
>have Perl32 installed, but I can only run Perl scripts from the DOS
>command line.  Is there a way to run Perl from Netscape with everything
>contained on a Win95 platform (i.e., not connected to a Unix box)?
>


Yes you can.  First you need to have perl for win32 installed properly.
You'll need to setup a filetype to run with perl such as *.pl.  You will
also need to install a web server to be able to use perl as cgi scripts.




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

Date: Wed, 29 Oct 1997 14:30:32 +0200
From: Joe Klein <jklein@alerts.co.il>
Subject: System Call restart on SIGALRM
Message-Id: <Pine.SOL.3.95.971029140952.1345L-100000@cain.alerts.co.il>

There appears to be another nasty gotcha of going from 5.003 to 5.004
relating to signal handling. In 5.003, if an alarm went off during a
system call, the system call would be interrupted. In 5.004 the system
call gets restarted. (I'm running Solaris 2.x). 

So, for instance, the following program will terminate in 5.003, but won't
in 5.004. 

###################

$SIG{ALRM} = sub { print "alarmed!!!\n"; };
alarm 3;
$buf = <>;
alarm 0;
 
# I want my program to get to here
 
print STDERR "Program ends\n";

####################

I looked at the source and was able to verify that code was changed so
that the SA_RESTART is turned with a call to sigaction. I dont know why
this was done. Based on my reading of the Solaris 2.4 man pages, the
default behavior should be to interrupt the system call. 

(I know that the perlfunc man page mentions that Perl might decide to turn
on the SA_RESTART flag and then proceeds to give a convoluted way around
this problem by putting the code inside an eval and then checking $@, but
I want to avoid using eval if at all possible). 

Be that as it may, I thought that I would try to clear the SA_RESTART flag
myself by using sigaction from the POSIX module. The code I used verified
that the signal flag is initially 0 for 5.003 and non-zero (though not
always the same value) for 5.004, however the code did not succeed in
turning off the SA_RESTART flag. The code I used was:

###############
use POSIX;

# Check signal flags
$act = new POSIX::SigAction;
$oact = new POSIX::SigAction;
 
sigaction ALRM, $act, $oact;
print "flags is $oact->{'FLAGS'}\n";
 
# Attempt to clear SA_RESTART flag
foreach (qw(MASK HANDLER))
    { $act->{$_} = $oact->{$_}; }
$act->{'FLAGS'} &= ~SA_RESTART;
sigaction ALRM, $act, $oact;
##############

1. Does anybody know why perl was changed to restart system calls ?

2. Can anybody tell me what I need to do in order to clear the SA_RESTART
flag ? 

Thanks for your help,
Joe Klein



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

Date: 29 Oct 1997 16:10:39 GMT
From: joydivisin@aol.com (JoyDivisin)
Subject: using -s to get file size
Message-Id: <19971029161001.LAA29202@ladder01.news.aol.com>

Hi -

I'm working on a program to gather file sizes and I'm using -s. It works fine
 within the directory the program runs in but when trying other directories, it
 doesn't return the file size (but it does return the file name, though).

Both directories are owned by nobody and the program runs as nobody. Even
 running the program as root returns the same result.

I've tried stat as well. While it returns a different number (not the actual
 file size in bytes) within its own directory, it doesn't return the files
 sizes in other directories.

Any clues?

David Anderson


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

Date: Wed, 29 Oct 1997 08:49:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "B.J. Dweck" <bjdweck@cloud9.net>
Subject: Re: Zipping files on a UNIX system, with a cgi Perl script
Message-Id: <Pine.GSO.3.96.971029083539.25358F-100000@usertest.teleport.com>

On Tue, 28 Oct 1997, B.J. Dweck wrote:

> Newsgroups: comp.lang.perl.misc, comp.lang.perl, comp.lang.perl.modules,
>     comp.lang.perl.tk

If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.

Of course, in this case, you don't seem to be doing anything that belongs
in c.l.p.tk, and you don't mention any modules (although, of course, there
are modules which might help with your problem). The frequent posting "A
Primer on How to Work With the Usenet Community" in news.announce.newusers
has good advice on limiting cross-posting and using the Followup-To
header line - as I've done here.

> When I run the program from the shell, while logged on to my
> account, it works fine.  When I run it through the web, however,

When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. 

   http://www.perl.com/CPAN/
   http://www.perl.org/CPAN/
   http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
   http://www.perl.org/CPAN/doc/manual/html/pod/

> Figuring that the problem had to do with permissions, I tried turning on
> the set-uid bit, for the file which contains the program. 

This is not the recommended method. It's akin to dealing with the dog who
bites the postman by giving the dog permission to bite everyone else as
well. :-)

Fortunately, in many cases, Perl will prevent set-id from causing any
damage in a program which isn't written securely. If you truly need set-id
(which you probably don't) check the perlsec(1) manpage. Good luck! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1244
**************************************

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