[13992] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1402 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 16 21:10:33 1999

Date: Tue, 16 Nov 1999 18:10:22 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942804622-v9-i1402@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 16 Nov 1999     Volume: 9 Number: 1402

Today's topics:
    Re: Help (back for guru): using setsid() to invoke diss <cassell@mail.cor.epa.gov>
    Re: HELP --> Save output in a variable <cassell@mail.cor.epa.gov>
    Re: How do I produce a random number? <rootbeer@redcat.com>
    Re: Maximum number of open files <cassell@mail.cor.epa.gov>
    Re: Maximum number of open files <rootbeer@redcat.com>
    Re: Multiple page form <cassell@mail.cor.epa.gov>
    Re: Multiple page form (Abigail)
    Re: my Net::FTP script (Kragen Sitaker)
    Re: Netscape messenger or other mail client accessable, <cassell@mail.cor.epa.gov>
    Re: pattern matching packages (Kragen Sitaker)
        Perl Programmers Needed. Dallas, Texas USA (experienced <jobs@sandboxstudios.com>
    Re: PERL script with JScript embedded (Kragen Sitaker)
    Re: perl/tk and dbi/rdbms (Eric Bohlman)
    Re: Please help me create a file with perl <cassell@mail.cor.epa.gov>
    Re: Please help me create a file with perl (Kragen Sitaker)
    Re: Problem with glob on NT host (Martien Verbruggen)
    Re: Problem with the sentence "use Win32::ODBC;" <cassell@mail.cor.epa.gov>
    Re: Problem with the sentence "use Win32::ODBC;" (Kragen Sitaker)
        program grows over time (5MB/day) <kenfox@starlinx.com>
        Q: calling a pearl script from netscape?? <quest@accesscable.net>
    Re: Q: calling a pearl script from netscape?? <bmetcalf@nortelnetworks.com>
    Re: Q: calling a pearl script from netscape?? (Kragen Sitaker)
    Re: qn about Getopt::Long module (Martien Verbruggen)
    Re: reading one line at a time <cassell@mail.cor.epa.gov>
    Re: Removing all combinations of spaces/tabs at end of  <cassell@mail.cor.epa.gov>
    Re: seeking seek algorithm (Thunderdust (TomH))
    Re: something like Text::Wrap::wrap() that's HTML aware (Jed Parsons)
    Re: system() fails to return error code (Kragen Sitaker)
    Re: Unexpected error in array (Kragen Sitaker)
    Re: Uptime plugin for Perl on NT <cassell@mail.cor.epa.gov>
        Use of uninitialized value <blaqflame@hotmail.com>
    Re: Use of uninitialized value (Sam Holden)
    Re: Use of uninitialized value (Kragen Sitaker)
        using $> and $< <robert.castellowNOroSPAM@s1.com.invalid>
    Re: using $> and $< (Sam Holden)
    Re: using $> and $< (Martien Verbruggen)
        Wierd List Behavior tigger149@my-deja.com
    Re: Wierd List Behavior <bmetcalf@nortelnetworks.com>
    Re: Wierd List Behavior (Kragen Sitaker)
    Re: Wierd List Behavior (Kragen Sitaker)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 16 Nov 1999 15:46:17 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Help (back for guru): using setsid() to invoke dissassociated child  -
Message-Id: <3831ECC9.D581830D@mail.cor.epa.gov>

Kragen Sitaker wrote:
> 
> In article <80s73c$pio$1@internal-news.uu.net>,
> Erik van Roode  <newsposter@cthulhu.demon.nl> wrote:
> >Tom Phoenix <rootbeer@redcat.com> wrote:
> >> Does anybody know a newsgroup for questions about bash? :-)
> >
> >This seesm to be the perfect group: gnu.bash.bug
> 
> No.  gnu.bash.bug is for bug reports.

I thought gnu.bash.bug was for insects to talk about getting
bashed.

I think comp.unix.shell is a good place to discuss bash.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 16 Nov 1999 15:40:57 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HELP --> Save output in a variable
Message-Id: <3831EB89.49D6CB35@mail.cor.epa.gov>

Chris Durbin wrote:
> 
> On 28 Oct 1999, Abigail wrote:
> 
> crap->BARBET Alain (abarb@nmg.fr) wrote on MMCCXXXIV September MCMXCIII in
[snip of bad suggestion]
> crap->You shouldn't ask questions if you haven't read the documentation,
> crap->but you certainly should not *answer* them either.

> Nice, Abagail, you managed to waste bandwidth, flame a poster and
> the one replying to the post, without even being remotely
> helpful... didn't your mama ever tell you: "if you can't say
> anything nice, shut the hell up!"

Abigail's answer seemed helpful to me.  Not telling anyone
that Alain had made a bad suggestion would have been
extremely unhelpful.  In fact, Alain's suggestion was
*dreadful*.

