[11214] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4814 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 3 11:07:17 1999

Date: Wed, 3 Feb 99 08:00:24 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 3 Feb 1999     Volume: 8 Number: 4814

Today's topics:
        [PATCH]5.005_54 (pod2html) Generate Relative URLs <rbs@telerama.com>
    Re: alternative perl NG for newbies? <andrewf@beausys.demon.co.uk>
    Re: Anyone familar with CGI.pm internals? <fty@utk.edu>
    Re: Apache module to do Authentication/Authorization ag <Kai.Krebber@syseca.de>
    Re: are regular expression rationaly designed ? droby@copyright.com
        awk in perl (Richard G. Hall)
    Re: awk in perl <jdf@pobox.com>
        Calling a data from the database to the html page <john@mediamanager.com.sg>
    Re: Can't coerce array into hash <jdf@pobox.com>
    Re: Can't coerce array into hash (Bill Moseley)
    Re: Catching TSTP (OS, Perl, or Programmer bug?) <macintsh@cs.bu.edu>
    Re: DBI nite_eagle@hotmail.com
    Re: END blocks for subs? (Marc Haber)
    Re: END blocks for subs? (Andrew M. Langmead)
    Re: Good CGI Book (DOWatDPG1)
        How use cookies to track referrals? (Worldmall)
    Re: How use cookies to track referrals? <jdf@pobox.com>
        Installation Problem with IO module <Oleg_Waisberg@Health.Lmig.ca>
    Re: Is there an Interactive Debugger for Perl? <no_spam@no_spam.com>
    Re: Is there an Interactive Debugger for Perl? (Rich)
    Re: local($_) - why not "my"? <aeb@saltfarm.bt.co.uk>
        LWP Question <webdude@usit.net>
        Net::Telnet -- how do I telnet from a telnet session? <lee.ramirez@westgroup.com>
    Re: Oracle from Linux <thaynes@openlinksw.co.uk>
    Re: Perl Criticism [summary] (Tad McClellan)
        Perl NT login scripts help... (Mjd440)
    Re: Problems with Content-Type Header in PERL/CGI (Bill Moseley)
        require does not work nondeterministically (herwig)
    Re: Soft reference question (Lou Hevly)
    Re: Statistics for comp.lang.perl.misc (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 03 Feb 1999 10:40:02 -0500
From: Barrie Slaymaker <rbs@telerama.com>
Subject: [PATCH]5.005_54 (pod2html) Generate Relative URLs
Message-Id: <36B86DD2.69728881@telerama.com>

This patch allows installhtml and pod2html to use relative 
links. For the obvious reasons: portability and protocol 
independance.

I don't think it collides with any of the few other changes 
to installhtml or pod2html between _02 and _54, so patch can
probably figure it out against _02 as well.

The only change to the interface is that leaving --htmlroot 
off the installhtml command line generates relative paths 
where possible. 

We could also make it ignore --htmlroot if it's the same 
as --htmldir, or even ignore it alltogether.

Here's a link to the patch, please let me know if you want 
it in email or on this list, I didn't want to post a 45k 
message:

http://www.telerama.com/~rbs/perl/patch-Pod-Html-relative-5.005_54.txt

Coming soon to CPAN site near you (it's already on www.perl.com proper):

http://www.perl.com/CPAN/authors/id/R/RB/RBS/patch-Pod-Html-relative-5.005_54.txt

Affected files:

installhtml
lib/Pod/Html.pm
lib/File/PathConvert.pm (add)

The biggest thing in there is File::PathConvert, the workhorse 
that converts absolute URLs to relative URLs in minimal canonical
form.

The only bug I know of is that I haven't dealt with the code that builds
index files like perlfunc yet. That's coming soon.

Thanks,

Barrie


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

Date: Wed, 3 Feb 1999 15:18:08 +0000
From: Andrew Fry <andrewf@beausys.demon.co.uk>
Subject: Re: alternative perl NG for newbies?
Message-Id: <Pg989DAwiGu2Ewyi@beausys.demon.co.uk>

In article <slrn7bgatn.5sm.sholden@pgrad.cs.usyd.edu.au>, Sam Holden
<sholden@pgrad.cs.usyd.edu.au> writes
>Andrew Fry <andrewf@beausys.demon.co.uk> wrote:
>>In article <798js5$6b$1@client2.news.psi.net>, Abigail <abigail@fnx.com>
>>writes
>>>Andrew Fry (andrewf@beausys.demon.co.uk) wrote on MCMLXXXI September
>>>MCMXCIII in <URL:news:OxisJAACj3t2EwbQ@beausys.demon.co.uk>:
>>>$$ 
>>>$$ As I have already said, take this to its logical conclusion and
>>>$$ one could, with some justification, answer 'RTFM' to 99.9% of all
>>>$$ questions.
>>>
>>>That certainly isn't true. (See your point c).
>>
>>Yes it is ... to a point. I guess that the answer to the majority of
>>questions/queries lies in a document/FAQ/book/website somewhere ...
>>where do you draw the line ?
>
>The line is drawn at the documentation that comes with the lastest stable
>version of perl. 
>
>I have never said that the answer is in a book or website without quoting
>the whole answer as well. What books people have access to, and what web sites
>they have access to varies. Everyone who uses perl has access to the
>documentation that comes with perl (excusing installation problems) and thus
>references to that documentation are as valid an answer as the text of the
>document itself.
>
>>
>>>$$ This does rather presume that...
>>>$$ (a) newbies know what documentation exists, and know their way around it
>
>A reference to the documentation as an answer tells them that the
>documentation exists, and by finding that reference they will 
>learn thier way around it.
>
>>>
>>>If you want to know how the 'ls' command works, you type 'man ls'.
>>>If you want to know how the 'tar' command workds, you type 'man tar'.
>>>If you want to know how the 'cp' command works, you type 'man cp'.
>>>If you want to know how the 'telnet' command works, you type 'man telnet'.
>>>
>>>Guess what you have to type to learn more about Perl?
>>
>>(Why is it the experts *have* to add a touch of condescension/sarcasm
>>to their remarks, I wonder ?)
>>
>>BTW. I tried 'man perl' on UnixWare 7.0.1 some time ago ... it doesnt
>>produce anything. Unfortunately, I dont have the time to find out
>>why this is.
>>
>>>
>>>$$ (b) newbies have all the time in the world to read documentation
>>>
>>>Oh. Right. They are execused from reading the documentation, cause their
>>>time is so valueble. Wasting time of hundreds or thousands of people
>>>reading their question doesn't matter?
>>
>>1. I was not suggesting that newbies should be excused reading
>>   documentation, nor that their time is so valuable as to be so
>>   excused. These are absurd suggestions, and it is wrong of you
>>   to read these interpretations into what I said.
>>2. "Wasting time of hundreds/thousands of people reading their
>>   question".
>>   Oh no ... here comes the hyperbole! How long does it take to read
>>   one question and decide that it is to trivial to respond to, for
>>   goodness sake ? (Probably a small fraction of the time you spend
>>   on-line, I guess).
>
>But even if it only takes a couple of seconds, thats a couple of seconds
>that has to be taken by hundreds/thousands of people, I think the poster
>can have the courtesy to think about that and spend a few thousand 
>seconds looking themselves first.
>
>>
>>>
>>>$$ (c) the documentation will tell them precisely what they need to know
>>>$$     (Come know ... anyone who knows technical documentation knows that
>>>$$     that often isnt the case!)
>>>
>>>Then they should ask a questions to clearify the documentation. Like,
>>>"the documentation says "Foo bar", but what does that mean?".
>>
>>If I have a problem in a piece of code that I need to fix
>>quickly, then I am not going to start asking questions about
>>a particular document. But I take your point...
>>
>>>
>>>$$ (d) reading the numerous Perl books isnt enough
>>>
>>>Then they should ask questions to clearify the books.
>>
>>The suggestion is that all newbies should...
>>a) be aware of, and read thoroughly, all on-line documentation
>>b) be aware of, and read a number of recommended books
>>c) be aware of, and read, the code inside Perl modules
>>... before even daring to post a question on this newsgroup.
>>I dont know about other people, but, while I realize the importance of
>>reading documentation, I dont always have time to do all this.
>
>No all newbies should read the faqs thouroughly and read perlsyn and 
>perlfunc enough to actually write some code that compiles, and if they
>are using a regex then perlre. If the are using references then perlref.
>And so on and so forth.
>
>I don't expect newbies to know everything about the documentation (I haven't
>read it all myself, I have read most of it, but I don't reread it every time
>a new version of perl comes out, so I'm sure there are parts I have never 
>seen). I do expect them to have looked at it and at least read the faq for the
>type of problem they are having, and at least have read the appropriate 
>manuals for the problem they are having, be it perlsyn, perlre, perllol, etc.
>
>I don't know the faqs off by heart, I don't know the documentation off by
>heart. When I respond to a question with RTFM, or perlfaq# : ...? I went and
>looked to find the answer, instead of posting the whole thing I refer them to
>their copy. If it takes me more than 2 minutes to find the answer I either give
>up, search some more, or try to solve the problem myself and post an answer.
>
>If I can find the answer in the docs in 2 minutes then a newbie can find it
>in the docs as well, it might take them 10 minutes, but they should still look.
>By refering them to the docs to find the answer instead of quoting it, they
>are forced to learn how to read the docs on their system (with whatever tool
>perl has for their platform), and they get to see some of the context and 
>maybe learn where to look next time.
>
>Posting the full answer just makes it too easy for people to never learn how
>to read the docs themselves.

