[7718] in Perl-Users-Digest
Perl-Users Digest, Issue: 1344 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 19 20:17:37 1997
Date: Wed, 19 Nov 97 17:00:29 -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, 19 Nov 1997 Volume: 8 Number: 1344
Today's topics:
Re: "perl aware" vi editor? <dickey@clark.net>
Re: @array=<STDIN> and ^D <camerond@mail.uca.edu>
Active Perl Scripting diff Perl <rchen@super.zippo.com>
ANNOUNCE: libnet-1.0602 <gbarr@pobox.com>
ANNOUNCE: MailTools-1.10 <gbarr@pobox.com>
ANNOUNCE: Netscape httpd/Perl Integration <bsugars@canoe.ca>
ANNOUNCE: Netscape-Cache-0.40 (Slaven Rezic)
ANNOUNCE: Tk-Getopt-0.33 (Slaven Rezic)
Re: Anyone have a Pod module that syntax checks (and pe (Brad Appleton)
Can't 'make' modules. "bash: make: command not found" (Faust Gertz)
Re: Can't 'make' modules. "bash: make: command not fou <zenin@best.com>
Re: CGI & HTTP Problems. (brian d foy)
Re: cgi newbie stuck... (brian d foy)
Re: exclusive file rights (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
HELP - HOW TO LOCK FILES ACROSS A NETWORK !!!! <sramani@wss.dsccc.com>
Re: Howto debug an extension module (Andrew Torda)
Re: ignore above... (Jeff Stampes)
Re: modules, ignoring Tom Phoenix <merlyn@stonehenge.com>
Re: modules, ignoring Tom Phoenix (brian d foy)
Re: Newbie help.. (brian d foy)
Re: passing hash references to subs <merlyn@stonehenge.com>
Re: Q: How many elements in a %HASH ? <merlyn@stonehenge.com>
Re: Returning information from an nslookup ?? <libeson@pdb.pdb.bnl.gov>
split with capturing parantheses in patte (Benjamin Trott)
Re: system vs. backtics. What difference? <w.stanton@auckland.ac.nz>
Unix Counter Script (Chizl)
Re: What is going on here? <merlyn@stonehenge.com>
Re: Y2000 Issues in PERL CGI scripts? <merlyn@stonehenge.com>
Re: Year2000 problem with localtime(); <merlyn@stonehenge.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Nov 1997 22:22:39 GMT
From: "T.E.Dickey" <dickey@clark.net>
Subject: Re: "perl aware" vi editor?
Message-Id: <64vorf$kak@clarknet.clark.net>
Patrick <patrickq@hotmail.com> wrote:
: VIM (VI iMproved) version 5 is in both categories. Currently in alpha
: but very close to beta, and is ported to most all platforms. Also,
: VIM is to replace nvi as the freeBSD vi editor (?)
well, that's a shame. nvi is a much better piece of work.
--
Thomas E. Dickey
dickey@clark.net
http://www.clark.net/pub/dickey
------------------------------
Date: Wed, 19 Nov 1997 16:42:24 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: @array=<STDIN> and ^D
Message-Id: <34736B50.C88F89AF@mail.uca.edu>
Mike Heins wrote:
>
> Skip Egley (egley@albany.net) wrote:
> : I'm just learning perl. According to my book, I can do:
> : @array = <STDIN>;
> [snip]
> This is mostly correct, but it doesn't depend on a ^D. It depends
> on an EOF, or end of file. That is sometimes a ^Z on DOS/Windows --
> but if you are running Perl/Win95 from the command line, you will
> typically
> have to supply a ^D\r\n (<CTRL-D><CR><LF>) to finish the process. If
> the
> source of the STDIN was a pipe, the end of the input should
> supply the EOF.
^Z works fine when the keyboard is STDIN for me.
Cameron Dorey
camerond@mail.uca.edu
------------------------------
Date: Wed, 19 Nov 1997 13:02:38 -0800
From: "Ronald Chen" <rchen@super.zippo.com>
Subject: Active Perl Scripting diff Perl
Message-Id: <64vk84$8v7@snews1.zippo.com>
Is there a list of differences between Perl and the active script version of
the perl?
Also, is there a way to execute a command line command from active perl
script? For example,
[using it as cgi will work]
$command = "dir";
$ret = `$command`;
print $ret;
[using it as activeScript won't work]
$command = "dir";
$ret = `$command`;
$Response->write($ret);
------------------------------
Date: 20 Nov 1997 00:19:47 GMT
From: Graham Barr <gbarr@pobox.com>
Subject: ANNOUNCE: libnet-1.0602
Message-Id: <64vvn3$6tv$1@news1.teleport.com>
I have just uploaded to PAUSE a new release of the libnet distribution,
it should appear on CPAN mirror sites soon
If you do not want to wait for CPAN to mirror it then it is also
avaliable from
http://www.connect.net/gbarr/cpan/libnet-1.0602.tar.gz
This patch release contains a lot of fixes from 1.06
Please also read the RADME.config file in the distribution.
libnet is a collection of perl modules which encapsulate the usage
of various protocols used in the internet community. These include
Net::FTP (RFC959)
Net::SMTP (RFC821)
Net::Netrc
Net::Cmd
Net::Domain
Net::Telnet (RFC854)
Net::Time (RFC867 & RFC868)
Net::NNTP (RFC977)
Net::POP3 (RFC1939)
Net::SNPP (RFC1861)
Net::PH
Net::Config
To install libnet you ***MUST*** have the following modules installed
IO::Socket
This release contains the following changes to the previous release
*** Patch 1.0602
Mon Nov 17 1997 <gbarr@pobox.com> (Graham Barr)
Makefile.PL
- change to code for creating Net::Config
Net::FTP::A
- Change to write() to ensure whole packet is sent
- Documentation correction to dir() and ls()
Net::FTP::dataconn
- Stop abort be called when a write socket is being closed.
Net::NNTP
- Changes to postok logic
Net::PH
- fields() now also returns a reference to an ordered array of tag
names
if called in an array context.
Net::Cmd
- Catch added for SIGPIPE while in ->command()
*** Patch 1.0601
Tue Nov 4 1997 <gbarr@pobox.com> (Graham Barr)
Configure
- Fix croak problem
Net::FTP, Net::NNTP, Net::PH, Net::POP3, Net::SMTP, Net::SNPP
- Fix error cause by calling close method when "unexpected EOF:
has been encountered.
t/require.t
- Remove Net::Telnet test
It should be avaliable on mirror sites soon from
http://www.perl.com/CPAN/authors/Graham_Barr/
Comments are always very welcome.
Copyright 1996 Graham Barr. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Share and Enjoy!
Graham <gbarr@pobox.com>
------------------------------
Date: 20 Nov 1997 00:18:13 GMT
From: Graham Barr <gbarr@pobox.com>
Subject: ANNOUNCE: MailTools-1.10
Message-Id: <64vvk5$6t3$1@news1.teleport.com>
I have just uploaded to PAUSE a new release of the MailTools
distribution.
The MailTools distribution is a set of perl modules related to mail
applications. They allow reading, creation, manipulation and sending
(to some extent) of RFC822 compilant Email messages. The distribution
also contains a module which can parse Email addresses.
This release contains the following Changes
*** Release 1.10
Mail::Field::AddrList, Mail::Filter
- new modules
Mail::Field
- Changes to the way sub-classes are registered and handled.
Mail::Mailer
- Modified code that searches for the executable to run
Mail::Address
- Documentation updates
Mail::Header
- Small tweak to _fold_line for lines that are just shorter than the
fold width, but include whitespace
Mail::Internet
- does not inherit from AutoLoader. Instead AUTOLOAD
is GLOB'd to AutoLoader::AUTOLOAD
Mail::Mailer and Mail::Send
- Modified PODs to reflect that Tim Bunce is not the maintainer.
It should be avaliable on CPAN mirror sites soon.
Comments are always very welcome.
Copyright 1996-7 Graham Barr. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Share and Enjoy!
Graham <gbarr@pobox.com>
------------------------------
Date: 20 Nov 1997 00:20:45 GMT
From: Benjamin Sugars <bsugars@canoe.ca>
Subject: ANNOUNCE: Netscape httpd/Perl Integration
Message-Id: <64vvot$70d$1@news1.teleport.com>
Good Day,
Version 0.10 of nsapi_perl has been added to the CPAN. It is
available as:
file: $CPAN/authors/id/BSUGARS/nsapi_perl-0.10.tar.gz
size: 30228 bytes
md5: 70282a76c378a779cb7b7c685e898f85
nsapi_perl is a set of Netscape Server API functions and Perl
extension modules that (in the spirit of mod_perl for Apache) embed a
Perl interpreter in a Netscape web server. This allows you to program
to the Netscape server API in Perl rather than C.
If you can't wait for it to reach your CPAN mirror, the distribution
is also available from
http://interact.canoe.ca/~bsugars/nsapi_perl-0.10.tar.gz
I have tried nsapi_perl on 1.x, 2.x, and 3.x servers and it works (but
see the README file for some outstanding issues).
It should be noted that at least one company (www.binevolve.com) has
also embedded a Perl interpreter in Netscape servers, but as far as I
know they don't allow you full Perl access to the API. Besides,
theirs is expensive and closed; nsapi_perl is free and open :-)
I should also note that this is really a developers' release that is
most likely to be of interest to those who wish to contribute to the
project. Help wanted.
-Ben
--
Ben Sugars <bsugars@canoe.ca>
Senior Webmaster,
CANOE Canadian Online Explorer,
http://www.canoe.ca/
------------------------------
Date: 20 Nov 1997 00:18:52 GMT
From: eserte@cs.tu-berlin.de (Slaven Rezic)
Subject: ANNOUNCE: Netscape-Cache-0.40
Message-Id: <64vvlc$6tj$1@news1.teleport.com>
I have uploaded a new release of Netscape-Cache. It's mainly a bug-fix
release.
>From the README file:
Netscape::Cache Module
Netscape::Cache provides access to the information stored in index.db of
Netscape's cache directory. Only Netscape versions 2.x, 3.x and 4.x are
supported (tell me if you want Netscape-1.x support).
This module is inspired by Netscape::History by Neil Bowers and
Richard Taylor.
You need at least perl5.002 and DB_File to run this module. I got success
reports for these platforms:
- Linux-2.0.5
- FreeBSD-2.2.
- Solaris 2.6
Slaven
--
====================== ====================================
eserte@cs.tu-berlin.de ============ http://user.cs.tu-berlin.de/~eserte/
====================== Slaven Rezic ====================================
============
------------------------------
Date: 20 Nov 1997 00:19:05 GMT
From: eserte@cs.tu-berlin.de (Slaven Rezic)
Subject: ANNOUNCE: Tk-Getopt-0.33
Message-Id: <64vvlp$6tn$1@news1.teleport.com>
I uploaded a new release of Tk-Getopt. Here are some changes to the
previous release (0.30):
- optional use of FileDialog widget (subtype => 'file')
- many bug fixes and optimizations
Slaven
--
====================== ====================================
eserte@cs.tu-berlin.de ============ http://user.cs.tu-berlin.de/~eserte/
====================== Slaven Rezic ====================================
============
------------------------------
Date: 20 Nov 1997 00:18:23 GMT
From: appleton@chiefs.northbrook.aieg.mot.com (Brad Appleton)
To: lvirden@cas.org
Subject: Re: Anyone have a Pod module that syntax checks (and perhaps style checks) pods?
Message-Id: <64vvkf$o8m$1@schbbs.mot.com>
In article <64us9q$ddc$1@srv38s4u.cas.org>, lvirden@cas.org writes:
> Anyone have ideas on tools that would aid a developer in developing pods?
Thats exactly what my Pod::Parser module is for. It does all the
parsing of the input for you, but it does not assume any knowledge of
what the valid set of '=xxxx' commands are (so that one could write
a script to provide domain-specific extensions for their own private
needs -- which is something I currently need to do ;-).
However one could easily develop a Pod::List using Pod::Parser. The
current version of Pod::Parser is 1.01 (or is it 1.00) on CPAN. If you
see head or tail of a v1.02, avoid it like the plague, its not
supposed to be there and Im not sure why it exists on a select few
sites, but v1.02 was never released.
Im currently working on the next version of Pod::Parser. I havent
added callbacks yet, but it is working just fine without them.
If you want the latest version under-development for your own
development needs, Ill be happy to supply you with the source
and docs and answer any questions you might have.
Cheers!
--
Brad Appleton <bradapp@enteract.com> | http://www.enteract.com/~bradapp/
"And miles to go before I sleep." | 3500+ WWW links on CS & Sw-Eng
------------------------------
Date: Wed, 19 Nov 1997 22:59:44 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Can't 'make' modules. "bash: make: command not found"
Message-Id: <34746e2c.3712270@news.wwa.com>
I hope someone can help or tell me what to ask my system
administrator. When trying to install various and sundry modules, I
get the following:
> /usr/local/bin/perl5.004 Makefile.PL LIB=/usr/home/fs1/asen/MagicServer/httpd/cgi-bin/perl
Writing Makefile for CGI
> make
bash: make: command not found
Any suggestions?
Thanks in advance.
Faust Gertz
Philosopher at Large
------------------------------
Date: 20 Nov 1997 00:11:50 GMT
From: Zenin <zenin@best.com>
Subject: Re: Can't 'make' modules. "bash: make: command not found"
Message-Id: <879984862.693433@thrush.omix.com>
Faust Gertz <faust@wwa.com> wrote:
: bash: make: command not found
>snip<
What system type? The problem is that either make isn't in
your path, or that it's just not on your system. If you're
on something moronic like a Solaris machine, you probably have
to manually put the ccs directory in your path:
(in Bourne type shells)
PATH=$PATH:/usr/ccs/bin; export PATH
(in C-Shell type shells)
set path=($path /usr/ccs/bin); # Or something like this
--
-Zenin
zenin@best.com
------------------------------
Date: Wed, 19 Nov 1997 19:58:46 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI & HTTP Problems.
Message-Id: <comdog-ya02408000R1911971958460001@news.panix.com>
In article <347309C8.61F@darkwave.org.uk>, Falcon@darkwave.org.uk wrote:
>I've also (just) managed to get a cookie to write....
can we see what this cookie is? perhaps there is a problem with the
way that you set it.
>My problem is this :
>I cannot get the info back in...
it should show up in $ENV{'HTTP_COOKIE'} (unless you have a really wierd
server, in which case you might want to look at all the environment
variables to see what was set).
there are lots of things to do incorrectly, so a bit more information
from you would help to solve the problem. you might also want to read the
cookie info in the CGI Meta FAQ.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 19 Nov 1997 19:49:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: cgi newbie stuck...
Message-Id: <comdog-ya02408000R1911971949410001@news.panix.com>
In article <64uca9$2en$1@newton.pacific.net.sg>, "winston khoo" <flare@mindless.com> wrote:
[follow ups set to a more appropriate newsgroup]
> i'm struck with the following msg appears when i submit the form...
>403 Forbidden
>Your client does not have permission to get URL /cgi/Webimport.pl from this
>server.
this means you aren't allowed to get that resource (just as it says).
now you need to go through all of the things that allow one to get a
resource, and make sure that those things are as they should be.
some of the resources in the CGI Meta FAQ may be of assistance.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 19 Nov 97 18:16:20 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: exclusive file rights
Message-Id: <34737449$10$ofn$mr2ice@speaker>
In <34734bb5.2396616@igate.hst.moc.com>, on 11/19/97 at 08:29 PM,
jzawodn@wcnet.org (Jeremy D. Zawodny) said:
+-----
| But according to the folks on the p5p list, OS/2 at least supports mandatory
| locks. I was under the impression that Perl does (or would in the near
| future) make use of it in flock().
+--->8
OS/2 supports it, EMX (the runtime environment used for Perl) doesn't.
There's an unofficial patch running around which purports to implement flock()
in EMX. And you can get locking in EMX using a variant open routine and (for
record locking) OS/2 family calls (thereby breaking the EMX Perl variant which
runs using EMX/RSX on other PC platforms).
All in all, not an ideal situation.
--
brandon s. allbery [Team OS/2][Linux][JAPH] bsa@void.apk.net
cleveland, ohio mr/2 ice's "rfc guru" :-) KF8NH
"Never piss off a bard, for they are not at all subtle and your name scans to
`Greensleeves'." ---unknown, quoted by Janet D. Miles in alt.callahans
------------------------------
Date: Wed, 19 Nov 1997 16:39:14 -0600
From: Shubha Ramani <sramani@wss.dsccc.com>
Subject: HELP - HOW TO LOCK FILES ACROSS A NETWORK !!!!
Message-Id: <34736A91.387D79CA@wss.dsccc.com>
--------------78A717D75BA7F5055922F47C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Apparently, flock is not the thing to use to lock files across
a network - it doesn't work. So, I tried to use fcntl, which
bombed. How do you use Perl fcntl ? What am I doing wrong ????
Please help !!!!!!!!
(E-mail me directly, please)
Thanks,
Shubha
--
;-) "It's better to have your ear chewed on than to be
sitting outside the ring."
-Scott McNealy, CEO Sun Microsystems
_________________________________________________________________
| Shubha D. Ramani | |
| sramani@wss.dsccc.com | iMTN Development |
| PHONE : 972-477-4069 | DSC Communications |
| LAB : 972-477-8751 | |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--------------78A717D75BA7F5055922F47C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<PRE></PRE>
<PRE>Apparently, flock is not the thing to use to lock files across</PRE>
<PRE>a network - it doesn't work. So, I tried to use fcntl, which</PRE>
<PRE>bombed. How do you use Perl fcntl ? What am I doing wrong ????</PRE>
<PRE></PRE>
<PRE>Please help !!!!!!!!</PRE>
<PRE></PRE>
<PRE>(E-mail me directly, please)</PRE>
<PRE></PRE>
<PRE>Thanks,</PRE>
<PRE></PRE>
<PRE>Shubha</PRE>
<PRE></PRE>
<PRE>--
;-) "It's better to have your ear chewed on than to be
sitting outside the ring."
-Scott McNealy, CEO Sun Microsystems
_________________________________________________________________
| Shubha D. Ramani | |
| sramani@wss.dsccc.com | iMTN Development |
| PHONE : 972-477-4069 | DSC Communications |
| LAB : 972-477-8751 | |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</PRE>
</HTML>
--------------78A717D75BA7F5055922F47C--
------------------------------
Date: 19 Nov 1997 23:09:13 GMT
From: torda@rsc.anu.edu.au (Andrew Torda)
Subject: Re: Howto debug an extension module
Message-Id: <64vrip$nkt$1@clarion.carno.net.au>
Joe Marzot <gmarzot@baynetworks.com> wrote
>
>Does anyone have any cool ideas on how to debug a dynamically loaded
>extension module? Is it enought to have symbols compiled into the
>extension module or must perl have them as well. I hope I don't have to
>compile statically to debug.
Here are two ways which work under solaris or linux, cc or gcc
1.
In your debugger
break XS_DynaLoader_dl_install_xsub
or
stop in XS_DynaLoader_dl_install_xsub
whether you are using dbx or gdb. Under linux type
fin
share
to get to the end of the function and load up the symbol
table. Now you can set a break in your code.
2. In your *.xs file, create a call like
#include <sys/types.h>
#include <signal.h>
void
debug_hook ()
CODE:
kill (getpid(), SIGTRAP);
Now, in your perl script, put in a call to debug_hook().
Run this under the debugger of your choice. When debug_hook()
is called, the signal go off and the debugger will stop.
The symbol table is loaded, you can set break points in
sensible places and you can continue from that point.
Hope this helps.
-Andrew
--
This posting is not merely my opinion. It is the official position
of my employer, the Australian National University.
Andrew Torda, Research School of Chemistry, ANU, ACT 0200, Australia
andrew.torda@anu.edu.au http://www.rsc.anu.edu.au/~torda
------------------------------
Date: 19 Nov 1997 23:34:46 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: ignore above...
Message-Id: <64vt2m$jd$1@neocad.com>
winston khoo (flare@mindless.com) wrote:
: 500 Server Error
See http://www.perl.com/CPAN-local/doc/FAQs/cgi/perl-cgi-faq.html
Q3.4: Why am I getting the "Server: Error 500" message?
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: 19 Nov 1997 15:55:00 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>, rootbeer@teleport.com
Subject: Re: modules, ignoring Tom Phoenix
Message-Id: <8cvhxoa3zv.fsf@gadget.cscaper.com>
>>>>> "EtB" == Eli the Bearded <usenet-tag@qz.little-neck.ny.us> writes:
EtB> brain d foy, I happen to know, has secured a copy of the TomPhoenix.pm
EtB> script and done some work chaning the style of the replies. You probably
EtB> noticed "he" beat "Tom" this week for top poster, with only a slightly
EtB> different response library. The "brian" version is better tuned towards
EtB> web and CGI questions.
Tom's biggest downside is the ISP where we both read news has been
having a bad newsfeed... something like 1/4 of the normal articles.
It's hard to be clever when there aren't as many opportunities.
>> [1] Actually, I met Tom at the Perl conference this Summer. :-)
EtB> Well, I've met brian at ny.pm meetings.
And he's taught many classes for me. (See www.perltraining.com for
details, or email perl-training-info@stonehenge.com.)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 285 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 19 Nov 1997 19:45:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: modules, ignoring Tom Phoenix
Message-Id: <comdog-ya02408000R1911971945500001@news.panix.com>
In article <8cvhxoa3zv.fsf@gadget.cscaper.com>, Randal Schwartz <merlyn@stonehenge.com> wrote:
>EtB> Well, I've met brian at ny.pm meetings.
>
>And he's taught many classes for me. (See www.perltraining.com for
>details, or email perl-training-info@stonehenge.com.)
Randal was referring to Tom, not me. i live in a state that allows
me to pump my own gas. :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 19 Nov 1997 20:03:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Newbie help..
Message-Id: <comdog-ya02408000R1911972003300001@news.panix.com>
In article <64v93i$6r9$1@news.megsinet.net>, "Ben Large" <ben@plymouth.in.us> wrote:
>I got this perl script on another sever that pulls fortune
>off the linux box, can I use <!--#virtual include=""> to access it,
>because if i can... it dosent work for me... the addy to the
>perl script is Http://www.datacruz.com/cor-cgi/fortune.pl
that script works when called directly.
you might be able to use it if your server is set up for server
side includes. the best person to ask is the person in charge of your
server.
if you can use server side includes, you might want to check the
documentation for your server (see the CGI Meta FAQ) for the syntax
for Server Side Includes.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 19 Nov 1997 16:41:39 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: passing hash references to subs
Message-Id: <8c4t58a1u4.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com> writes:
>> How dangerous is it to use %foo{x} vs %foo{"x"}?
Tom> Not dangerous at all. $foo{bareword} is defined to be the same as
Tom> $foo{'bareword'}. If you want it to be otherwise, you may write
Tom> $foo{+bareword} (possible error from 'use strict' if it's not a builtin or
Tom> known sub) or $foo{&bareword}, or whatever you mean. (If the bareword is
Tom> meaningful, you may get a warning under 'use strict', alas.)
Tom, you missed it! Both of the original poster's syntax samples
are *illegal*.
So neither of them are dangerous, because neither of them will work. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 285 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 Nov 1997 17:06:06 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Jozsef Hollosi <hollosi@sbcm.com>
Subject: Re: Q: How many elements in a %HASH ?
Message-Id: <8cpvnw8m4x.fsf@gadget.cscaper.com>
>>>>> "Jozsef" == Jozsef Hollosi <hollosi@sbcm.com> writes:
Jozsef> Hi,
Jozsef> is there a simple way to tell how many elements a hash holds?
Jozsef> I know I can do
Jozsef> @TEST = %TEST; $n = ($#TEST+1)/2;
Jozsef> but that generates a whole new @TEST array, which takes too much
Jozsef> time and memory for large hashes.
Jozsef> I can also cycle through the hash using the "each" iterator, but
Jozsef> that is even slower (although doesn't waste memory).
Jozsef> Any better tricks?
Is it a trick if it's documented?
$n = keys %TEST;
I know. It looks hard. But it isn't. This *does* have to walk the
hash, but it doesn't have to build up a list or anything. Just a
simple count.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 285 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Wed, 19 Nov 1997 17:36:05 -0500
From: libeson <libeson@pdb.pdb.bnl.gov>
Subject: Re: Returning information from an nslookup ??
Message-Id: <347369D5.4BB3DD3E@pdb.pdb.bnl.gov>
<HTML>
Burt Lewis wrote:
<BLOCKQUOTE TYPE=CITE>Hi,
<P>I'm capturing IP's using "$ENV{'REMOTE_HOST'} from an SSI page.
<P>I want to then do an nslookup to capture the domain as a variable that
I can read back to the
<BR>webpage and write to file.
<P>I have this but I don't know how to return the answer.
<P>print "Content-type: text/html\n\n";
<P>system "nslookup 207.180.0.20";
<P>Appreciate any help on this.
<P>Burt Lewis</BLOCKQUOTE>
Try the following instead of system:
<P>$return = `nslookup 207.180.0.20`;
<P>then filter the output saved in $return.
<BR>
<PRE>--
libeson</PRE>
</HTML>
------------------------------
Date: Wed, 19 Nov 1997 18:51:33 -0600
From: btrott@scuacc.scu.edu (Benjamin Trott)
Subject: split with capturing parantheses in patte
Message-Id: <879986735.23786@dejanews.com>
Hello,
If I split a string on a certain pattern, and I capture part of that
pattern in parantheses, is the order of the resulting array always
going to be
split element
captured element
split element
captured element
...
split element
It seems to be this way from the few tests I gave it, but I'd like
to actually be sure. For example, if I have code like this:
my @temp = split(/<a name=(.*?)>/i);
unshift(@temp, "");
%temp = @temp;
for $current_anchor (keys %temp) {
$body = $temp{$current_anchor};
$current_anchor =~ s/"//g;
push(@urls, {
'url' => $url . (($current_anchor eq "") ? "" : "#" .
$current_anchor),
'body' => $body
});
}
will I always be ensured (assuming that the HTML is correct and
everything) that the order of my %temp hash will always be
anchor
body
anchor
body
I realize, of course, that the hash elements may be in a different
order, but I'm concerned with the order of the @temp array.
Thanks,
Benjamin Trott
btrott@scuacc.scu.edu
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 20 Nov 1997 10:42:36 +1200
From: Worik Macky Stanton <w.stanton@auckland.ac.nz>
Subject: Re: system vs. backtics. What difference?
Message-Id: <wkiutoo68z.fsf@auckland.ac.nz>
"Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> writes:
>
> Is there a particular reason you have to use that forward slash? If so (like
> if you have to run the same script under both Windows and Unix), why not
Exactly. The same code must run on Windows or Unix.
>
> my $a="foo/bar.exe";
> $a =~ s/\//\\/g;
To do this I need to detect the OS and change the code dynamicly on
the fly...
The easier thing to do (which I have done) is to set the path in the
environment to point (only) to the directories that contain the
executables and dispence with the path info in the excecutable name.
This is a matter of a platform specific set path style statement in
the shell script / batch file that starts the process.
> $p = `$a`;
> print $p;
>
> If not, I'd just use the backslashes and be done with it. Many times it's
> much easier to work your way around a problem than to work your way through
> it. :D
Yea. Hence changing the path.
But the real question is can I set the stdout to point back at me,
without forking (DOSville), and use system(..) to run my executable?
I do not think I can.
Incidently what I am doing is some large scale simulations that repeat
the same simulation several (thousands of) times with minor changes.
Each iteration takes of the order of 5 minutes. To make the problem
tractable I have been recruiting the Win32 machines that are used for
email and word processing (these are 200 Mhz Pentiums...) and running
the simulations on them under the control of a central machine.
Although most of the machines I useare Win32 (NT or 95) there are some
unix boxes I can use as well (dual Alphas and a 16 processor monster)
hence the portability issues.
I belive the appropriate buzzword is 'clusterring'. But I have a bad
time with buzzwords!
Incidentally, and lastly, changing the path has a side effect with
pleasant pollitical ramifications. By placing perl (and the
libraries) code with my simulation executables I can set the path (and
library path) to point at my code and make the rest of the system
inaccessible to my code. This should make the regular users (of email
and WP and browsing programmes) happier to accommodate me.
Cherio
Worik
------------------------------
Date: Wed, 19 Nov 1997 19:20:04 GMT
From: chizl@SPAMkarland.com (Chizl)
Subject: Unix Counter Script
Message-Id: <34733b54.7735835@news.unicomp.net>
I'm looking for some Unix Counter Scripts that take params like
?user=chizl;style=13. Is there any ready made code like this so I
don't need to reinvent the wheel?
L8r,
Chizl - CEO
chizl@karland.com
http://www.karland.com/
http://www.sourcesite.simplenet.com
------------------------------
Date: 19 Nov 1997 16:37:18 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Tom Phoenix <rootbeer@teleport.com>, gnewton@cch.com.au
Subject: Re: What is going on here?
Message-Id: <8c90uka21d.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com> writes:
Tom> On Thu, 13 Nov 1997 gnewton@cch.com.au wrote:
>> open car, "$dog";
>> if ($!) {
Tom> Although that may work sometimes, it's not the recommended way to test for
Tom> a successful open. In fact, I think it's responsible for the error you're
Tom> seeing. This is better.
Tom> unless (open CAR, $dog) {
Tom> # perhaps print something using $!
Tom> ...
Not only is it better, it's essential.
$! is the error value of the most recent *unsuccessful* system call.
Successful system calls leave it alone.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 285 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 Nov 1997 16:58:59 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: comdog@computerdog.com (brian d foy)
Subject: Re: Y2000 Issues in PERL CGI scripts?
Message-Id: <8cvhxo8mgs.fsf@gadget.cscaper.com>
>>>>> "brian" == brian d foy <comdog@computerdog.com> writes:
>>> i've heard rumors about Perl4 having problems...
>>
>> What rumours and where did you hear them?
brian> i was talking to Randal in some bar on Tuesday. he didn't go into
brian> details but i trust his rumors to be rumors.
Yes, rumor central says that Perl4 is not Y2K. This is, of course,
very good news for those of us that are trying to get *all* users of
the so-called "Perl" version 4 *off* that dead flea-bitten carcass of
a language and into the mid-90's!
brian> i was too busy watching
brian> the world go by to pay much attention. :)
"Whoa! Take my bar out for a spin!" :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 285 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 Nov 1997 16:21:56 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Mr. Yen-Ming Chen" <chenym@dufu.math.ncu.edu.tw>
Subject: Re: Year2000 problem with localtime();
Message-Id: <8ck9e4a2qz.fsf@gadget.cscaper.com>
>>>>> "Yen-Ming" == Yen-Ming Chen <chenym@dufu.math.ncu.edu.tw> writes:
Yen-Ming> In a DEC Alpha, the localtime can present up to year 2038,
Yen-Ming> Jan. 19th, 11:14:07. So that means it(Unix) will have a
Yen-Ming> "year 2038" problem?? :)
Of course, this depends on what timezone you are in. For me:
$ perl
print scalar localtime 2 ** 31 - 1;
^D
Mon Jan 18 20:14:07 2038
So that'd be some time ahead of you. :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 285 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1344
**************************************