BTW, your post seems to have fallen into the category you're
accusing Abigail of being in.

Uh-oh, I guess my post is in the same category.
Oh well, so what else is new...
 
> to Marco:
>         You really should do more research before you go to the
> newsgroup, otherwise you'll have harpies like Abagail hounding
> you, without giving you any help...

The Erinyes are in the next newsgroup over.

[snip of good suggestions]
> oh, and... get a good book, it is your best friend

I'm currently recommending "Elements of Programming with
Perl" to those who have never programmed before, and
"Learning Perl" to those who have some CS background but 
are not experienced programmers.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 16 Nov 1999 15:53:20 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How do I produce a random number?
Message-Id: <Pine.GSO.4.10.9911161552290.15797-100000@user2.teleport.com>

On Tue, 16 Nov 1999, Igor Vulfson wrote:

> srand(time^($$ + $$<<15));

The perlfunc manpage suggests something better. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 16 Nov 1999 15:15:05 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Maximum number of open files
Message-Id: <3831E579.D01BDAA6@mail.cor.epa.gov>

Yossi Klein wrote:
> 
> I'm in shock.
> 
> I'm working on a Solaris machine, and using ulimit, I upped the maximum
> number of file descriptors to 700. I then ran a test program using open
> and found that open() will only allow me to have to 256 files open at a
> time.

Isn't this an issue with Solaris?  I seem to recall seeing 
something about this on comp.unix.solaris .  Something about
needing to change a setting in addition to ulimit.

If I'm wrong, someone better informed will correct me.  But then,
if I'm right, someone not as informed will correct me.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 16 Nov 1999 15:55:58 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Maximum number of open files
Message-Id: <Pine.GSO.4.10.9911161554340.15797-100000@user2.teleport.com>

On 16 Nov 1999, Mike Wescott wrote:

> the open and sysopen tests fail on the 253rd open.

As you probably know, you also have some other files open already.
Typically the three STD filehandles plus your Perl source file itself.

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 16 Nov 1999 15:33:43 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Multiple page form
Message-Id: <3831E9D7.7AE7D9A9@mail.cor.epa.gov>

Mark Tait wrote:
> 
> Hi - does anyone know of a script which will process a multiple page form
> (for a survey questionairre) - all the data has to be processed together -
> to enable each persons answers to be kept together - and written to a text
> file.

Since HTTP is a stateless protocol, you'll have to do something
to maintain state on your own.  So this isn't really something
to handle with just one script.  You'll want to go to the newsgroup
comp.infosystems.www.authoring.cgi and read their FAQ and learn
about the ways you can maintain state.  Like cookies, to name
one way.

> I'm using MS IIS...

Oh.  I'm sorry to hear that.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 16 Nov 1999 19:42:26 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Multiple page form
Message-Id: <slrn83426h.cvu.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCLXVIII September
MCMXCIII in <URL:news:3831E9D7.7AE7D9A9@mail.cor.epa.gov>:
<> 
<> Since HTTP is a stateless protocol, you'll have to do something
<> to maintain state on your own.

I think that should read:

Since HTTP is a stateless protocol, you'll have to use some other
protocol to maintain state.



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 17 Nov 1999 01:17:05 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: my Net::FTP script
Message-Id: <lmnY3.19937$YI2.865994@typ11.nn.bcandid.com>

In article <80smlg$h9t$1@news.tamu.edu>, Mei <hmpeng@ppserver.tamu.edu> wrote:
>Here is my new script, but it is not working.  I want to get all files that
>have dat as file extension.  I also want to get and put those files in
>different directories.  Can someone point out what is wrong?
>
>use Net::FTP;
>use strict;
>my $hostname = ‘ftp.host.org’;

You appear to be using control characters for quotes.  That's
meta-control-Q and meta-control-R.  If you used quotes (like ' or ") it
might work better.


-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 16 Nov 1999 15:06:20 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Netscape messenger or other mail client accessable, Win 32?
Message-Id: <3831E36C.1145AD62@mail.cor.epa.gov>

Tim Richardson wrote:
[snip of my blather]
> > There are a host of Perl modules to address a variety of APIs.
> > Do you know if Nyetscape mail does MAPI, for example?
> It does do MAPI. I looked on CPAN and didn't find a MAPI interface.
> Can you give me a lead? I'd like to look into this...

I believe you can find one by looking in the ActiveState
archives of the Win32-Perl-Users mailing list.

http://www.activestate.com/support/mailing_lists.htm

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 17 Nov 1999 01:51:10 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: pattern matching packages
Message-Id: <iSnY3.20129$YI2.871440@typ11.nn.bcandid.com>

In article <3830959F.1EF8724A@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>Kragen Sitaker wrote:
>Darn natural languages.  Where's a BNF for Englsih when you
>need one?  :-)

