[12941] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 351 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 3 15:07:22 1999

Date: Tue, 3 Aug 1999 12:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 3 Aug 1999     Volume: 9 Number: 351

Today's topics:
    Re: *Yet another* Net::FTP question (I R A Darth Aggie)
    Re: [offtopic]RE:Quot St and the Jeop Gm <tchrist@mox.perl.com>
    Re: [offtopic]RE:Quot St and the Jeop Gm llornkcor@my-deja.com
    Re: [offtopic]RE:Quot St and the Jeop Gm (Malcolm Ray)
    Re: [offtopic]RE:Quot St and the Jeop Gm (I R A Darth Aggie)
    Re: [offtopic]RE:Quot St and the Jeop Gm (I R A Darth Aggie)
        ActivePerl and html2ps -- win32 <d.memory@afpi.com>
    Re: Can perl use if control statement in other if contr <cassell@mail.cor.epa.gov>
        embedding multiple interpreters (specifying calls) (Amos Blackman)
    Re: embedding multiple interpreters (specifying calls) <tchrist@mox.perl.com>
        Free Programs <programmaholic@hotmail.com>
    Re: Help Please (Gary O'Keefe)
    Re: Help Please (I R A Darth Aggie)
    Re: Help Please <cassell@mail.cor.epa.gov>
    Re: How can I know what modules are installed on server <cassell@mail.cor.epa.gov>
    Re: How can I know what modules are installed on server <cassell@mail.cor.epa.gov>
    Re: How can I trap/block a kill -9 signal <tchrist@mox.perl.com>
    Re: How do I pass arguments from one CGI script to anot <cassell@mail.cor.epa.gov>
    Re: how to remove cr/lf ??? <cassell@mail.cor.epa.gov>
    Re: How? psdsp@my-deja.com
    Re: How? (llornkcor@earthlink.net)
    Re: Just Can't, Can't get Net::Telnet to work <jay@rgrs.com>
        Parsing Natural Language bayinnaung@my-deja.com
        password protected site (Fulko van Westrenen)
        perl 5 and IRIX 6.3 (CVanor1018)
        perl s///e weirdism||bug <acannon@spam.sr.hp.com>
        select-based networking (Roger Espel Llima)
    Re: stat problems on NT <ehpoole@ingress.com>
        strange error (Steve .)
    Re: strange error <Mark@Mark.Com>
    Re: strange error <Mark@Mark.Com>
    Re: The question of the performence of database handle <cassell@mail.cor.epa.gov>
        towards uploading binary files... irf@netexecutive.com
    Re: using __PACKAGE__ <aqumsieh@matrox.com>
    Re: using __PACKAGE__ <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 3 Aug 1999 18:00:39 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: *Yet another* Net::FTP question
Message-Id: <slrn7qebm8.v15.fl_aggie@thepentagon.com>

On Tue, 03 Aug 1999 15:58:06 GMT, Richard Lawrence <ralawrence@my-deja.com>, in
<7o73i7$m29$1@nnrp1.deja.com> wrote:

+ new (HOST [,OPTIONS])
+ This is the constructor for a new Net::FTP object. HOST is the name of
+ the remote host to which a FTP connection is required. OPTIONS are
+ passed in a hash like fashion, using key and value pairs. Possible
+ options are: Firewall, Port, Timeout, Debug and Passive.

+ So I tried this:

+ my @options;
+ $options{"Port"} = 99;

You're confusing a list with a hash. Are you sure you've run this/copied
it exactly?

% perl
use strict;
my @options;
$options{"Port"} = 99;
^D
Global symbol "%options" requires explicit package name at - line 3.

What does work is:

use strict;
use Net::FTP;

my %options;
%options=qw(Debug 10);

my $ftp = Net::FTP->new('coaps.fsu.edu', %options);
$ftp->login('anonymous','user@nowhere.none');
$ftp->cwd('/pub');
$ftp->quit;

[debugging feedback snipped but you get to see the numeric response codes]

now, when I make this change:

%options=qw(Debug 10 Port 23); # ftp defaults to 23, yes? redundant, yes,
                               # but I don't have a non-default ftp server...

I get:

Net::FTP: Net::FTP(2.40)
Net::FTP:   Exporter
Net::FTP:   Net::Cmd(2.12)
Net::FTP:   IO::Socket::INET(1.24)
Net::FTP:     IO::Socket(1.25)
Net::FTP:       IO::Handle(1.21)

and then it times out. Even if I excise the debugging stuff, and just pass
in Port 23, it times out. As a wild-assed guess, I tried this:

%options=qw(Debug 10 23 Port);

Well, shiver me timbers, that worked. That strikes me as being somewhat
anti-intuitive, but maybe I'm not thinking about it correctly?

James


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

Date: 3 Aug 1999 11:14:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <37a72371@cs.colorado.edu>

     [courtesy cc of this posting denied to cited author,
      for of courtesy, the cad clearly knows little.]

In comp.lang.perl.misc, llornkcor@my-deja.com writes:
:All I am trying to do, is to get those *perl-programmers* to have some
:compassion when replying. I could care LESS who wrote WHAT book. Get
:off your high horses. Please

You *could* care less?  That means you obviously care enough that
there's room for caring less.  I'm so glad you care.  I am touched by
this sentiment.

Or did perhaps you mean *couldn't care less*?  If so, why ever didn't
you write that?  If you're this sloppy with language, perhaps you should
abandon programming languages altogether, since they are notorious for
being even more sensitive to the difference between true and false than
am I.

If you continue to write true when you mean false, Perl will generate so
much cross-talk beteen your spinal backplane and your cognitive frontal
lobes that your entire mental system will melt down into a muddled morass
of blathering k3w1t0k.

Or are we already viewing the results of this blessed event?  Your utter
incompetence at posting would certainly appear to support that hypothesis.

--tom
-- 
    Besides, REAL computers have a rename() system call.    :-)
                    --Larry Wall in <7937@jpl-devvax.JPL.NASA.GOV>


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