It is utter nonsense to suggest that some people might resort to using
the NG as the one and only means of finding answers to questions.

>
>>
>>>
>>>$$ It may irritate (some of) the experts who use this NG when newbies
>>>$$ post question which are so trivial and obvious and "uninteresting"
>>>$$ (...to quote one of the many condescending replies to myself a while
>>>$$ back) ... but I have to say that I am EQUALLY irritated by a response
>>>$$ which says nothing more that 'RTFM' (...especially when accompanied
>>>$$ by a hint of sarcasm).
>>>$$ I say: if you dont have anything more useful to say than this, then
>>>$$ DONT BOTHER SAYING ANYTHING!
>>>
>>>That doesn't help, does it? RTFM points someone to the manual, saying
>>>"what you ask is in the manual". Being silent doesn't help the person
>>>asking the question. 
>>
>>No ... nor does RTFM in my opinion. Well, it may help those who are so
>>dumb that they dont realize that documentation exists or that the
>>documentation may provide an answer to their problem ... but I suspect
>>that most newbies arent so dumb.
>
>I suspect that most of the people that ask a FAQ have never actually read the
>answer to that particular FAQ, otherwise they wouldn't ask.
>
>I have no problem with people asking for clarification of the documentation.
>If they know where to look for the answer but don't understand that answer then
>they should say where they looked to save me the effort of finding it myself.
>
>Being silent might work, as people would go away after not getting answers for
>a while. However, that isn't what happens someone will answer the question with
>their version of an answer, which is incorrect in some subtle way. This demands
>a reply to correct the error. Better to just post a pointer to the answer so
>that people can go and look themselves and find the correct answer.
>