Oh, sorry :)

>Now then:
>
>[snip]
>>         - Someone asked recently on this newsgroup how to compute all
>>           the possible ways an RE like ([a-z]*)(.*) could match a
>>           particular string.
>
>I thought that what was asked was to generate all the strings
>which could match a given RE.  A very different proposition..
>and one which clearly cannot be done in a finite time period
>for the general case [like your example].

I wouldn't be surprised if someone asked that, too.  It wouldn't be too
difficult, and might be useful, to generate the shortest N strings, or
a random selection of N strings, that match a given RE.  It might help
you see if the RE really means what you think it does.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 16 Nov 1999 19:13:12 -0600
From: "Sandbox Studios HR" <jobs@sandboxstudios.com>
Subject: Perl Programmers Needed. Dallas, Texas USA (experienced only)
Message-Id: <LlnY3.82713$YB4.2573487@typ12.nn.bcandid.com>

Hello.

We're hiring full-time and part-time Perl programmers for our Dallas
offices.  Experienced programmers only.  Work on different Internet related
projects.

Send resume, URL and/or sample code to jobs@sandboxstudios.com

Regars,
Steve Bergenholtz
http://www.sandboxstudios.com







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

Date: Tue, 16 Nov 1999 23:14:34 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: PERL script with JScript embedded
Message-Id: <uzlY3.19595$YI2.848495@typ11.nn.bcandid.com>

In article <3830A723.7ABC3D8E@argolink.net>,
Mark Henderson  <markh@argolink.net> wrote:
>I am fairly new to Javascript .  I have a PERL script (written by
>someone else) that acts both as a form handler and database connection
>interface.  I need to modify this PERL script.  THE HTML form that calls
>the script is fine, and the script currently just returns the $Msg
>listed below if a field is left blank.  I want to insert a JavaScript
>alert in place of the $Msg statement below.  I tried something like
>
><SCRIPT LANGUAGE = "JAVASCRIPT">
>   alert("You left a field blank");
></SCRIPT>

What, exactly, did you try?  Something like
$Msg='<SCRIPT LANGUAGE = "JAVASCRIPT">
   alert("You left a field blank");
</SCRIPT>';
, was it?

>in place of the $Msg line below, but the server spit up on it.

If the server spit up, look in the server's error log for the error
message.


-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 16 Nov 1999 23:30:27 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: perl/tk and dbi/rdbms
Message-Id: <80spej$efa$4@nntp9.atl.mindspring.net>

jsander0@my-deja.com wrote:
: I want to create a rdbms table viewer/editor: Using Tk::Table is really
: slow and I don't need the ability to treat every cell as a separate
: widget. Also, I would like to limit and change the width of columns on
: creation and on the fly.
: Is there something more suitable to get this job done than Tk::Table?

Tk::Hlist would probably work.



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

Date: Tue, 16 Nov 1999 15:52:08 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Please help me create a file with perl
Message-Id: <3831EE28.998816C0@mail.cor.epa.gov>

Jonas Nilsson wrote:
> 
> Thanks for the help but I have tried every advise but it still don't
> work. Any more tips ?

At this point, I think you are going to have to read the FAQ.
The first question in perlfaq9 has a host of URLs to assist
you.  And you can read it using perldoc, like this:

perldoc -q error

or even

perldoc -q 500

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 17 Nov 1999 01:49:10 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Please help me create a file with perl
Message-Id: <qQnY3.20118$YI2.871096@typ11.nn.bcandid.com>

In article <3833c702.80132571@news1.tninet.se>,
Jonas Nilsson <jonas.nilsson@mbox326.swipnet.se> wrote:
>I have tried everything now but I still get Internal Server Error. It
>create the file and set the right permission but I get the error.
>More tips thanks.

Read the first question in perlfaq9.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 17 Nov 1999 01:30:13 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Problem with glob on NT host
Message-Id: <FynY3.177$dp.5661@nsw.nnrp.telstra.net>

On Tue, 16 Nov 1999 11:07:25 -0500,
	Dennis Kowalski <dennis.kowalsk@daytonoh.ncr.com> wrote:
> So the question is
> Why does the glob convert a name to all upper case if the 1st letter is a
> capital letter and none of the others are?
> 
> I am running ActiveWare build 315 on a NT 4.0 host

It's not glob converting anything. glob gets you the file list exactly
as it is on NT's file system. It's NT doing very odd things with case
of file names.

But that has nothing to do with perl. Maybe you should ask in a group
that talks about NT about how exactly NT determines what the case of a
file name should be, and on which file systems it does these things.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.   | accept as reality - Calvin
NSW, Australia                  | 


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

Date: Tue, 16 Nov 1999 15:12:07 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Problem with the sentence "use Win32::ODBC;"
Message-Id: <3831E4C7.F6D10B29@mail.cor.epa.gov>