Date: Tue, 03 Aug 1999 17:41:19 GMT
From: llornkcor@my-deja.com
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <7o79jt$qtr$1@nnrp1.deja.com>

I was pointing out that many "reply's" on this ng are very
condescending to the poster, especially if it's a newbie asking, whats
been deemed by the *perl-GODS*, as "something thats addressed in the
FAQ's". While he might be trying to make the net a better place in his
own way, so am I.

You been spared many of the emails regarding this issue.
have a nice day-

> Your (implicit) link is invalid.
>
> I'll elaborate:  Tom's personality and expository style
> are not mine.  Despite this, I recognize article
> <37a633ad@cs.colorado.edu> as good-natured, lucid, poten-
> tially useful, and likely to yield positive results.
> Your criticism of him falls flat with this reader, and
> is considerably thinner in its humor than the weight of
> its lines and lines of text.
> --
>
> Cameron Laird           http://starbase.neosoft.com/~claird/home.html
> claird@NeoSoft.com      +1 281 996 8546 FAX
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 3 Aug 1999 18:07:04 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <slrn7qebu7.9p.M.Ray@carlova.ulcc.ac.uk>

On Tue, 03 Aug 1999 17:41:19 GMT, llornkcor@my-deja.com <llornkcor@my-deja.com>
wrote:
>I was pointing out that many "reply's" on this ng are very
>condescending to the poster, especially if it's a newbie asking, whats
>been deemed by the *perl-GODS*, as "something thats addressed in the
>FAQ's". While he might be trying to make the net a better place in his
>own way, so am I.

You fail.  Thanks for playing.

Seriously, you're not saying anything new.  Every few days a newbie says
much the same, frequently with worse spelling and punctuation than yours.
Guess what?  It makes no difference.  So why bother?

-- 
Malcolm Ray                           University of London Computer Centre


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

Date: 3 Aug 1999 18:12:59 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <slrn7qecdh.v15.fl_aggie@thepentagon.com>

On Tue, 03 Aug 1999 16:24:58 GMT, llornkcor@my-deja.com
<llornkcor@my-deja.com>, in <7o754c$nc8$1@nnrp1.deja.com> wrote:

+ All I am trying to do, is to get those *perl-programmers* to have some
+ compassion when replying.

So, what's non-compassionate about saying "Take a look at perlfaq8"
or "look at the perlre document" or "do you know it is easier to search
the documentation on your own machine than it is to write to usenet?"?

Am I supposed to spoonfeed the masses? Oh...ok, want my rate card?

+ I could care LESS who wrote WHAT book.

A great deal of effort has been put into the included electronic
documents by a number of people. Would it really hurt that much to
learn to consult that before consulting all of Usenet?

+ Get off your high horses.

Yes, please do. Try not to trip over the saddlehorn, tho.

James

"I wrote it down so I wouldn't have to remember!"
 - Sean Connery, _Indiana Jones and the Last Crusade_


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

