[6318] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 942 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 13 14:27:14 1997

Date: Thu, 13 Feb 97 11:05:09 -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           Thu, 13 Feb 1997     Volume: 7 Number: 942

Today's topics:
     Perl object dealing with MIME-messages? <Moosauer@steinecker.com>
     Re: Perl object dealing with MIME-messages? (Nathan V. Patwardhan)
     Perl training <hc76@dial.pipex.com>
     Problem with Curses and 5.003 (Susan Starr)
     Randal trashed yet again--*sigh* (Clinton Pierce)
     script for notifying sys adm that disc is full <ss51@columbia.edu>
     Re: search engines like infoseek <nmljn@wombat.staff.ichange.com>
     Socket descriptor problem (Lane Davis)
     Solaris "Protocol not supported" error. <93272008@brookes.ac.uk>
     Re: Stumped on INPUT_RECORD_SEPARATER problem - please  <nmljn@wombat.staff.ichange.com>
     Re: Subscribe (Chris Schleicher)
     Upgrade from 2.4 to 2.5 <clarence.hart@mci.com>
     Upgrade from 2.4 to 2.5 <clarence.hart@mci.com>
     Re: Uploading cgi script (with perl?) (Raul Almquist)
     Re: Using dbmopen and dbmclose in a cgi script <nmljn@wombat.staff.ichange.com>
     Way to send stdout to an X-Windows app <rdarnese@nortel.ca>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Thu, 13 Feb 1997 18:24:44 +0100
From: Reinhard Moosauer <Moosauer@steinecker.com>
Subject: Perl object dealing with MIME-messages?
Message-Id: <3303404C.7332@steinecker.com>

Hello,

Does anybody know about a free Perl module, which can be used to
pack/unpack MIME-messages?

tnx 4 any little help from


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

Date: 13 Feb 1997 17:28:02 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl object dealing with MIME-messages?
Message-Id: <5dviv2$5c5@fridge-nf0.shore.net>

Reinhard Moosauer (Moosauer@steinecker.com) wrote:

: Does anybody know about a free Perl module, which can be used to
: pack/unpack MIME-messages?

Ahh, you're looking for the MIME modules, available at a CPAN near you!
http://www.perl.com/perl/CPAN/

--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"


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

Date: 13 Feb 1997 17:11:23 GMT
From: PECC <hc76@dial.pipex.com>
Subject: Perl training
Message-Id: <5dvhvr$fub@join.news.pipex.net>

Does anyone know of a good training course in the UK for Perl, 

Thanks

Phil Davies
PECC



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

Date: 13 Feb 1997 16:26:06 GMT
From: sstarr@skypoint.com (Susan Starr)
Subject: Problem with Curses and 5.003
Message-Id: <5dvfau$40i$1@shadow.skypoint.net>

I would like to upgrade from perl 5.002 to perl 5.003.  I compiled
5.003 but I can't get my programs that use curses to work with 5.003.
I get the following message:
 
Can't load 
'/usr/local/lib/perl5/site_perl/sun4-solaris/auto/Curses/Curses.so'
for module Curses: ld.so.1: /home/sstarr/Src/tmp/perl5.003/perl: fatal:
relocation error: symbol not found: na: referenced in
/usr/local/lib/perl5/site_perl/sun4-solaris/auto/Curses/Curses.so at
/usr/local/lib/perl5/DynaLoader.pm line 140.
 
 at /usr/local/lib/perl5/site_perl/Curses.pm line 8
BEGIN failed--compilation aborted at ./blackbook line 12.
 
Line 12 in blackbook, my program, reads: use Curses;
Line 8 in Curses.pm reads:  bootstrap Curses;
 
I am running perl on an UltraSparc running Solaris 2.5.
Does anyone know what the problem is?
 
Thanks,
 
Sue

--
Intelligence has nothing to do with politics.
                        Londo Molari



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