Nancy wrote:
> 
> hi,

howdy,

[snip]
> In a first script, I ask the user to fill in a form.
> I want to compare these information with my Access Database and give an
> answer to the user in a HTML page.

Using MS Access in a website is a mistake.  It is not robust
enough, and it cannot handle the multi-user situations which
a website is supposed to handle.  If you're using DBD::ODBC
instead, you will be able to switch over to another database
fairly transparently.

> But when I launch the second Perl script, which will consult the
> database, the navigator asks me if I Want to save or Open the script on

So your browser won't accept this as a CGI script?  That's
a webserver config problem.  Look at the section on 'webserver config'
in the ActivePerl [win32] FAQ.  If that isn't enough help, you
will want to take your question to a newsgroup that deals with 
your particular server.

> When I execute this script in a dos window, I have no error messages,
> and I made the test (with success) for the ODBC connections. The "use
> Win32::ODBC;" is just at the beginning of the script and I have no
> problem to execute other scripts in the navigator.

Yep, it's a webserver config problem.  Whenever your code runs
fine from the command line but chokes on your server, there's
something rotten in the state of Denmark.  Or Redmond.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 17 Nov 1999 01:26:13 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Problem with the sentence "use Win32::ODBC;"
Message-Id: <VunY3.19991$YI2.867418@typ11.nn.bcandid.com>

In article <3831E4C7.F6D10B29@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>Nancy wrote:
>[snip]
>> In a first script, I ask the user to fill in a form.
>> I want to compare these information with my Access Database and give an
>> answer to the user in a HTML page.
>
>Using MS Access in a website is a mistake.  It is not robust
>enough, and it cannot handle the multi-user situations which
>a website is supposed to handle.

I think there are probably cases where you have only one person
accessing a database through a website and Access might be OK.  And,
hey, I use the Unix filesystem in CGI scripts all the time, and it
doesn't even have the level of multi-user functionality that Access
does. :)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 16 Nov 1999 17:16:35 -0500
From: ken fox <kenfox@starlinx.com>
Subject: program grows over time (5MB/day)
Message-Id: <3831D7C2.D7220429@starlinx.com>

HI folks --

    I have searched just about everywhere, given spinal damage to all
the Oreilly Perl books, Wasted hours looking /searching on CPAN
/perl.org/|com etc, and I cannot find the answer to this question .I
have single stepped through the debugger, done a line by line code
review of the entire system.

how can I iterate through all of the variables in my program and
determine how much memory is being used by each one?

Here' the problem: I have a program that is running as a deamon on a
solaris box. If I watch the memory consumed by the program using top ( a
process monitoring tool for you non unix folks)  it starts out at 7meg
of memory give or take. 24 hours later, its using 11 meg. After a
weekend, it's consuming 24 or more meg. Obviously I have done something
goofy.  I looked at the Debug modules, and the Leak module, but becaus
the program is running in it's own infinite loop, Leak would cause the
program to terminate thus proving that Heisenberg was correct.

I think there's bound to be a way to surf through the internals of Perl
as it's running to look at all the typeglobs, check out how much memory
is allocated to each thing, recheck it through each iteration of the
loop, and finally print it out to a file somewhere. After a weekend, I
should have either a full disk or an idea of what on earth is growing.

Does anyone have an idea of what I can do to with this? This is so
frustrating that I'm thinking of writing a debugger of sorts just to
hammer this problem<G> ...

TIA - KEN



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

Date: Tue, 16 Nov 1999 23:04:48 +0000
From: Gary Langthorne <quest@accesscable.net>
Subject: Q: calling a pearl script from netscape??
Message-Id: <3831E310.E0F00F0F@accesscable.net>


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

  I want to configure my "apps" mime type config in netscape to execute
a

peral script upon clicking a html button. Now when I click it ,

it prompts to save the script file. Whats the pearl executable I should
have it point to?

I'm running redhat 6.0 and netscape 4.61.

  Thanks in advance.....

--

--

-------------------------------
 Quest Jewellery Manufacturing     Quality Handcrafted Sterling Earrings
     quest@accesscable.net               Online Wholesale Catalog
   www.accesscable.net/~quest
-------------------------------

  Commercial and/or unsolicited email and/or spam will be processed at
   a $500 handling fee. Unsolicited sending constitutes acceptance.



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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp; I want to configure my "apps" mime type config in netscape to execute
a
<p>peral script upon clicking a html button. Now when I click it ,
<p>it prompts to save the script file. Whats the pearl executable I should
have it point to?
<p>I'm running redhat 6.0 and netscape 4.61.
<p>&nbsp; Thanks in advance.....
<p>--
<pre>--&nbsp;