Date: 3 Aug 1999 18:14:58 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <slrn7qech8.v15.fl_aggie@thepentagon.com>

On Tue, 03 Aug 1999 16:26:04 GMT, llornkcor@my-deja.com
<llornkcor@my-deja.com>, in <7o756d$ne4$1@nnrp1.deja.com> wrote:

+ oh, I did read it..

Did you _understand_ it?

James


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

Date: Tue, 03 Aug 1999 12:53:46 -0500
From: Dave Memory <d.memory@afpi.com>
Subject: ActivePerl and html2ps -- win32
Message-Id: <37A72CAA.F87B3FD6@afpi.com>

I am no programming guru, in fact, I have little workable knowledge in this
area.  I have worked with some Perl before, but not enough to know enough to
help me now.  Also, it was on a FreeBSD system, and I'm on WinNT now.  It is NT
4.0, and I have Active Perl for win32. 

Now, all I need are some pointers to help me config html2ps to work with it.  Or
is there a version of html2ps specifically for a win32 platform?

Any help?

-- 

Dave Memory
d.memory@afpi.com

---------1---------2---------3---------4---------5---------6---------7---------8


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

Date: Tue, 03 Aug 1999 11:49:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Can perl use if control statement in other if control statement?
Message-Id: <37A739B0.E7ECA496@mail.cor.epa.gov>

Carfield Yim wrote:
> 
> Can perl use if control statement in other if control statement?

Yes.

> i.e.: if (...) {
>  if (...){...}
>  else (...){...}
>  } elsif ....

Now it's hard to tell.  You haven't formatted this too well.
But you may have accidentally introduced a syntax error into
your code.
 
> I think it should be okay,
> but I have compile time error of this,

And what did the error say?  Can you reproduce this error
in less than 20 lines?  Do all your parens and brackets match
up properly?

>                                        then I take a look of perlman,
> there are no example of this. Is it illegal in perl?

No, but it's possible to put in typos which convince Perl
you did something wrong.
 
HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 3 Aug 1999 18:18:18 GMT
From: blackman@ice4.fas.harvard.edu (Amos Blackman)
Subject: embedding multiple interpreters (specifying calls)
Message-Id: <slrn7qecjt.dvk.blackman@ice4.fas.harvard.edu>
Keywords: embed, perl_call, perl_eval

I'm writing a shared library that basically provides an Perl Interpreter to
people calling into it.  What I'd like to do is have them first call into the
library and return them a pointer to the PerlInterpreter, they then use this
when calling other routines in the library and use that interpreter for
handling the call.  But my problem is that even though I can have multiple
interpreters in exisitence (compiling with MULTIPLICITY), I can't specify
which interpreter is used for evaluating perl_call_* and perl_eval_* calls.
Is it possible to do this?  I really can't decipher the source enough to
figure it out, and the man pages and faqs don't address it.

Thanks!

-amos



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

Date: 3 Aug 1999 12:34:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: embedding multiple interpreters (specifying calls)
Message-Id: <37a73641@cs.colorado.edu>
Keywords: embed, perl_call, perl_eval

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Amos Blackman <blackman@fas.harvard.edu> writes:
:I'm writing a shared library that basically provides an Perl Interpreter to
:people calling into it.  What I'd like to do is have them first call into the
:library and return them a pointer to the PerlInterpreter, they then use this
:when calling other routines in the library and use that interpreter for
:handling the call.  But my problem is that even though I can have multiple
:interpreters in exisitence (compiling with MULTIPLICITY), I can't specify
:which interpreter is used for evaluating perl_call_* and perl_eval_* calls.
:Is it possible to do this?  I really can't decipher the source enough to
:figure it out, and the man pages and faqs don't address it.

If you don't get a good answer here, try p5p.  I know Sarathy
has been playing with this lately.

--tom
-- 
There are probably better ways to do that, but it would make the parser
more complex.  I do, occasionally, struggle feebly against complexity...  :-)
            --Larry Wall in <7886@jpl-devvax.JPL.NASA.GOV>


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

Date: Tue, 3 Aug 1999 23:51:07 +0530
From: "Programmaholic" <programmaholic@hotmail.com>
Subject: Free Programs
Message-Id: <7o8gia$2ko$1@news.vsnl.net.in>

Hi,

I'm a student and I would like to improve my programming skills. So if
anybody here needs a Perl Program, I'll be willing to help develop it with
you, or do the entire thing on my own. Of course this depends on my
available free time after college.