---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).


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

Date: Wed, 03 Feb 1999 09:01:17 -0500
From: Jay Flaherty <fty@utk.edu>
To: Bill Moseley <moseley@best.com>
Subject: Re: Anyone familar with CGI.pm internals?
Message-Id: <36B856AD.30146E1E@utk.edu>

Bill Moseley wrote:
> 
> Nope.  I'm not using two CGI objects, nor am I using readparse.
> 
> use CGI qw/:standard :html3/;       # Well, because this is a CGI script

This is the function oriented approach. i.e. , it creates the object for
you and allows you to do things like:

#!/usr/local/bin/perl -w
use strict;
use CGI qw/:standard :html3/;
print header, start_html('A test program'),
h1('Welcome to my test program'),
hr,
"Welcome to my simple test program",
end_html;
exit;
__END__

> my $Query = new CGI;                # Create form object

This is the object oriented approach. if you want to use this then the
script above would look like this:

#!/usr/local/bin/perl -w
use strict;
use CGI;
my $q = new CGI;
print $q->header, $q->start_html('A test program'),
$q->h1('Welcome to my test program'),
$q->hr,
"Welcome to my simple test program",
$q->end_html;
exit;
__END__

You don't need both. Use one way or the other. In the function oriented
way you have to import the functions you need into your namespace
explicitly (i.e. :standard). The OO way you use method calls.

Jay


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

Date: Wed, 03 Feb 1999 13:49:12 +0100
From: Kai Krebber <Kai.Krebber@syseca.de>
To: stefaan.onderbeke@alcatel.be
Subject: Re: Apache module to do Authentication/Authorization against the NAB  (Name and Address Book) of Lotus Notes/Domino.
Message-Id: <36B845C6.A725FC90@syseca.de>

Good News: It's possible (we're doing it)!
Bad news: As far as I know, there's no out-of-the-box-module available for
it. We took the mod_ldap and modified it a bit to do md5
password-encryption.
Then we wrote an agent for Domino to use the same algorithm. So if now
somebody accesses our apache, the apache prompts for the login-name and
password, sends the login as CN to domino and get's the scrambled password
back, if domino finds this user and he / she has the intranet /
internetpassword set.
Then it scrambles the password typed in by the user and compares the
cyphers. If the are the same, access is granted.

Kai Krebber

Stefaan Onderbeke schrieb:

> Hi,
>
> I searched the WEB but I could not fined an answer on the following
> question :
>
> Does somebody know if following module is available :
>
> Apache module to do Authentication/Authorization against the NAB (Name
> and Address Book) of Lotus Notes/Domino.
>
> Or if this is possible and how this can be done ?
>
> Thanks in advance,
>
> Stefaan Onderbeke



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

Date: Wed, 03 Feb 1999 14:18:03 GMT
From: droby@copyright.com
Subject: Re: are regular expression rationaly designed ?
Message-Id: <799lqj$d5i$1@nnrp1.dejanews.com>

In article <797j52$6uc$1@mathserv.mps.ohio-state.edu>,
  ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to Eric Bohlman
> <ebohlman@netcom.com>],
> who wrote in article <ebohlmanF6JJ04.HE9@netcom.com>:
> > olivier_pelletier@my-dejanews.com wrote:
> > : I would like to know if there is a theory hidden behind regular expression
> > : matching ?
> >
> > Yes, the theory of finite automata.
>
> Which has practically nothing to do with *Perl* regular expressions.
>

Perhaps we should call them something else?  It would be nice if "regular
expression" could continue to mean what it means.

--
Don Roby

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 03 Feb 1999 05:28:43 -0800
From: Richard_G_Hall@yahoo.com (Richard G. Hall)
Subject: awk in perl
Message-Id: <faYt2.280$t5.2468260@WReNphoon2>

Hi,

I have a file containing approx. 1000 emails and I'm
trying to extract a singular field from each email.

extract of one of the emails:

-----------------
SQL> update hosts set
SQL> MODEL = 'Ultra-2',
151 = MODEL = Ultra-2
SQL> CPU_MHZ = '168',
151 = CPU_MHZ = 168
SQL> NOS_CPU = '1',
151 = NOS_CPU = 1
SQL> OS_VERSION = '2.5.1'
SQL> where INTERNAL_HOST_NO = '151'
INTERNAL_HOST_NO = 151
SQL> /
-------------