-------------------------------
&nbsp;Quest Jewellery Manufacturing&nbsp;&nbsp;&nbsp;&nbsp; Quality Handcrafted Sterling Earrings
&nbsp;&nbsp;&nbsp;&nbsp; quest@accesscable.net&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Online Wholesale Catalog
&nbsp;&nbsp; www.accesscable.net/~quest
-------------------------------
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp; Commercial and/or unsolicited email and/or spam will be processed at
&nbsp;&nbsp; a $500 handling fee. Unsolicited sending constitutes acceptance.</pre>
&nbsp;</html>

--------------99A5EADFFCFAA37B3D7AD2AC--



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

Date: Tue, 16 Nov 1999 15:25:13 -0800
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: Re: Q: calling a pearl script from netscape??
Message-Id: <3831E7D9.63F6993E@nortelnetworks.com>

Gary Langthorne wrote:

>   I want to configure my "apps" mime type config in netscape to
> execute a
>
> peral script upon clicking a html button. Now when I click it ,
>
> it prompts to save the script file. Whats the pearl executable I
> should have it point to?
>
> I'm running redhat 6.0 and netscape 4.61.

You go to some newsgroup that knows about pearl.  Perhaps
rec.fishing.oysters

Brandon



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

Date: Wed, 17 Nov 1999 01:19:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Q: calling a pearl script from netscape??
Message-Id: <VonY3.19954$YI2.866457@typ11.nn.bcandid.com>

In article <3831E310.E0F00F0F@accesscable.net>,
Gary Langthorne  <quest@accesscable.net> wrote:
>-=-=-=-=-=-
>
>  I want to configure my "apps" mime type config in netscape to execute
>a peral script upon clicking a html button. Now when I click it ,
>it prompts to save the script file. Whats the pearl executable I should
>have it point to?

This means you have not configured it properly.  But you shouldn't do
that.  It means that any web page you visit can send you a Perl script
and have you run it automatically.  This is a major security hole.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 17 Nov 1999 01:26:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: qn about Getopt::Long module
Message-Id: <rvnY3.173$dp.5661@nsw.nnrp.telstra.net>

On 16 Nov 1999 16:57:31 -0500,
	Steve Linberg <linberg@literacy.upenn.edu> wrote:
> geetago@my-deja.com writes:
> 
> > I am using Getopt::Long module for argument
> > parsing. How can i force my program to exit if
> > the it is invoked with an "unknown options"
> 
> According to 'perldoc Getopt::Long', it will die if called with invalid
> options, unless of course you call it in an eval block, where you can check
> for errors in the usual fashion.  But it's all in the documentation.

I can't really find that die bit in the documentation, and my
experience with it is different. Let's test it:

$ cat tt.pl
#!/usr/bin/perl -w
use Getopt::Long;
$val = 1;
GetOptions("size=i" => \$val);
print "Am I dead? val = $val\n";
$ ./tt.pl
Value "aa" invalid for option size (number expected)
Unknown option: foo
Am I dead? val = 1
$

It doesn't actually die. But you can check for the return value of
GetOptions, and die yourself. You can also do a few other interesting
things to the configuration. But indeed, it's all in the
documentation.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd.   | selective about its friends.
NSW, Australia                  | 


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

Date: Tue, 16 Nov 1999 16:09:30 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: reading one line at a time
Message-Id: <3831F23A.64D37F9D@mail.cor.epa.gov>

n.thiyagarajan wrote:
> 
> hi everyone,

howdy,

> i want to open a file and read in on line at a time using perl.
> any suggestions?

Yes.  This is one of the most elementary acts in Perl.  If
you are at the stage where you need to ask this, then you
will benefit most from going to this tutorial:

http://www.netcat.co.uk/rob/perl/win32perltut.html

and buying this book:

"Elements of Programming with Perl" by Andrew Johnson.

Then you'll understand when I say that the answer is just:

<>

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 16 Nov 1999 15:49:41 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Removing all combinations of spaces/tabs at end of string
Message-Id: <3831ED95.C03C4461@mail.cor.epa.gov>

David H. Adler wrote:
> 
> On Mon, 15 Nov 1999 15:46:32 -0800, David Cassell
> <cassell@mail.cor.epa.gov> wrote:
> 
> >[1] make sure you have your own personal copy of the docs which
> >come with Perl [including the FAQ] - if it isn't on your hard
> >drive already, grab a copy from CPAN [www.cpan.org]
> 
> Personally, if the docs aren't with your copy of perl, I'd reinstall.
> Many (if not most) consider a perl install w/o documentation to be
> quite broken.

I certainly feel that way.

But many posters to this ng use a copy of Perl which sits
on their ISP's machine rather than their own.  While they
*ought* to get their own copy of Perl, they certainly
can get a copy of the FAQ, and there is no excuse not
to since it is available even without installing Perl first.