Manish J.




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

Date: Tue, 03 Aug 1999 17:12:42 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: Help Please
Message-Id: <37a71f45.29481958@news.hydro.co.uk>

Chris Wilkinson wrote:

>Hi All
>Im new to this so please bear with me
>I Have a perl script wrote by someone else and want to modify it. On 2
>lines of the code it says
>print GETF "set ssuser=cwilkinson\n";
>print GETF "set sspwd=cwilkinson\n";
>
>This is the username and password for an application where the scripts
>needs to get some data from. Now what I want to do is to be able to
>prompt for a username and then a password instead of having it hardcoded
>into the script

Try:

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

use strict;

my $uname;
my $pass;

# print a prompt
# take the input line-by-line
# then remove the end-of-line char

print "login: "; $uname = <STDIN>; chomp $uname; 
print "password: "; $pass = <STDIN>; chomp $pass;

print "username: ", $uname, "\n";
print "password: ", $pass, "\n";

This reads STDIN one line at a time ( $uname = <STDIN>; ) and then
removes the trailing end-of-line character ( chomp $uname; ). The
username and password are now in a form generally suitable for
manipulation.

>Like I said im very new to this so any ideas would be helpful but try
>not to be too techy about it as I only downloaded Perl this morning.

Trust me Chris, you'll have to worry more about folk around here being
tetchy rather than techy. This question is answered in the FAQs that
came with perl. I understand you've only just got it, but take the
time to set up (and READ) the docs before you post to the group. The
second- and first-tier perl programmers **REALLY** don't like
answering questions like this and if they think you're wasting their
time rather than doing your own research they'll killfile you as soon
as look at you.

Gary (definitely in TomC's third-tier but happy to help when he can)
--
Gary O'Keefe
gary@onegoodidea.com

You know the score - my current employer has nothing to do with what I post


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

Date: 3 Aug 1999 18:16:17 GMT
From: fl_aggie@thepentagon.com (I R A Darth Aggie)
Subject: Re: Help Please
Message-Id: <slrn7qecjm.v15.fl_aggie@thepentagon.com>

On Tue, 03 Aug 1999 11:26:51 -0500, Tom Briles <sariq@texas.net>, in
<37A7184B.96123E0D@texas.net> wrote:

+ _Learning Perl_ by (surprise) Randal L. Schwartz

The newer edition includes another author of the initials 'TC'... :)

James


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

Date: Tue, 03 Aug 1999 11:56:45 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Help Please
Message-Id: <37A73B6D.FE044974@mail.cor.epa.gov>