What I want to achieve is storing into an array ALL the
INTERNAL_HOST_NO's.
I.e. 151 152 153 154 2309 4 ....

In ksh I might do something like:
grep ^INTERNAL_HOST_NO ${INFILE} | awk '{print $2}'
to gain the value but I'd like to learn how to do it in
perl.

any suggestions?

many thanks







*** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ***


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

Date: 03 Feb 1999 15:04:32 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Richard_G_Hall@yahoo.com (Richard G. Hall)
Subject: Re: awk in perl
Message-Id: <m3hft3y45r.fsf@joshua.panix.com>

Richard_G_Hall@yahoo.com (Richard G. Hall) writes:

> In ksh I might do something like:
> grep ^INTERNAL_HOST_NO ${INFILE} | awk '{print $2}'
> to gain the value but I'd like to learn how to do it in
> perl.

I suggest you immediately buy the O'Reilly book _Learning Perl_, which
will lead you to a solution to this problem within a few hours of
study.  To whet your appetite:

   #!/usr/bin/perl -wn
   /^INTERNAL_HOST_NO\s*=\s*(\d+)/ && push @hosts, $1;
   END { print map "$_\n", @hosts }

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Thu, 4 Feb 1999 23:38:44 +0800
From: "john" <john@mediamanager.com.sg>
Subject: Calling a data from the database to the html page
Message-Id: <36b94e2a.0@news.smartnet.com.sg>

Hi,

I am working on a web based project where by I need to use Perl / CGI or
Visual Basic to create a script.

The script should call the database automatically at every 1 minute interval
and get the banner (advertisement banner) from the database (access or
anyother db) and put the banner on the HTML page at the client side. If
anyone has done this then your help in doing this would be much appreciated.

I hope that you could respond to this asap. Since I have only 3 days to
complete the project and I am new to Perl nor have used VB to code CGI
scripting.

Thanking you and awaiting for your early response and solution with the
script..

John Francis





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

Date: 03 Feb 1999 14:43:29 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Can't coerce array into hash
Message-Id: <m3n22vy54u.fsf@joshua.panix.com>

moseley@best.com (Bill Moseley) writes:

> [Tue Feb 2 20:53:20 1999] admin5.cgi: Can't coerce array into hash
> at (eval 23) line 23.
      ^^^^ ^^
The error is not happening at the line you excerpt below.  It's
happening in some eval()ed code.

>  $Location_Rec->{-LABELS} = \@text_labels;  # <--- this is it

Yes, Now $Location_Rec->{-LABELS} contains an array ref.  Later in
your program, you're passing $LocationRec to some function that
expects a hash ref to be associated with the -LABELS key.

What's especially strange is that nowhere in your posted code do you
actually every do anything with the -LABELS field.  I don't think that 
your posted code is actually the code you're running.

Have you stepped through the program with the debugger?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Wed, 3 Feb 1999 06:44:16 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: Can't coerce array into hash
Message-Id: <MPG.112200965b1fa00e98969f@nntp1.ba.best.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

Thanks for the reply:

In article <m3n22vy54u.fsf@joshua.panix.com>, jdf@pobox.com says...
> moseley@best.com (Bill Moseley) writes:
> 
> > [Tue Feb 2 20:53:20 1999] admin5.cgi: Can't coerce array into hash
> > at (eval 23) line 23.
>       ^^^^ ^^
> The error is not happening at the line you excerpt below.  It's
> happening in some eval()ed code.

I don't have a single eval in admin5.cgi.  Maybe in another module, but 
line 23 in admin5.cgi is right in the middle of a =head1...=cut comment 
section.  And as I reported, commenting out that one single line, or 
replacing it with the examples I showed made the error go away.  


> 
> >  $Location_Rec->{-LABELS} = \@text_labels;  # <--- this is it
> 
> Yes, Now $Location_Rec->{-LABELS} contains an array ref.  Later in
> your program, you're passing $LocationRec to some function that
> expects a hash ref to be associated with the -LABELS key.
> What's especially strange is that nowhere in your posted code do you
> actually every do anything with the -LABELS field.  I don't think that 
> your posted code is actually the code you're running.

The two subs posted are the exact code I'm running.

Here's the only place it is being used (inside a here doc)

{\$Query->popup_menu(-name=>'location',
                     -default=>$rec->{'location'},
                     -values=>$Location_Rec->{'-VALUES'},
                     -labels=>$Location_Rec->{'-LABELS'},
                    )}

> Have you stepped through the program with the debugger?

Yes.  That's how I found out where the actual error is happening.

If I were programming C or Pascal, I'd guess that I was writing over a 
pointer, overwriting a string, or some such thing to get an error that 
doesn't make sense (yet...)

All very odd.

-- 
Bill Moseley mailto:moseley@best.com


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

Date: 3 Feb 1999 15:07:49 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Re: Catching TSTP (OS, Perl, or Programmer bug?)
Message-Id: <799oo5$t8t$1@news1.bu.edu>

Following up my own post...

It appears to be a "feature" of Perl 5.005_02, having to with
either in the way it was compiled or some change in the
behavior of signals in 5.005 that I'm unaware of.  Switching
back to 5.004 solved all my problems.