Date: 13 Feb 1997 16:59:08 GMT
From: cpierce1@cp501.fsic.ford.com (Clinton Pierce)
Subject: Randal trashed yet again--*sigh*
Message-Id: <5dvh8s$si78@eccws1.dearborn.ford.com>

*sigh* The suits have trashed him yet again.  Catch the Feb 3 issue
of Fortune Magazine.  For God's sake don't buy it!  Just catch it
online at:

 http://pathfinder.com/@@yMtBXQUApoF4m2Oe/fortune/1997/970203/eml.html

No sense in giving them more money for this sort of nonsense.

Anyways, I've written my letter to the editor...maybe you should too.
You're next, Mr. Administrator.

-- 
-----------------------------------------------------------------o------
   Clinton A. Pierce     |   "If you rush a Miracle Man    |  \ / \ /
   cpierce1@ford.com     |     you get rotten miracles."   |   \ G /
DCI, Inc. on loan to Ford|--Miracle Max, The Princess Bride|  / \ / \
-------------------------------------------------------------Freemason--
Geek Code: GCM/GCSd-(++)s+:+a-C++UA++++$UIS+++$UL+++P++++L++E---W++N++w
      ---Ot++(+++)5+X+R-tv-b+++DI++++G++e+>++h----r+++y+++(--)>y*
                       http://www.dcicorp.com/~clintp



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

Date: Thu, 13 Feb 1997 11:16:02 -0500
From: SRI <ss51@columbia.edu>
Subject: script for notifying sys adm that disc is full
Message-Id: <33033E42.31DF@columbia.edu>

I am looking for a script that will monitor disc activity (on IRIX and
HP-UX sustems) and notify(e-mail) the largest few users (above a certain
cut-off on disk usage) as well as the system administrator that the disc
is close to full (say 95%). If this has been already done I don't want
to re-invent the wheel.

thanks
SS


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

Date: 13 Feb 1997 11:36:31 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
Subject: Re: search engines like infoseek
Message-Id: <w107mkcy86o.fsf@wombat.staff.ichange.com>

przec@westminster.ac.uk (David Waters) writes:
> What I am doing is writing a search engine for a client that brings
> back data from their catalog.

Were you thinking of doing this in perl?  Because otherwise, a more
general newsgroup might be able to help you out with the algorithms
involving depth-of-traversal and all that, which according to its
charter news:comp.lang.perl.misc probably won't be able to do.  At
least officially.  :-)

Cheers,
Laird

--
<laird.nelson@netsinc.com> perl FAQ: http://www.perl.com/perl/faq Perl manual:
http://www.perl.com/CPAN/doc/manual/html/frames.html. If CGI/web appears in
your comp.lang.perl.* post, see news:comp.infosystems.www.authoring.cgi. CGI
stands for Common Gateway *Interface*, not Language or Program or Script.
Consolidated perl reference page: http://www.amherst.edu/~ljnelson/perl.html


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

Date: 13 Feb 1997 17:45:53 GMT
From: root@grok.genuity.net (Lane Davis)
Subject: Socket descriptor problem
Message-Id: <5dvk0h$ok9$1@news.genuity.net>


-- Forwarded post --
I'm trying to write a TCP streams server with PERL 5.003 under Solaris
2.5.1, and am having problems opening more than 255 sockets per process.
The problem *isn't* that I don't have enough file descriptors available,
but evidently a bug in Solaris (described below).  I've tested the fact
that I can have as many as 1024 open files, but I can't open that many
TCP stream sockets.  I found a usenet post which describes the Solaris
bug that may be causing the problem, and the post described this
workaround for programs written in C: 

:The trick to getting round this problem is something like:
:
:        create_socket()
:        { int sd, new_sd;
:                sd = socket(...);
:
:                /* Move socket out of harms way */
:                new_sd = fcntl(sd, F_DUPFD, 257);
:                close(sd);
:                return sd;
:        }

Now, I'm trying to do this exact same thing in PERL, and I'm running
into all kinds of problems with filehandles and file descriptors.
Does anyone know a way to write the above code in a way that will
work with PERL?

Thanks.