Chris Wilkinson wrote:
[snip of Andreas' post]
> I have just discovered this thanks to someone e-mailing me, and I now have it
> working, the only other problem is that the password when entered is visble
> rather than a series of ******.  I think my main problem is that I am not and
> never will be a programmer.

Okay, but just bear in mind that this *is* a programming group,
and everyone else expects you to act like a programmer while
you're visiting.

Now then, you don't have to be a programmer to use the Perl
FAQ.  It comes with every proper install of Perl, and it 
already has the answer to your second question in it.  Since
you're posting from an NT machine, you can go to ActiveState
[ www.activestate.com ] and grab a copy of Perl and then
let it install itself on your machine.  It will stick an
HTML version of the docs on your Start Menu for you, and then
you can read the FAQ in your favorite browser.  Or you can
go to www.perl.com and follow the links to another copy of
the FAQ.  But anytime you have a Perl question like this one,
your first thought should be: "Is it in the FAQ?  Is there
already-tested code in there I can use without having to
learn all of Perl, and all of algorithm theory, and a bunch 
of other stuff?"

That said, you might also consider walking through a Perl
tutorial like 
  http://www.netcat.co.uk/rob/perl/win32perltut.html
and seeing if Perl does look like something you could pick
up fairly easily.  You can program in Perl before you know
everything there is to know about Perl.

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


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

Date: Tue, 03 Aug 1999 11:26:11 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How can I know what modules are installed on server?
Message-Id: <37A73443.C0D6F007@mail.cor.epa.gov>

llornkcor wrote:
> 
> dont mind her, or them, they just have some big chip on their
> shoulders. Thats their usual reply- read the faq....

And for a good reason, usually.  Perhaps you could help out
by explaining to these querents *what* the FAQ is, and *where*
they can read it, and why.  You seem to have more patience than 
some responders around here.

> Have you contacted your web server's support to ask
> what OS?
> what, if any, perl modules are installed, and how to access them?

Now that's the best answer given in this thread.  Thank you.
If the poster can't get a straight answer out of (his)|(her) ISP,
then s?he has bigger problems than perl module installation.

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


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

Date: Tue, 03 Aug 1999 11:28:46 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How can I know what modules are installed on server?
Message-Id: <37A734DE.5A32F3E@mail.cor.epa.gov>

Ray Cadmus wrote:
> "99% Energy" wrote:
> > How can I tell what modules are installed on a server? How can I replicate
[my snip]
> I found this somewhere (probably on this newsgroup).  Sorry,  I don't have the
> author's name.
> Anyway,  if the server has a couple basics this will dump the environment via
> your browser.
> 
> #!/perl/bin/perl -w
> 
> use lib '.';
> 
> use CGI;
> use File::Find;
> use strict;
[my snip of code]

But bear in mind that if your ISP has a really old Perl, or
just hasn't properly installed a recent Perl, it may not have
these modules either.. in which case the program will fail
and you should get another ISP.

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


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

Date: 3 Aug 1999 11:21:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How can I trap/block a kill -9 signal
Message-Id: <37a7251a@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Ming" <fungs@logica.com> writes:
:Does anyone out there know how to trap/ignore a 'kill -9' signal for a Perl
:process.

Yes, but you've have to break your kernel to do so.

--tom
-- 
    "Don't let it get to you.  Shout happens." --Larry Wall


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

Date: Tue, 03 Aug 1999 11:41:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How do I pass arguments from one CGI script to another?
Message-Id: <37A737DC.A4D8E826@mail.cor.epa.gov>

I.J. Garlick wrote:
[MAJOR snip on my part]
> and call the relevant subroutine. (I think this is known as laziness, see
> camel, it's in there somewhere I remember reading it but can't track it
> down)

Easiest place?  The glossary.  p. 609 in my copy:

laziness
  The quality that makes you go to great effort to reduce overall
  energy expenditure. It makes you write labor-saving programs
  that other people will find useful, and document what you wrote
  so you don't have to answer so many questions about it.  Hence,
  the first great virtue of a programmer. Also hence, this book.
  See also impatience and hubris.

Apparently, we're not lazy enough, since we haven't found a way
to stop answering so many questions about Perl.

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


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

Date: Tue, 03 Aug 1999 11:36:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: how to remove cr/lf ???
Message-Id: <37A736A0.6B50F871@mail.cor.epa.gov>

Bart Lateur wrote:
> 
> elephant wrote:
> 
> >>(This assumes your machine treats \n as CR-LF. This is the case if you're
> >>on a PC.)
> >
> >a PC ? .. so you mean if I run Linux or NT on my PC then my line endings
> >are still the same as DOS ? .. oh man - what a ripoff - I'm taking this
> >thing back
> 
> You're easily disturbed, if a change in definition of line endings
> bothers you that much.

Umm, Bart, you do know that elephant was just gigging the 
original poster?  The poster had made a similarly silly
statement about his software, and...

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


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

Date: Tue, 03 Aug 1999 17:34:52 GMT
From: psdsp@my-deja.com
Subject: Re: How?
Message-Id: <7o797s$qnj$1@nnrp1.deja.com>

In article <37A71658.C3C00073@hns.com>,
  Robert Ho <rho@hns.com> wrote:
> I have a file which contains expressions:    "(contents", and
> "(contents)"
>
> I want to substitute "(contents)" with a blank space but I'm finding
> it's not
> so easy due to the parentheses.  Can someone help me with a perl
trick?
>
> --
> Robert Ho rho@hns.com
>
>
Assuming that $line contains the data,
$line =~ s/"\(contents\)"/ /g;

backslash will escape ().

Hope that helps.
Deva


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 03 Aug 1999 10:59:51 -0600
From: llornkcor@earthlink.net (llornkcor@earthlink.net)
Subject: Re: How?
Message-Id: <wklnbsx0jc.fsf@earthlink.net>

try using a \ in front of the (

"\(contents\)"
does this help?

Robert Ho <rho@hns.com> writes:

>I have a file which contains expressions:    "(contents", and
>"(contents)"
>
>I want to substitute "(contents)" with a blank space but I'm finding
>it's not
>so easy due to the parentheses.  Can someone help me with a perl trick?
>
>--
>Robert Ho rho@hns.com
>
>
>

-- 
llornkcor rocknroll
SpiritShip MultiMedia Recording Studio
www.llornkcor.com
			        (0 0)
+=======================----oOO--(_)--OOo----=========================+
   __   _
  / /  (_)__  __ ____  __    
 / /__/ / _ \/ // /\ \/ /  
/____/_/_//_/\_,_/ /_/\_\    The choice of a GNU generation...



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

Date: 03 Aug 1999 13:10:28 -0400
From: Jay Rogers <jay@rgrs.com>
Subject: Re: Just Can't, Can't get Net::Telnet to work
Message-Id: <82hfmgiyd7.fsf@shell2.shore.net>

"Colin Chaplin" <Colin@Chaplin.sol.co.uk> writes:

> So I found out about net::telnet and installed that fine, etc
> 
> Problem is, even using the supplied examples, I am having little joy.
> 
> My first problem was getting it to recognise the command prompt (I was
> getting 'timeout waiting for command prompt'). I thought I was being stupid
> so changed it to something really simple (I ain't too hot on regexp's) -
> that didn't work. Upon further testing I was also getting 'timeout waiting
> for password prompt'. It appears to be random which error I get.
> 
> The program was trying to telnet the machine it is running on, Redhat Linux
> 5.2 pretty much as it is out of the box running on a pentium.

Apparently there's a bug in RedHat 5.2 login program.  For details see:

    http://www.dejanews.com/getdoc.xp?AN=470565743

--
Jay Rogers
jay@rgrs.com


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

Date: Tue, 03 Aug 1999 17:19:42 GMT
From: bayinnaung@my-deja.com
Subject: Parsing Natural Language
Message-Id: <7o78b0$pt4$1@nnrp1.deja.com>

Anybody ever use the perl regular expression engine to
parse natural language texts (linguistically that is).

I've been experimenting recently with the Xerox Finite State
Tools which also have regular expressions (see links below)
and I was wondering whether anyone had use the Perl regular
expression engine to do the same sort of thing,
perhaps by writing an extension?

Xerox Finite State Home Page (Xerox Europe)
http://www.xrce.xerox.com/research/mltt/fst/

Xerox Finite State Calculus
http://www.xrce.xerox.com/research/mltt/fst/articles/jnle-97/rele.html

ATT finite state toolkit
http://www.research.att.com/sw/tools/fsm/

Intex, University of Paris
http://www.ladl.jussieu.fr/Intex/new_intex.html

Torbjörn Lager, Sweden
Finite State Funhouse
http://www.ling.gu.se/~lager/funhouse.html
thesis
http://www.ling.gu.se/~lager/taglog.html

Jon Fernquest
bayinnaung@hotmail.com


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 3 Aug 1999 18:59:21 GMT
From: fulko@trane.wtm.tudelft.nl (Fulko van Westrenen)
Subject: password protected site
Message-Id: <slrn7qef09.d1.fulko@trane.wtm.tudelft.nl>


Hello,

I would like to make a password protected page with perl:
after you enter a user/password you can update a database.
I have some ideas about how this should be done but is 
the some documentation on this subject?

Thanks,
Fulko

-- 
Fulko van Westrenen 
email: F.C.v.Westrenen@tue.nl


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

Date: 03 Aug 1999 18:11:04 GMT
From: cvanor1018@aol.com (CVanor1018)
Subject: perl 5 and IRIX 6.3
Message-Id: <19990803141104.09784.00005999@ng-ca1.aol.com>

Does anyone know how to install the compiled version of Perl 5 onto the IRIX
6.3 system without a C Compiler?  We have the binaray files but are stuff.  Any
help is much appreciated.  Our Tech support guy is failing us.

Thanks


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

Date: Tue, 03 Aug 1999 11:51:11 -0700
From: Andrew Cannon <acannon@spam.sr.hp.com>
Subject: perl s///e weirdism||bug
Message-Id: <37A73A1F.B7511A30@spam.sr.hp.com>

test.C contains the following:

//        $Author:$
//        $Source:$
//        $Date:$
//        $Revision:$
void main() {
test=1;
}

execute on the command line the following:
    perl -pi -e 's/(test=)(\d+);.*$/print $1.($2+1).";"/e' test.C

test.C now contains
//        $Author:$
//        $Source:$
//        $Date:$
//        $Revision:$
void main() {
test=2;1
}

I was expecting:
//        $Author:$
//        $Source:$
//        $Date:$
//        $Revision:$
void main() {
test=2;
}

I have tried adding more parenthesis to control the execution flow,
but I get the same result.  If this is not a bug, can someone explain
where the extra 1 comes from.

If want to respond directly to me, remove the "spam" portion of my e-mail
address.

Thanks,
--
------------------------http://web.sr.hp.com/~acannon-------------------------
Andrew Cannon                                             Agilent Technologies
acannon@sr.hp.com                                         Automated Test Group
Software Design Engineer                       RF Semiconductor Test Operation




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

Date: Tue, 3 Aug 1999 18:47:22 +0200
From: espel@iagora.com (Roger Espel Llima)
Subject: select-based networking
Message-Id: <qe67o7.5e1.ln@rajpur.iagora.es>

[ 2nd time I post about this; I'm not sure the first one went through. ]

I'm writing a server in perl that needs to be able to handle a few
hundreds of long-standing network connections.

There is a lot of shared state, so all connections will be handled in a
single process, using a select()-based networking model, with
non-blocking sockets everywhere, and sysread/syswrite to go with it.

My question is:

Is there some module that implement a select() inner loop, where you
register IO::Socket objects with associated \&callbacks, and it does the
work of select()ing and line buffering for you?

And, if not, would there be interest in a module to handle this kind of
thing in a general way?  Would it fit somewhere in CPAN?


I'm thinking of something more or less like this for an interface:

   use IO::Socket;
   use SelectLoop;

   $loop = SelectLoop->new;

   $l = IO::Socket::INET->new(Listen => 5, LocalPort => 4242, Proto => 'tcp');
   $loop->addfd(Handle => $l, ReadBuf => 0, CallBack => \&new_conn);
   $loop->wait();		# handle things forever

   sub new_conn {
     my $self = shift;		# gets $loop 
     my $handle = shift;	# gets $l
     my $conn = $handle->accept() || return;
     
     &make_non_blocking($conn);	# using fcntl

     $loop->addfd(Handle => $conn, ReadBuf => 'line', MaxLineLen => 1024,
     		  WriteBuf => 'block', WriteBufSize => 4096,
		  CallBack => \&client_line);
   }

   sub client_line {
     my ($self, $handle, $line) = @_;

     $handle->close, $self->remfd($handle), return 
     	unless defined($line);		# handle EOF

     $self->write($handle, "You wrote:");		# gets buffered
     $self->write($handle, $line);			# that too

     $self->flush($handle);		# attempts write; part of the data
					# can stay buffered if syswrite()
					# returns partial success
   }



-- 
Roger Espel Llima, espel@iagora.com
http://www.eleves.ens.fr:8080/home/espel/index.html


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

Date: Tue, 03 Aug 1999 14:37:23 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: stat problems on NT
Message-Id: <37A736E3.A1D336FD@ingress.com>

BP wrote:
> 
> hi all:
> 
> i'm using activestate perl 5.005.
> 
> i am always getting 1 for nlink in the following statement:
> 
>      ($dev,$ino,$mode,$nlink) = stat($dir) unless $nlink;
> 
> even when there are sub directories.
> 
> am i doing something wrong? is there another way of finding out how many
> 
> subdirectories there are in a given directory?

If you had taken the time to read the documentation that came with your
perl installation (perldoc -f stat) you would have learned that stat()
only operates on open _FILE_ handles, not directories.  You'll also learn
that not all options are implemented on all file systems.

For a very simple routine to find out how many directories there are you
could use opendir, readdir, the "-d" test and closedir.  Test how many
files (with -d) (excluding '.' and '..') are actually directories and
count them.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Tue, 03 Aug 1999 17:39:51 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: strange error
Message-Id: <37a72901.479721308@news.enteract.com>

Have a program with perfectly matched brackets, quotes, etc.  I typed
up a quick search program and all "bracket" types are perfectly
matched.  However, I'm getting this error at the last line of the
program which by the way is just a # remark.

Missing right bracket at ./ftp_html2.pl line 378, at end of line
syntax error at ./ftp_html2.pl line 378, at EOF
Execution of ./ftp_html2.pl aborted due to compilation errors.


Any ideas?  Thanks.

Steve

Newsgroup replies preferred.  Remove nospam when replying thru email.


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

Date: Tue, 03 Aug 1999 19:24:16 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: strange error
Message-Id: <37A733D0.3E26DBA1@Mark.Com>



"Steve ." wrote:

> Have a program with perfectly matched brackets, quotes, etc.  I typed
> up a quick search program and all "bracket" types are perfectly
> matched.  However, I'm getting this error at the last line of the
> program which by the way is just a # remark.
>
> Missing right bracket at ./ftp_html2.pl line 378, at end of line
> syntax error at ./ftp_html2.pl line 378, at EOF
> Execution of ./ftp_html2.pl aborted due to compilation errors.
>
> Any ideas?  Thanks.
>
> Steve
>
> Newsgroup replies preferred.  Remove nospam when replying thru email.

You will have to post the source




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

Date: Tue, 03 Aug 1999 19:24:56 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: strange error
Message-Id: <37A733F7.5C0E1D32@Mark.Com>



"Steve ." wrote:

> Have a program with perfectly matched brackets, quotes, etc.  I typed
>

<snippety snip>

You will have to post the source




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

Date: Tue, 03 Aug 1999 11:46:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: The question of the performence of database handle
Message-Id: <37A73901.2A16B66D@mail.cor.epa.gov>

Carfield Yim wrote:
> 
> I want to ask, is ODBC really very slow? Will it affect the performance
> of the system very much??
> If I change to use the other database driver, like mySQL or mSQL, will
> the performance change a
> lot?

It depends a lot on the usage.  If you're running a CGI
script, with no persistence of the database connection,
almost any database differences are going to be swamped
by the startup costs [i.e. time] associated with the CGI
program and the database connection.  If you're running
mod_perl and maintaining a connection to your database
via a separate process which acts as a queue and using a
large database, then you may be able to see noticeable
differences in performance due to drivers and databases.

So you'll just have to test your own setup.

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


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

Date: Tue, 03 Aug 1999 18:23:23 GMT
From: irf@netexecutive.com
Subject: towards uploading binary files...
Message-Id: <7o7c2d$t0l$1@nnrp1.deja.com>

hi i am relatively new to perl & :

to upload binary files (eg, gif etc), i tried using this code:
(data comes from an <INPUT TYPE=FILE> element)
----------------------------------------------
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
$dat=$buffer;

#these next lines to get rid of data that is not part of the file
$dat=~s/.*\n.*\n.*\n//;
$dat=~s/\-+\d+\-+//;
$dat=~s/\n//g;
$dat=~s/\r//g;

print "Content-type: image/gif\n\n";
print $dat;
-------------------------------------------
funnily enough, the gif's size is retained but the image does not
come through. (i get a correct bounding-box, but broken image icon).
also, if i save it, the new file size is smaller than it should be.

could someone please help me out with this - i know there are libraries
out there that can do this easily, but i want to understand what i am
doing wrong (which i am sure are a lot of things).


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 3 Aug 1999 11:23:18 -0400 
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: using __PACKAGE__
Message-Id: <x3y4sigevmi.fsf@tigre.matrox.com>


jschueler@tqis.com writes:

> The string string __PACKAGE__ failed for the www.perl.com documentation.

hmmm... a grep shows me the following:

/opt/GNUperl5.004_04/lib/pod/perldata.pod:Three special literals are __FILE__, __LINE__, and __PACKAGE__, which
/opt/GNUperl5.004_04/lib/pod/perldata.pod:(due to a C<package;> directive), __PACKAGE__ is the undefined value.
/opt/GNUperl5.004_04/lib/pod/perldelta.pod:=item __PACKAGE__
/opt/GNUperl5.004_04/lib/pod/perldelta.pod:C<__FILE__> and C<__LINE__>, C<__PACKAGE__> does I<not> interpolate
/opt/GNUperl5.004_04/lib/pod/perlmod.pod:The special symbol C<__PACKAGE__> contains the current package, but cannot
/opt/GNUperl5.004_04/lib/pod/perltoc.pod:__PACKAGE__

>   #! /usr/bin/perl
>   use strict ;
> 
>   package foobar ;
>   use vars qw( $hello ) ;
>   $hello = 'world' ;
>   print $__PACKAGE__::hello, "\n" ;
> 
> I would prefer that this script print "world" instead of a blank line.

Then change your print() statement to:

	print eval("\$" . __PACKAGE__ . "::hello");

HTH,
Ala



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

Date: 3 Aug 1999 11:58:35 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: using __PACKAGE__
Message-Id: <37a72dcb@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Ala Qumsieh <aqumsieh@matrox.com> writes:
:Then change your print() statement to:
:	print eval("\$" . __PACKAGE__ . "::hello");

I've sure you realize that an eval() is always overkill
when you're doing symbol table hacking.

--tom
-- 
    "I think I'll side with the pissheads on this one." --Larry Wall


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

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

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


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