-----------------+----------------------------------------
  John Siracusa  | If you only have a hammer, you tend to
 macintsh@bu.edu | see every problem as a nail. -- Maslow


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

Date: Wed, 03 Feb 1999 13:24:04 GMT
From: nite_eagle@hotmail.com
Subject: Re: DBI
Message-Id: <799ilc$aa0$1@nnrp1.dejanews.com>

If you have ActiveState Perl Build 500+, you can use the ppm to download and
install the package. See the docs as I have a firewall that refuses to let
ppm do its thing. I go directly to http://www.activestate.com/packages/zips/
and get the zipped package and use ppm to install it. See the readme in the
zipped package.

Norman
In article <FJpPGCASZut2EwJ7@beausys.demon.co.uk>,
  Andrew Fry <andrewf@beausys.demon.co.uk> wrote:
> I can (and do) use Perl under UnixWare 7.0.1, UnixWare 2.1.3 and Win95
> (ActiveState ActivePerl), and I am trying to get to grips with DBI...
> but it appears that none of these Perl packages has the DBI module(s).
> Is it possible to obtain the DBI module(s) from somewhere and then just
> incorporate them into these Perl packages (by some means) ?
>
> Any (helpful) comments appreciated.
>
> ---
> Andrew Fry
> "Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 03 Feb 1999 14:00:05 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: END blocks for subs?
Message-Id: <799kp4$iq2$2@news.rz.uni-karlsruhe.de>

bart.lateur@skynet.be (Bart Lateur) wrote:
>Marc Haber wrote:
>>This doesn't look very perlish. Especially taking care about the file
>>being closed in the second unless statement doesn't strike me as being
>>a perlism.
>
>In general, you could create a local filehandle (either by a typeglob or
>through the filehandle module). The filehandle would then be closed when
>exiting the sub, automatically.

Actually, I like that idea. Thanks.

>But for this specific case, this looks like poor program design.

ack.

>If
>you're going to ignore the file, then why are you opening it? You should
>do the file type test BEFORE opening it, and then you have no problem.

That project is currently in a state where it has been syntactically
converted from C but no semantic corrections have been made. I don't
have a single idea why the original autor used fstat instead of stat.
Maybe he wanted to get rid of some race conditions (stating one file
but opening a different one).

If I first open the file and then stat the file handle, I am sure that
I get the statistics of the file I have opened [1]

Greetings
Marc

[1] not sure about that with perl, though

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: Wed, 3 Feb 1999 14:28:26 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: END blocks for subs?
Message-Id: <F6L1JE.2t9@world.std.com>

Marc.Haber-usenet@gmx.de (Marc Haber) writes:

> If this were a standalone program, I'd establish an END
>block to close the file after closing. Do I have such a mechanism
>available for subs too?

One thing to keep in mind is perl's garbage collection feature. A
simple "local(*FH)" will cause the filehandle to go out of scope at
the end of the function, and so be implicitly closed.

I've heard that the AtExit module
<URL:http://www.perl.com/CPAN/authors/Brad_Appleton/AtExit-2.01.tar.gz>
now allows lexically scoped exit routines as well as the C style
atexit() handling. That might be what you are looking for.
-- 
Andrew Langmead


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

Date: 3 Feb 1999 15:35:23 GMT
From: dowatdpg1@aol.com (DOWatDPG1)
Subject: Re: Good CGI Book
Message-Id: <19990203103523.29027.00000074@ng-fi1.aol.com>

Hi there:

My favorite is "GGI Programming with Perl 5 in a week."  It has gotten me
through some HORRIBLE rough spots :)  It has both simple and advanced topics.

ISBN:  1-57521-196-3, Sams.Net Publishing.

DowWOW
http://www.daydreamergardens.com
Ponder Your Programming Pondside.
Dow WOW, Daydreamer Aquatic Gardens.
http://www.daydreamergardens.com


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

Date: 3 Feb 1999 13:26:12 GMT
From: worldmall@aol.com (Worldmall)
Subject: How use cookies to track referrals?
Message-Id: <19990203082612.00358.00000034@ng-ch1.aol.com>

Do you have experience, or know someone who has experience, at setting up
cookies for referral tracking purposes?