BTW, is it true that certain intro Perl books, like one
for dummies, come with a CD of [pieces of] Perl which 
is lacking the docs?

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Mon, 15 Nov 1999 16:34:38 GMT
From: beans@bedford.net (Thunderdust (TomH))
Subject: Re: seeking seek algorithm
Message-Id: <383034e6.13067947@news.bedford.net>

This is what I would do. If there's a smarter way, flame me and direct
me to the docs.

First, take out all the number storing/crunching and see how long it
takes to just read the 20gig and do nothing.

Then start adding parts one at a time to see what adds time. Consider
a better algorithm when you find the slow part, rather than trying to
find a faster way to do something inherently slow. Good luck.

On Tue, 16 Nov 1999 05:18:41 GMT, paul_p_francis@my-deja.com wrote:

>hello,
>
>i have a large (over 20 Gig) binary file with fixed length records. i
>have to aggregate 2 fields and calculate frequency distribution on
>another field. the problem is it takes over 65 minutes for my perl
>script to complete on a unix server running perl 5.005.
 ...





Schnoodlewinks-constantly leveling up warrior
Fluffy_the_Fly-lvl.7 warrior (x2-don't ask!)
Flame-QFG5 Paladin


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

Date: 17 Nov 1999 01:24:27 GMT
From: jed@socrates.berkeley.edu (Jed Parsons)
Subject: Re: something like Text::Wrap::wrap() that's HTML aware?
Message-Id: <80t04b$qq8$1@agate.berkeley.edu>

>That's a very UnWebLike thing to do. But okay....

I know.  It's a compromise between formatting (giving all readers of the
page the same line breaks and same line numbers for the quoted portions of
text) and form (not simply making everything monospaced text).  I know
this maybe isn't the ``right way'' to treat web content, but it (or
something like it) needs to be done in this case.  (The output is for
students; we need a consistent reference text.)

>Would you break an <A href=....> the same way? That would not be the Right
>Thing to do. 

I think I would, actually.  pdflatex does this to handle urls that wrap
around the line end.  I think it would make sense here.  (Although, I
don't think the texts in question (which are predominantly in Latin or
about Latin) will have many anchors in them :-)

>But I still think you'll want to use HTML::Parser to do this. Good luck
>with it!

Thanks.  I think you're right about HTML::Parser.  I'll keep playing
around.

Thanks for replying,

Jed
-- 
Jed Parsons               mailto:jed@socrates.berkeley.edu
                        http://socrates.berkeley.edu/~jed/