Jason Brittain
GENUITY Research & Development
Spicoli@Genuity.Net
http://www.LabRat.com

G E N U I T Y  Inc.
a Bechtel Company


------BELOW IS THE ORIGINAL USENET POST ABOUT THE SOLARIS FD BUG-----------

Re: Reseting File Descriptors on Solaris 2.5 / Sparc10 / Apache

>From           Paul David Fox <pfox@lehman.com>
Organization   Lehman Brothers, Inc.
Date           Fri, 20 Dec 1996 07:52:39 +0000
Newsgroups     alt.solaris.x86,alt.sys.sun,comp.sys.sun.admin,
               comp.unix.admin,comp.unix.solaris
Message-ID     <32BA45C7.167EB0E7@lehman.com>
References     1



Christopher Durfy wrote:
: 
: Hello,
: 
: Im trying to find out how to increase my file descriptors on my
: Sparc10 running solaris 2.5. My Stronghold server keeps getting
: knocked offline because of these errors:
: 
: [Thu Dec 19 09:11:16 1996] Unable to make socket: Too many open files
: [Thu Dec 19 09:11:21 1996] access to
: /home/owan/htsdocs/patients/owan.cgi failed
:  for 207.146.85.108, reason: couldn't spawn child process
: 
: Can anyone give me a point in the right direction?
: 
: Thanks! Chris

There is a serious bug in SunOS 4.x and Solaris 2.x which can
cause programs to behave very erratically if the number of open
files exceeds X (where X >= 128 under SunOS 4.x, and X >= 256  under
Solaris 2.x).

The reason is that in <stdio.h>, the file descriptor is stored
in a (char) (SunOS 4.x)  or (unsigned char) (Sol 2.x). This buggers
up any program which attempts to do something like:

        sd1 = socket(..);
        sd2 = socket(..);
        ...
        sd300 = socket(...);

        FILE *fp = fopen("...", "..");

or any other libc call which as a side effect calls fopen (some of the 
getXbyY functions come to mind).

The trick to getting round this problem is something like:

        create_socket()
        { int sd, new_sd;
                sd = socket(...);

                /* Move socket out of harms way */
                new_sd = fcntl(sd, F_DUPFD, 257);
                close(sd);
                return sd;
        }

The above will only work, of course, if you have increased the fildes
limit of course.

This is a glaring deficiency in SunOS/Solaris but due to historic
binary compatibilty we have to live with it.

It would be so nice if in LP64/Solaris 2.6 they changed that stupid
256 limit to 32 bits. The oldest piece of Unix is making us work
hard for a living.

_______________________________________________________
| Paul David Fox          Lehman Brothers.             |
| ######################  E-mail: pfox@lehman.com      | 
| # This space for rent#  Home: fox@crisp.demon.co.uk  | 
| ######################  Tel: +44 171 601 0011 x6397  | 
** I do not speak for Lehmans. Everything I say is my own stupid fault.


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

Date: Thu, 13 Feb 1997 16:51:32 +0000
From: "Andrew J. Stewart" <93272008@brookes.ac.uk>
Subject: Solaris "Protocol not supported" error.
Message-Id: <33034694.1700@brookes.ac.uk>

Hi,

Section 4.21 of the FAQ mentions a problem with sockets under Solaris.

I've taken the advice in the FAQ, and yet I'm _still_ getting the same
error message:

Protocol not supported at ./foo.pl line 7.

I'm baffled. Is my installation of Perl incomplete? Could my env be
setup wrong? Any advice appreciated!

My script is as follows:

#!/usr/bin/perl -w

use Socket;

require './lchat.pl';

&chat'open_port("127.0.0.1", 21) or die "$!";

&chat'close();

My OS is SunOS 5.5.1, with Perl 5.003_07.

Andrew J. Stewart
93272008@brookes.ac.uk


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

Date: 13 Feb 1997 11:25:14 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
Subject: Re: Stumped on INPUT_RECORD_SEPARATER problem - please help
Message-Id: <w10afp8y8ph.fsf@wombat.staff.ichange.com>