I've been using cookies with great success and all of a sudden run into a
situation where cookies refuse to work on one site I've installed the cookies
to :(

I've tested the cookie solutions found at http://www.virtualpromote.com:
VirtualPROMOTE Gazette - Issue #49 (xssi cookies)
VirtualPROMOTE Gazette - Issue #53 (asp cookies)
VirtualPROMOTE Gazette - Issue #46  (ssi cookies)
VirtualPROMOTE Gazette - Issue #45  (cookies placed within the html page)

 ...and still no success. If you can help please contact me. I may be too close
to
the forest to see the trees.

Thanks!

Andre'



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

Date: 03 Feb 1999 14:49:48 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: worldmall@aol.com (Worldmall)
Subject: Re: How use cookies to track referrals?
Message-Id: <m3lnify4ub.fsf@joshua.panix.com>

worldmall@aol.com (Worldmall) writes:

> Do you have experience, or know someone who has experience, at
> setting up cookies for referral tracking purposes?

You'll find many people with that experience in one of the newsgroups
that deals with cookies, cgi, web authoring, etc.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Wed, 03 Feb 1999 10:43:43 -0500
From: Oleg Waisberg <Oleg_Waisberg@Health.Lmig.ca>
Subject: Installation Problem with IO module
Message-Id: <36B86EAF.BA19DD0F@Health.Lmig.ca>

Hi ,

Have anyone come across to some problems while trying to install
IO module ? I've tried to make this module on HP-UX 10.20 Perl 5.003
and got following output.
Any ideas what's wrong here ?

Thanks in advance.
Sincerely,
Oleg Waisberg

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

# make test
        LD_RUN_PATH="" ld -o ./blib/arch/auto/IO/IO.sl -b -s -a shared
IO.o  poll.o
        chmod 755 ./blib/arch/auto/IO/IO.sl
        cp IO.bs ./blib/arch/auto/IO/IO.bs
        chmod 644 ./blib/arch/auto/IO/IO.bs
        PERL_DL_NONLAZY=1 /usr/contrib/bin/perl -I./blib/arch
-I./blib/lib -I/opt/perl5/lib/PA-RISC1.1/5.003 -I/opt/perl5/lib -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t

t/io_const..........Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at t/io_const.t line 20.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_dir............ok
t/io_dup............Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at t/io_dup.t line 21.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_multihomed.....Can't load
'/opt/perl5/lib/PA-RISC1.1/5.003/auto/Socket/Socket.sl' for module
Socket: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at /opt/perl5/lib/Socket.pm line 272
BEGIN failed--compilation aborted at t/io_multihomed.t line 32.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_pipe...........Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at blib/lib/IO/Pipe.pm line 11.
BEGIN failed--compilation aborted at t/io_pipe.t line 21.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_poll...........Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at t/io_poll.t line 15.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_sel............ok
t/io_sock...........Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at blib/lib/IO/Socket.pm line 11.
BEGIN failed--compilation aborted at t/io_sock.t line 26.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_tell...........Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at blib/lib/IO/Seekable.pm line 51.
BEGIN failed--compilation aborted at blib/lib/IO/File.pm line 112.
BEGIN failed--compilation aborted at t/io_tell.t line 27.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_udp............Can't load
'/opt/perl5/lib/PA-RISC1.1/5.003/auto/Socket/Socket.sl' for module
Socket: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.
 at /opt/perl5/lib/Socket.pm line 272
BEGIN failed--compilation aborted at t/io_udp.t line 35.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_unix...........Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at blib/lib/IO/Socket.pm line 11.
BEGIN failed--compilation aborted at t/io_unix.t line 38.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
t/io_xs.............Can't load './blib/arch/auto/IO/IO.sl' for module
IO: Unresolved external at /opt/perl5/lib/DynaLoader.pm line 140.

 at blib/lib/IO.pm line 13
BEGIN failed--compilation aborted at blib/lib/IO/Handle.pm line 241.
BEGIN failed--compilation aborted at blib/lib/IO/Seekable.pm line 51.
BEGIN failed--compilation aborted at blib/lib/IO/File.pm line 112.
BEGIN failed--compilation aborted at t/io_xs.t line 21.
FAILED before any test output arrived
        Test returned status 215 (wstat 55040)
Failed 10/12 test scripts, 16.67% okay. 0/21 subtests failed, 100.00%
okay.
*** Error exit code 215

Stop.






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

Date: Wed, 3 Feb 1999 07:31:36 -0600
From: "Ban Spam Now" <no_spam@no_spam.com>
Subject: Re: Is there an Interactive Debugger for Perl?
Message-Id: <799j8p$b6g@sjx-ixn6.ix.netcom.com>

Would this be Unix based? I am running on Unix, sorry forgot to tell you.

Tad McClellan wrote in message ...
>Ban Spam Now (no_spam@no_spam.com) wrote:
>: I am learning Perl and am used to languages which have an interactive
>: debugger.  At the moment I'm putting print statements everywhere.  Is
there
>: an Interactive Debugger for Perl, or a slicker way than using prints?
>
>
>   perldoc perldebug
>
>
>--
>    Tad McClellan                          SGML Consulting
>    tadmc@metronet.com                     Perl programming
>    Fort Worth, Texas




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

Date: Wed, 03 Feb 1999 15:34:40 GMT
From: richm@ucesucks.rochester.rr.com (Rich)
Subject: Re: Is there an Interactive Debugger for Perl?
Message-Id: <slrn7bgr7h.i9h.richm@ll.aa2ys.ampr.org>

On Wed, 3 Feb 1999 07:31:36 -0600, Ban Spam Now <no_spam@no_spam.com> wrote:
>Would this be Unix based? I am running on Unix, sorry forgot to tell you.

   Well, you could actually read the documentation that you were pointed
to, which would answer your question in half a second....

- Rich

--
Rich Mulvey                                         
http://mulvey.dyndns.com
Amateur Radio: aa2ys@wb2wxq.#wny.ny.usa


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

Date: 03 Feb 1999 13:03:40 +0000
From: Tony Bass <aeb@saltfarm.bt.co.uk>
Subject: Re: local($_) - why not "my"?
Message-Id: <rglnifwser.fsf@calf.saltfarm.bt.co.uk>

Ala Qumsieh <aqumsieh@matrox.com> writes:

> rjk@linguist.dartmouth.edu (Ronald J Kimball) writes:

> > In perl4, 'my $_;' is a syntax error.

> > The original poster was correct; "currently" means that in some later
> > version of Perl this could change.  But right now, all special variables
> > are stored in the symbol table.  And because they're special, they can't
> > just be yanked out of the symbol table to allow for lexical special
> > variables.

> > I think "currently" is sort of the opposite of "deprecated"; this
> > feature will be added in some future, unspecified version of Perl.  :-0

> But won't that break any existing code?
> I can't really think of a case where declaring $_ (or any other
> special variable) as lexical would break something, but maybe someone
> else can. After all, this is a major change in the nature of the Perl
> special variables. Furthermore, "if it ain't broke, why fix it?"
[...]