----------------------------------------------------------
grep(do{for(ord){(!$_&&print"$s\n")||(($O+=(($_-1)%6+1)and


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

Date: Tue, 16 Nov 1999 23:16:37 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: system() fails to return error code
Message-Id: <pBlY3.19598$YI2.848902@typ11.nn.bcandid.com>

In article <Pine.GSO.4.10.9911151647190.15797-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@redcat.com> wrote:
>On Wed, 10 Nov 1999, Jeffrey Croft wrote:
>> $rc = system("/bin/tar cf foo.tar *")
>> 
>> When tar fails, the value of $rc is zero. However, I can go to the shell
>
>Which shell? system() is using /bin/sh. But if tar is failing, you should
>see a non-zero value in $rc, unless there's a bug in your /bin/sh or in
>perl.

Or in tar, which seems more likely.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 17 Nov 1999 01:15:22 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Unexpected error in array
Message-Id: <KknY3.19929$YI2.865361@typ11.nn.bcandid.com>

In article <Pine.GSO.4.10.9911151811370.15797-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@redcat.com> wrote:
>On Mon, 15 Nov 1999, Martin Foster wrote:
>> I was rather thrilled when I discovered that someone had taken the time
>> to write a module for Perl that would allow interaction with GPG.
>
>You seem to mean 'PGP'.

GNU Privacy Guard is a compatible free-software replacement for PGP.
It's reportedly usable.

So maybe he really does mean GPG.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 16 Nov 1999 15:58:27 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Uptime plugin for Perl on NT
Message-Id: <3831EFA3.E3F63B73@mail.cor.epa.gov>

patelni101480@my-deja.com wrote:
> 
> I'm trying to ping a machine, then shut it down.  Then I am trying to
> find the uptime of the machine that I just shutdown, and if it has been
> up for more than 5 minutes, I try to shutdown another machine.  It may

Don't you need to get the uptime before you shutdown the machine?
And your sub here:

> sub time2days {
>         print "converting $_[0]\n" if $debug;
>         my $days = (time() - $_[0])/(24*60*60);
>         my $hours = ($days - int($days)) * 24;
>         my $minutes = ($hours - int($hours)) * 60;

This has the misfeature of converting to days/hrs/mins when
your routine needs minutes to be something else.  If your
machine was up for 1441 minutes [1 day, 0 hours, 1 minute],
what happens?  $minute gets set to 1 instead of a value
greater than 5.  This seems like it would toast the logic
of the rest of your program.

And the rest of your program looks more convoluted than
necessary as well.  I'm not sure if you really want all
that.  You may want to read about redo and next and last. 

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 17 Nov 1999 00:45:25 GMT
From: Rowan Blaqflame <blaqflame@hotmail.com>
Subject: Use of uninitialized value
Message-Id: <80str5$ssk$1@nnrp1.deja.com>

HELP!
I am trying to receive data from one perl script and read it into
another which will update a mysql database.  These are what my script is
using...

use strict;
use CGI qw(:standard);
use CGI::Carp;
use DBI;
CGI::use_named_parameters(1);

and I'm executing perl #!/usr/bin/perl -w so it gives me messages.

I'm trying to take the incoming values and setup a SQL statement so for
each incoming name=value pair I do this...

my $complaint = param('complaint');
if ( length($complaint) > 0 ) { $complaint = "complaint='" . $complaint
 . "'";
    } else { $complaint = "complaint=NULL"; }

The only problem is if the parameter 'complaint' was empty.  If it was
empty then the length($complaint) returns "Use of uninitialized value
at..." because it doesn't have a value even though I'm obviously doing
a my $val to initialize it.
Can anyone tell me a better way to deal with null variables?  I can
ignore the errors, but I hate leaving something alone that I don't
understand.
--
He Breaths, Eats, and Takes up Space
http://www.blaqflame.com


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


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

Date: 17 Nov 1999 01:13:08 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Use of uninitialized value
Message-Id: <slrn83409i.1ja.sholden@pgrad.cs.usyd.edu.au>

On Wed, 17 Nov 1999 00:45:25 GMT,
	Rowan Blaqflame <blaqflame@hotmail.com> wrote:
>HELP!
>I am trying to receive data from one perl script and read it into
>another which will update a mysql database.  These are what my script is
>using...
>
>use strict;
>use CGI qw(:standard);
>use CGI::Carp;
>use DBI;
>CGI::use_named_parameters(1);
>
>and I'm executing perl #!/usr/bin/perl -w so it gives me messages.
>
>I'm trying to take the incoming values and setup a SQL statement so for
>each incoming name=value pair I do this...
>
>my $complaint = param('complaint');
>if ( length($complaint) > 0 ) { $complaint = "complaint='" . $complaint
>. "'";
>    } else { $complaint = "complaint=NULL"; }
>
>The only problem is if the parameter 'complaint' was empty.  If it was
>empty then the length($complaint) returns "Use of uninitialized value
>at..." because it doesn't have a value even though I'm obviously doing
>a my $val to initialize it.

Yeah, it's an annonying error message...

It really means use of an undefined variable.

>Can anyone tell me a better way to deal with null variables?  I can
>ignore the errors, but I hate leaving something alone that I don't
>understand.

You can use the defined function (documented in 'perldoc -f defined') to
check if the variable is defined before calling length.

You could also so something like:

$complaint = "" unless defined $complaint;

before you do the test.

-- 
Sam

the Emacs editor is horrible
	--Linus Torvalds


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

Date: Wed, 17 Nov 1999 01:43:49 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Use of uninitialized value
Message-Id: <pLnY3.20092$YI2.870178@typ11.nn.bcandid.com>

In article <80str5$ssk$1@nnrp1.deja.com>,
Rowan Blaqflame  <blaqflame@hotmail.com> wrote:
>and I'm executing perl #!/usr/bin/perl -w so it gives me messages.

Bravo.

>my $complaint = param('complaint');
>if ( length($complaint) > 0 ) { $complaint = "complaint='" . $complaint
>. "'";
>    } else { $complaint = "complaint=NULL"; }

I think you mean "complaint IS NULL", not "complaint=NULL".  Null by
definition can't be equal to anything, even null.

If there is no 'complaint' param, $complaint will get the undefined
value in the above code, which gives you the uninitialized-value
message.

By the way, in SQL, the empty string '' and the undefined value NULL
are distinct.  So too in Perl, the empty string and the undefined value
are distinct.  Depending on your data, you might want to allow people
to query for either a NULL complaint or an empty-string complaint.

Oh, and you should probably substitute ' with '' in $complaint before
you put it in SQL; it would be an awful shame if $complaint were "';
DROP TABLE COMPLAINTS; SELECT FOO FROM GARBAGE WHERE complaint='bar",
now wouldn't it?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 16 Nov 1999 15:17:06 -0800
From: natureboy <robert.castellowNOroSPAM@s1.com.invalid>
Subject: using $> and $<
Message-Id: <12cd2f24.f95ebe5b@usw-ex0110-073.remarq.com>

i logon to a remote unix machine using my normal login name.
next i 'su root' then i execute a perl script that prints $>
and $<, in order to get the real user id and effective user
id.

i expect the real id to be my normal uid and my effective
uid to be 0 (root). instead both are 0. any ideas???


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: 16 Nov 1999 23:54:22 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: using $> and $<
Message-Id: <slrn833rlv.ob.sholden@pgrad.cs.usyd.edu.au>

On Tue, 16 Nov 1999 15:17:06 -0800,
	natureboy <robert.castellowro@s1.com> wrote:
>i logon to a remote unix machine using my normal login name.
>next i 'su root' then i execute a perl script that prints $>
>and $<, in order to get the real user id and effective user
>id.
>
>i expect the real id to be my normal uid and my effective
>uid to be 0 (root). instead both are 0. any ideas???

You could try reading the f*ing manual...

What do you expect su to do?

What does the manual say su will do?

This is not a perl question... as typing 'id' would have told you.

-- 
Sam

There's no such thing as a simple cache bug.
	--Rob Pike


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

Date: Wed, 17 Nov 1999 01:43:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: using $> and $<
Message-Id: <5LnY3.193$dp.5246@nsw.nnrp.telstra.net>

On Tue, 16 Nov 1999 15:17:06 -0800,
	natureboy <robert.castellowNOroSPAM@s1.com.invalid> wrote:
> i logon to a remote unix machine using my normal login name.
> next i 'su root' then i execute a perl script that prints $>
> and $<, in order to get the real user id and effective user
> id.
> 
> i expect the real id to be my normal uid and my effective
> uid to be 0 (root). instead both are 0. any ideas???

This has nothing to do with perl. This is a unix matter. I suggest you
ask this in a group that discusses unix. Apparently you have the wrong
idea about what su does.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.   | you come to the end; then stop.
NSW, Australia                  | 


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

Date: Wed, 17 Nov 1999 00:26:33 GMT
From: tigger149@my-deja.com
To: tigger@lagwagon.net
Subject: Wierd List Behavior
Message-Id: <80ssnm$s3p$1@nnrp1.deja.com>

Ok I found some wierd behavior. I am wondering if this is a perl bug or
if it is documented somewhere?

Here is some example code:

($a,$b,$) = ('First',,'Third');

print "A: $a  B: $b  C: $c";

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

The output of the code would look like:

A: First  B: Third  C:



Why does this happen this way. It is particularly disturbing because if
you did something like

&foo(1,,,4); Your function arguments all get scooted down.


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


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

Date: Tue, 16 Nov 1999 16:50:07 -0800
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: Re: Wierd List Behavior
Message-Id: <3831FBBF.673CB2F1@nortelnetworks.com>

> Ok I found some wierd behavior. I am wondering if this is a perl bug or
> if it is documented somewhere?
>
> Here is some example code:
>
> ($a,$b,$) = ('First',,'Third');
>
> print "A: $a  B: $b  C: $c";
>
> -------------------
>
> The output of the code would look like:
>
> A: First  B: Third  C:
>
> Why does this happen this way. It is particularly disturbing because if
> you did something like
>
> &foo(1,,,4); Your function arguments all get scooted down.

That's why you prototype your functions or either check inside your
functions for the correct number of arguments.

This is not a bug.

Brandon





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

Date: Wed, 17 Nov 1999 01:35:46 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Wierd List Behavior
Message-Id: <SDnY3.20047$YI2.867288@typ11.nn.bcandid.com>

In article <80ssnm$s3p$1@nnrp1.deja.com>,  <tigger149@my-deja.com> wrote:
>Ok I found some wierd behavior. I am wondering if this is a perl bug or
>if it is documented somewhere?

I think Perl should report a parse error for two commas in a row.

>($a,$b,$) = ('First',,'Third');

That doesn't parse:
Useless use of a constant in void context at - line 1.
syntax error at - line 1, near ");"
Execution of - aborted due to compilation errors.

I think you mean ($a,$b,$c) = ('First',,'Third');.  Except that I think
you mean ('First', undef, 'Third');

>Why does this happen this way. It is particularly disturbing because if
>you did something like
>
>&foo(1,,,4); Your function arguments all get scooted down.

"Why" is a question I cannot answer.  I can tell you that if you don't
include an argument, adjacent commas get treated as single commas.
Perl is different from some other languages in this way.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 17 Nov 1999 01:44:59 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Wierd List Behavior
Message-Id: <vMnY3.20099$YI2.868676@typ11.nn.bcandid.com>

In article <SDnY3.20047$YI2.867288@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <80ssnm$s3p$1@nnrp1.deja.com>,  <tigger149@my-deja.com> wrote:
>>Ok I found some wierd behavior. I am wondering if this is a perl bug or
>>if it is documented somewhere?
>
>I think Perl should report a parse error for two commas in a row.

This may not have been clear: I think it would be a good idea for Perl
to treat this as a parse error.  I intended no opinion on what I
expected Perl to do; I take your word for it that it does as you report.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

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


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