Mark Hickey <cc42735@hrp6.FMR.com> writes:
> I want to use the $/ variable to handle seperating the records as I read
> the file.  I found that if I set the $/ to "", I have the problem that
> if a line seperating two records has any whitespace in it, then the
> records are concatenated.  I tried using various other patterns as the
> $/, like "\n[ \t\f\r]*\n", with and w/o various amounts of quoting, but
> as soon as I put the "[]" in, things fall apart.

That's because $/ can be set to *characters* but not *patterns*.  Your
description of your requirements seems like it would read:

I have a series of records.
Each record is separated from the next one by some blank lines.
Some of those blank lines may have extra characters in them like tabs
    or spaces.
I want to treat those "blank-looking" lines as though they were truly
    blank.

The record separator alone will not solve this problem, since it will
match only characters, or the three oddball cases of setting it to
null, undefining it, or setting it to two newlines.

There are a zillion ways to do what you want.  One of them, the least
programmer-intensive, is to write your data file out to a temp file,
substituting all occurrences of, say, /^\s*$/ with nothing, and then
roll through the temp file with your record separator set to whatever
you like.

Personally I'd just ignore the record separator and write a parser so
that you can combine those two steps into one.

If by some chance you're writing a Windows .ini file-type parser, you
might look at IniConf, which already does that.  Available at a CPAN
near you (http://www.perl.com/CPAN/modules/by-module/).

Cheers,
Laird

--
<laird.nelson@netsinc.com> perl FAQ: http://www.perl.com/perl/faq Perl manual:
http://www.perl.com/CPAN/doc/manual/html/frames.html. If CGI/web appears in
your comp.lang.perl.* post, see news:comp.infosystems.www.authoring.cgi. CGI
stands for Common Gateway *Interface*, not Language or Program or Script.
Consolidated perl reference page: http://www.amherst.edu/~ljnelson/perl.html


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

Date: 13 Feb 1997 10:36:43 -0800
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: Subscribe
Message-Id: <5dvmvr$15s@psychotix.cs.uoregon.edu>

In article <3301EBDC.27D8@morgile.com>,
Ofer Avnery  <morgile@morgile.com> wrote:
>Is there a mailing list available for perl subjects?

No, there are several.  :-)  See

    http://www.perl.com/perl/info/mailing-lists.html


Hope this helps,

--Chris
-- 
     Chris Schleicher                      Office:  541/346-3998
     Univ of Oregon CIS GTF                email: chrissch@cs.uoregon.edu
                URL: http://www.cs.uoregon.edu/~chrissch/


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

Date: Thu, 13 Feb 1997 11:49:10 -0500
From: "Clarence L. Hart Jr." <clarence.hart@mci.com>
Subject: Upgrade from 2.4 to 2.5
Message-Id: <33034606.938@mci.com>

Please Reply to clarence.hart@mci.com

----

Has anyone perfomed the SUN Solaris 2.4 to 2.5 upgrade. I was told not
to use the upgrade feature in the previous verion(ie 2.3 to 2.4).


Do the upgrade perform ok? Is there anything I should look out for or
install or uninstall 1st?


Clarence Hart
Thanks


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

Date: Thu, 13 Feb 1997 11:49:52 -0500
From: "Clarence L. Hart Jr." <clarence.hart@mci.com>
Subject: Upgrade from 2.4 to 2.5
Message-Id: <33034630.7536@mci.com>

Please Reply to clarence.hart@mci.com

----

Has anyone perfomed the SUN Solaris 2.4 to 2.5 upgrade. I was told not
to use the upgrade feature in the previous verion(ie 2.3 to 2.4).


Do the upgrade perform ok? Is there anything I should look out for or
install or uninstall 1st?


Clarence Hart
Thanks


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

Date: 13 Feb 1997 18:27:41 GMT
From: strider@shadowmac.org (Raul Almquist)
Subject: Re: Uploading cgi script (with perl?)
Message-Id: <5dvmet$1ck$2@blackice.winternet.com>