On one occasion I was passing ARGV as a filehandle parameter,
something likely to break under more lexical treatment, but I am
doubtful how far the use was valid in any case.  I expected it to
work, as indeed it does (5.001), but the documentation does not
directly justify it.

  package Vnetlist;

  sub netread {
   my ($self, $fh, $info) = @_;
   ... <$fh> ...
  }

  ...

  sub netfile {
   my ($self, $filename, $info) = @_;
   local *FH;
   my $fh = \*FH;
   if (open($fh, $filename)) {
    return Vnetlist->netread($fh, $info)->simplify()->netmain();
    }
   else ...
  }

  package main;

  my $netlist = Vnetlist->netread(\*ARGV, Vinfo->new());

I expect I could find some other way of doing this if I had to, though
it would need a different interface for the input methods.


-- 
# A E Bass                                      Tel: (01473) 645305
# MLB 3/19, BT Laboratories                     e-mail: aeb@saltfarm.bt.co.uk
# Martlesham Heath, Ipswich, Suffolk, IP5 3RE   Do not rely on From: line
#                                               Opinions are my own


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

Date: Wed, 03 Feb 1999 14:26:12 GMT
From: "Webdude" <webdude@usit.net>
Subject: LWP Question
Message-Id: <80Zt2.20$Al6.20504@news1.usit.net>

I am running a simple script that goes and gets info from a webpage and
post's in via SSI to my page. The script looks for the info by using key
words
if($line =~ /Past Scores/){    $start = 1;  }
Past Scores being the keyword here..What I wanted to know is if anyone here
knew of a way for it to grab the info by line number instead of by keyword?





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

Date: Wed, 3 Feb 1999 08:23:41 -0600
From: "Lee Ramirez" <lee.ramirez@westgroup.com>
Subject: Net::Telnet -- how do I telnet from a telnet session?
Message-Id: <36b85abc.0@wwwproxy3.westgroup.com>

Hi,

I'm trying to telnet to a security router to get access to other routers,
then telnet to those other routers from the security router (only security
router has telnet rights) .  I can perform a single telnet session using the
Net::Telnet module, but how do I telnet from the initial telnet session.

I thought of using two telnet objects, but both are launched from the Linux
OS, and I need the second session to be launched from the first session.

I can telnet to the second router by issuing the $host->cmd(address) line,
but then I lose control as the object is still considered by Perl as part of
the first telnet session.  At least that is what I suspect.

Ultimately I want to download router configurations via the second telnet
session.

Has anyone ever done anything like this?  Any ideas?

Thanks,

Lee





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

Date: Wed, 03 Feb 1999 12:02:51 GMT
From: Tim Haynes <thaynes@openlinksw.co.uk>
Subject: Re: Oracle from Linux
Message-Id: <799dt8$6m0$1@nnrp1.dejanews.com>

Hi,

To connect from a Linux machine you don't need the 30-day evaluation version
(these are our Lite drivers, which require a windows client), but the
non-expiry 2-user 10-connection multi-tier drivers. With these you can
specify a linux client and NT/Oracle server, download and connect straight
away.

Best regards,

Tim Haynes
Support Consultant
OpenLink Software Web: <http://www.openlinksw.co.uk/>
Universal Database Connectivity Technology Providers



In article <36A79030.C60@gecm.com>,
  jim.michael@gecm.com wrote:
> Rolf Howarth wrote:
> >
> > What's the easiest way to connect to an Oracle database (on NT) from
> > Perl (on Linux)? I've got the DBD::Oracle module but this requires Pro*C
> <deletia>
> > It can't be very difficult to design or implement a simple, *open*
> > database access protocol that lets you talk ODBC (or JDBC) down a TCP/IP
>
> OpenLink has ODBC drivers for Linux. See http://www.openlinksw.com/ for
> a compatibility matrix across RDBMS/client platforms. Last time I looked
> there was a free 30 day eval you could download for performance testing.
> HTH.
>
> Cheers,
>
> Jim
> --
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 3 Feb 1999 08:49:28 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl Criticism [summary]
Message-Id: <oln997.rk.ln@magna.metronet.com>

birgitt@my-dejanews.com wrote:


: Please, can you tell me what a thread ends with ?


   It is _supposed_ to end whenever 'Hitler' is mentioned.

   It isn't working properly here...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 3 Feb 1999 15:02:36 GMT
From: mjd440@aol.com (Mjd440)
Subject: Perl NT login scripts help...
Message-Id: <19990203100236.25633.00000092@ng-fs1.aol.com>

Hi Folks,

I have a Perl NT login script that runs fine on a few machines (Perl
installed), but I can't get the script to run if the client doesn't have Perl
installed locally.   I'm attempting to have the client machines attach to the
Perl share on the server and run the script, but it seems to have a problem
trying sorting out the "Use Win32;" line in the script.  I've mapped the Perl
share to  drive letter, P:, then modified the path statement for the client
machines to include P:\bin, P:\lib and it still can't locate Win32.pm.  Any
idea what gives?   Thanks in advance.

-- Mark


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

Date: Wed, 3 Feb 1999 06:31:22 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: Problems with Content-Type Header in PERL/CGI
Message-Id: <MPG.1121fd92883f4d5198969e@nntp1.ba.best.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <MPG.11218bd7a4a8e522989681@news.cyberenet.net>, 
lynchman@cyberenet.net says...
> I am rather new at CGI PERL, so any help would be appreciated.
> I am trying to have the CGI return both text AND 
> image files to the browser. 
> ...
> Content-Type: text/HTML
> 
> and I can get graphics to display if I do:
> Content-Type: image/jpeg

Unless I misunderstand your questions or you are actually generating the 
jpeg binary file within your program, I think you want:

  print '<IMG SRC="/images/image.jpg" alt="Cool image">';

And let the browser and server do what's they are designed to do.


-- 
Bill Moseley mailto:moseley@best.com


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

Date: Wed, 03 Feb 1999 15:42:15 +0100
From: hh@ecce-terram.de (herwig)
Subject: require does not work nondeterministically
Message-Id: <799n8o$sub@news.Informatik.Uni-Oldenburg.DE>

Experts,

system: Linux (SUSE 6.0, brand new), perl, version 5.005_02 built for
i586-linux. Apache 1.3.3

I'm creating a cgi-script which does a "require" at the beginning.
Strangely this require does not work about half the time! It always
returns 1 (success), but sometimes the identifiers which it should include
are not defined. This is the strangest thing I've seen in a long time.
(Additionally, it doesn't seem to use @INC, I had to use absolute path
names):

my $foo = require "/usr/local/httpd/cgi-bin/wlw/statistik/utils.pl";
my $bar = 1;
$bar = 0 unless defined( &datumsdaten ); 
print "Content-type: text/html\r\n\r\n$foo $bar\n"; exit 0;


The routine "&datumsdaten" is defined in utils.pl.

The script returns "1 0" most of the time, sometimes "1 1".

Is "require" broken in 5.005_02 ?

Herwig

-- 
ECCE TERRAM GmbH                        Dr. Herwig Henseler
Heinrichstrasse 18d                     Tel. 0441 / 500 12-0
26131 Oldenburg                         Fax. 0441 / 500 12-29


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

Date: Wed, 03 Feb 1999 11:54:02 GMT
From: lou@visca.com (Lou Hevly)
Subject: Re: Soft reference question
Message-Id: <36b83152.9555391@news.uni-stuttgart.de>

Ala Qumsieh <aqumsieh@matrox.com> wrote:

<snip>

>> open (UPLOAD, ">$updir") or die $!;
>> my ($Buffer);
>> while (read($upload,$Buffer,8192)) {
>             ^^^^^^^^^
>
>Your bug is here .. the first argument for read is a filehandle. You
>are using a variable. Although it is possible to use a variable as a
>filehandle, strict will not allow you to do that. Anyway, your script
>does not work even if you don't use strict because the read will fail.

I hate to contradict someone who knows more than I'll probably ever
know about Perl, but the fact is the script does work. However, it
won't work if I try to use a filehandle in place of the variable. To
recapitulate:

my $file = $q->param('file');
(my $filename = $file) =~ s/^.*?([^\\\/]+)$/$1/;
my $upload_file = "$upload_dir/$filename";

open (UPLOAD, ">$upload_file") or die $!;
my ($buffer);
while (read($file,$buffer,8192)) {
   print UPLOAD $buffer;
}

CGI.pm, which I've called from an enctype="multipart/form-data" form,
reads and parses a filename from my PC (here in Spain). I tried doing
'open, FILE $file or die $!', but that, of course, dies, because it
tries to open $file on my server (in the States), where the script is
being run from.

Can you think of any other way to do an upload of this type? For now
I'm doing:
no strict 'refs';
while (read($file,$buffer,8192)) {
   print UPLOAD $buffer;
}
use strict;

But I'd rather find a more legal way.

BTW, I posted a "thanks" message elsewhere with what I thought was a
workable upload script, but I was mistaken.

Again, thanks.

Lou Hevly
http://www.visca.com


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

Date: Wed, 03 Feb 1999 14:21:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <36b95b3b.5962493@news.skynet.be>

Andrew M. Langmead wrote:

>Its rare that a question is so intricate that it can't be edited. Its
>even rarer that the answer to that question will be short.

See Abigail's posts for examples.

;-)

	Bart.


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

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

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

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4814
**************************************

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