dimakop@cti.gr wrote:
: 	We are trying to set a service on our Web service where any
: user can access a form through which he/she can upload a file to the
: server. Although we have been able to write the html script to
: implement the form and initiate the uploading we have problems with
: the cgi script which runs on the server and receives the files.
: 
: 	So my question is if there is anywhere any script that could
: do this job? Or if there is any function in the Perl libraries that
: could do or, at least help us in this direction?

  You will need to use a perl module like CGI_Lite.pm and a basic script 
that you can find inside the module as a working example.


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

Date: 13 Feb 1997 11:34:38 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
Subject: Re: Using dbmopen and dbmclose in a cgi script
Message-Id: <w10914sy89t.fsf@wombat.staff.ichange.com>

tacs@visinet.ca (Tamas Acs) writes:
> I am trying to read data into a dbm file from a form.  The script works
> fine when i substitute the form values for initialized variables.
> Here is what I have so far.
> #!/usr/local/bin/perl -w

Good.  You are using the -w switch.

> use DB_File;
> use strict;

Good.  You are using strict.

> my (%database,@datafields,@datavalues);
> my ($key,$fname,$lname);
> require(*formdata);

What is this statement?  It's possible this represents some obscure
way of dealing with symbol tables and all that, and that I therefore
don't know about it, but I think maybe this represents your way of
trying to get form data in from the environment variables set in
accordance with the Common Gateway Interface.

Instead of doing that--unless you know what you are doing and *I'm*
the one in the dark--you should do this: (warning; untested code
follows)

# presuming you've removed the "require(*formdata)" line
use CGI;

my($cgi) = new CGI;
my(%formdata);
for($cgi->param()) {
    # For each parameter that $cgi knows about, set up a hash entry.
    # We'll make the value of that hash entry an array reference, so
    # that if there are multiple values, you can deal with them:
    $formdata{$_} = [ $cgi->param($_) ];
}

# Now you'll need to change the way you store these variables:
$key = shift(@{ $formdata{'key'} }) || 'Default Value';
$fname = shift(@{ $formdata{'firstname'} }) || 'Default Value';
$lname = shift(@{ $formdata{'lastname'} }) || 'Default Value';

> @datafields = ("KEY", "FIRSTNAME", "LASTNAME");
> @datavalues = ($key,$fname,$lname);
> 
> dbmopen(%database,"userdata",0666);
>   for ($count = 1; $count <= @datafields; $count++){
>     $database{$datafields[$count - 1].$datavalues[0]} =
>                $datavalues[$count - 1];
>   }
> dbmclose(%database);

Hope this helps,
Cheers,
Laird

--
<laird.nelson@netsinc.com> perl FAQ: http://www.perl.com/perl/faq Perl manual:
http://www.perl.com/CPAN/doc/manual/html/frames.html. If CGI/web appears in
your comp.lang.perl.* post, see news:comp.infosystems.www.authoring.cgi. CGI
stands for Common Gateway *Interface*, not Language or Program or Script.
Consolidated perl reference page: http://www.amherst.edu/~ljnelson/perl.html


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

Date: 13 Feb 1997 15:31:35 GMT
From: Richard Arnesen <rdarnese@nortel.ca>
Subject: Way to send stdout to an X-Windows app
Message-Id: <5dvc4n$dbu@nrtphc11.bnr.ca>

Basically I want a perl script (or something similiar) to be able to
send it's output into an application like say x3270.  Is there a 
way to do this (buffers or something).

Excuse me I am pretty new to this but I am desperate for an answer.

And useful info (FAQS, USENET artciles, books) would be appreciated.

TIA

-- 
Richard D. Arnesen Jr.              "Bill Clinton's Promises have the
Unix DCA Support, Nortel            lifespan of a Big Mac on AirForce
The opinions expressed are MINE     One" - Rep. Susan Molinari
no else can have them               Romans 6:23, 1Cor 4-8, John 3:16


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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 V7 Issue 942
*************************************

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