[9622] in Perl-Users-Digest
Perl-Users Digest, Issue: 3216 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 21 14:17:45 1998
Date: Tue, 21 Jul 98 11:00:34 -0700
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, 21 Jul 1998 Volume: 8 Number: 3216
Today's topics:
ANNOUNCE: AltaVista::SearchSDK 0.99b released <james@csmonitor.com>
ANNOUNCE: mon-0.37l, service monitoring daemon (Jim Trocki)
ANNOUNCE: Net::Hotline 0.60 (John Siracusa)
ANNOUNCE: VCS::CVS.pm <rpsavage@ozemail.com.au>
ANNOUNCE: WebFS::FileCopy 0.03 (Blair Zajac)
Re: beginner: better code for word separation combinati (Chris Russo)
Re: Best perl book for web programming <dparrott@ford.com>
Calling Perl from a batch file (Windows NT) <rdoerr@bizserve.com>
Re: CGI: how to force Netscape to show results line by <dparrott@ford.com>
Help! splitting a text file into separate files tolberv@my-dejanews.com
Re: Help! splitting a text file into separate files <mishra.aditya@emeryworld.com>
Inconsistent 'use strict;' error for undefined HASH ref (Larry Rosler)
Re: mod_perl on RedHat 5.1 (Leslie Mikesell)
Re: More on Perl Conference 2.0 <merlyn@stonehenge.com>
more perl uploading problems <rosadi@students.uiuc.edu>
Re: Perl CGI's under Windows NT scott@softbase.com
Re: Perl CGI's under Windows NT scott@softbase.com
Re: Perl script run in process space of another?!??? <mishra.aditya@emeryworld.com>
Re: Perl Win32 DOS window size <murrayb@vansel.alcatel.com>
print FIC : An easy question ! <delta@netpage.tm.fr>
Refox...........~!!!!!!!!!!!! ubitt@my-dejanews.com
Software Developer/Webmaster dbharper@tasc.com
Splitting a text file and creating separate files. TolberV@salestech.com
Spool using perl <ophir@saifun.com>
Re: wordwrap code snippet merzky@physik.hu-berlin.de
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Jul 1998 16:25:01 GMT
From: James Turner <james@csmonitor.com>
Subject: ANNOUNCE: AltaVista::SearchSDK 0.99b released
Message-Id: <6p2fct$1o$1@news.neta.com>
The initial beta version of AltaVista::SearchSDK (0.99b) has been
uploaded to CPAN.
This is a preliminary release, it really needs a lot of banging on by
various people on different platforms. It is, however, currently
running live in a production environment serving 18 years of archives
for the Christian Science Monitor.
The documentation is included below. Be gentle with me, it's my first
time.
James
NAME
AltaVista::SearchSDK - Perl extension for AltaVista Search
Software Development Kit
SYNOPSIS
use AltaVista::SearchSDK;
avs_adddate(idx, yr, mo, da, startloc)
avs_addfield(idx, pFname, startloc, endloc)
avs_addliteral(idx, pWord, loc)
avs_addvalue(idx, valtype, value, loc)
avs_addword(idx, pWords, loc, pNumWords)
avs_buildmode(idx)
avs_buildmode_ex(idx, ntiers)
avs_close(idx)
avs_compact(idx, bMore_p)
avs_compactionneeded(idx)
avs_compact_minor(idx, bMore_p)
avs_count(idx, pWordPrefix, pCountsHdl)
avs_count_close(CountsHdl)
avs_count_getcount(CountsHdl)
avs_countnext(CountsHdl)
avs_count_getword(CountsHdl)
avs_default_options(pOptions)
avs_define_valtype(name, minval, maxval, valtype_p)
avs_deletedocid(idx, pDocId, pCount)
avs_enddoc(idx)
avs_errmsg(code)
avs_getindexmode(idx)
avs_getindexversion(idx)
avs_getindexversion_counts_v(countsHdl)
avs_getindexversion_search_v(searchHdl)
avs_getsearchresults(searchHdl, resultNum)
avs_getsearchterms(psearchHdl, termNum, term, count)
avs_lookup_valtype(name)
avs_makestable(idx)
avs_open(path, mode, pIdx)
avs_querymode(idx)
avs_release_valtypes()
avs_search(idx, pQuery, pBoolQuery, pOptions, pDocsFound,
pDocsReturned, pTermCount, pSearchHdl)
avs_search_close(pSearchHdl)
avs_search_ex(idx, pQuery, pBoolQuery, pOptions,
searchsince, pDocsFound, pDocsReturned, pTermCount,
pSearchHdl)
avs_search_genrank(idx, pBoolQuery, pRankTerms, pRankSetup,
pOptions, searchsince, pDocsFound, pDocsReturned,
pSearchHdl)
avs_search_getdata(searchHdl)
avs_search_getdatalen(searchHdl)
avs_search_getdate(psearchHdl, year, month, day)
avs_search_getdocid(searchHdl)
avs_search_getdocidlen(searchHdl)
avs_search_getrelevance(psearchHdl)
avs_setdocdata(idx, pDocData, len)
avs_setdocdate(idx, year, month, day)
avs_setdocdatetime(idx, year, month, day, hour, minute,
second)
avs_setparseflags(idx, parseflags)
avs_setrankval(idx, valtype, value)
avs_startdoc(idx, pDocId, flags, pStartLoc)
avs_timer(current)
avs_version()
avs_create_options(limit, timeout, flags)
DESCRIPTION
This set of extensions provides wrappers for all the C
functionality of the AltaVista Search software development
kit (SDK) except for a few functions that did not make sense
to export to perl.
All the functions of the 97 Rev B kit are available as
advertised, except for the following:
avs_add_ms_callback UNIMPLEMENTED
It makes no sense to implement this function, since it
would require being able to pass a C function handle
through perl.
avs_addrankterms UNIMPLEMENTED
Internal function
avs_newdoc UNIMPLEMENTED
No easy way to provide filter function
avs_search_getdata_copy UNIMPLEMENTED
No need for this function
avs_search_getdocid_copy UNIMPLEMENTED
No need for this function
avs_search_getrelevance RETURN ARGUMENT
Relevance is returned as a string representation of the
float
PREREQUITES
Perl 5.004, the AltaVista SearchSDK 97 Rev B
INSTALLATION
To install this module, move into the directory where this
file is located. First copy avs.h and libavs97b.a from your
AltaVista SearchSDK source hierarchy into this directory.
Then type the following:
perl Makefile.PL
make
make test
make install
This will install the module into the Perl library
directory.
AUTHOR
James M. Turner <james@csmonitor.com>
Copything (C) 1998 The Christian Science Publishing Society.
All rights reserved
This program is free software, you can redistribute it
and/or modify it under the same terms as Perl itself.
SEE ALSO
perl(1), AltaVista Search SDK documentation.
BUGS
This beta version has been tested in a live environment for
certain conditions, but has by no means been extensively
tested. In particular, it has not been tested on anything
but Solaris 2.5 on an Ultra. Please let me know if you get
it work under other platforms or operating systems.
------------------------------
Date: 21 Jul 1998 16:24:05 GMT
From: trockij@transmeta.com (Jim Trocki)
Subject: ANNOUNCE: mon-0.37l, service monitoring daemon
Message-Id: <6p2fb5$1l$1@news.neta.com>
MON version 0.37l
-----------------
WHAT IT IS
----------
An extensible service monitoring daemon which can be used to monitor
network or non-network resources. Written in Perl 5, this code should
be able to run out-of-the-box on many platforms. It supports a flexible
configuration file, and can send out email, alphanumeric pages, or any
other type of alert when it detects the failure of a service. Service
monitors that come with the distribution can test ping, telnet, ftp,
smtp, http, nntp, pop3, imap, disk space, SNMP queries, and arbitrary
TCP services.
Changes since last announcement:
--------------------------------
$Id: CHANGES,v 1.7 1998/07/13 04:23:53 trockij Exp $
Changes between mon-0.37k and mon-0.37l
---------------------------------------
-Config parser change from Michael Griffith <grif@cadence.com> that
complains when "alertafter" will never trigger an alert.
-Added "savestate" and "loadstate". Currently these only save
and load the state of things disabled.
-The server now can authenticate clients using a simple
configuration file which can restrict certain users to
using only some (or all) commands. "moncmd" was updated
to support this feature.
-Addition of "upalerts" which may be called when a service
changes state from failure to success. "upalerts" can be
controlled by the "upalertafter" parameter.
-"alertevery" now ignores detailed output when it decides
whether or not to send an alert. Patch submitted by
brian moore <bem@cmc.net>.
-"hostgroup and hyphen" patch. This simple patch will allow
hyphens and periods in hostgroup tags.
-Multiline output fixes in smtp.monitor <roderick@argon.org>
-Now monitors are not called when no host arguments are supplied. This
can be overridden with the per-service "allow_empty_group" option.
-A fix to ftp.monitor by Tiago Severina <ts@uevora.pt> which allows
for multiple 220 lines in the greeting from the FTP server.
-Added snpp.alert, contributed by Mike Dorman <mdorman@debian.org>.
This requires the SNPP Perl module.
-Added ldap.monitor, contributed by David Eckelkamp <davide@tradewave.com>.
This requires the Net::LDAPapi module.
-Added dns.monitor, contributed by David Eckelkamp <davide@tradewave.com>.
This requires the Net::DNS module.
-Monitor definitions can now include shell-like quoted words, as defined by
the Text::ParseWords module (included with perl5). e.g.:
monitor something.monitor -f "this is an argument" -a arg
-"allow_empty_group" is a new per-service option. If set, monitors will
still be run even if all hosts in the applicable hostgroup have been
disabled. The default is that allow_empty_group is not set.
-Monitors are now forked with stdin connected to /dev/null.
-Added "stop" and "start" commands which let make the server cease from
scheduling any monitors. While stopped, clients can still be handled. The
server may be started[sic] in "stopped" mode with -S. There is now a
"reset stopped", which is an atomic version of "reset" and "stop". This
is useful if you want to re-disable things immediately after a reset,
so there will be no race conditions after the reset and before you
disable things.
opstatus.cgi now also reports the state of the scheduler.
-Updated documentation for monitors, the main "mon" manual,
and the "moncmd" manual.
-Fixed a few problems in handle_client that had to do with shutting
the server down.
AVAILABILITY
------------
http://ftp.kernel.org/software/mon/
http://consult.ml.org/~trockij/mon/
ftp://ftp.kernel.org/pub/software/admin/mon/
ftp://consult.ml.org/pub/mon/
From CPAN:
CPAN/authors/id/T/TR/TROCKIJ
REQUIREMENTS
------------
"mon" uses Perl 5.n, where n >= 004.
You'll need the Time::Period module, available from your local
CPAN archive (http://www.perl.com/perl).
The monitors that come with the distribution are all optional, and
are not required for the normal operation of the daemon. However,
you'll probably want to use most of them.
Different monitors and alerts may require some extra Perl modules,
or some auxiliary programs. Follow the specific instructions for
each monitor or alert.
Jim Trocki
Computer System and Network Engineer
Transmeta Corporation
Santa Clara, CA
trockij@transmeta.com
------------------------------
Date: 21 Jul 1998 16:22:48 GMT
From: macintsh@cs.bu.edu (John Siracusa)
Subject: ANNOUNCE: Net::Hotline 0.60
Message-Id: <6p2f8o$1k$1@news.neta.com>
I am pleased to announce the release of Net::Hotline version 0.60.
The package is available for download either from my web site at
http://siracusa.home.mindspring.com/perl/
or from any CPAN mirror server:
http://www.perl.com/CPAN-local/authors/id/J/JS/JSIRACUSA/
What does it do:
----------------
Net::Hotline implements a Hotline interface in Perl. Currently, this
includes only Hotline::Client. Hotline is an internet client/server system
that's sort of a cross between IRC and a BBS. See http://www.hotlinesw.com/
for more information.
What's new in this release:
---------------------------
Version 0.60 is the first (nearly) feature-complete release. Here are the
highlights:
* Added file upload.
* Enabled real dual-forked Mac file creation when downloading on
Mac OS systems.
* Blocking task mode introduced, along with a handful of blocking
methods.
* Overhauled error handling to work with the new blocking task mode.
* Changed the network i/o (again).
* Kludged up a bunch of function names to prevent AutoLoader from
complaining about non-unique 8-letter(!) names.
* Made a few modules less intrusive with their exporting.
* Fixed a bug that caused CPAN.pm and other modules that use ExtUtils
to find version numbers to die with an eval() error.
* Changed the README to prevent hapless Mac OS users from overwriting
MacPerl's lib/Net/ directory.
* Included two example scripts: hlftp.pl and hibot.pl
Legal issues:
-------------
Copyright(c) 1998 by John C. Siracusa. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
as Perl itself.
Author's note:
--------------
There were so many features added between version 0.51 and version 0.60
that there are bound to be a whole crop of new bugs in this release. If
you stumble upon one (or two, or three) please don't hesitate to email me.
-----------------+----------------------------------------
John Siracusa | If you only have a hammer, you tend to
macintsh@bu.edu | see every problem as a nail. -- Maslow
------------------------------
Date: 21 Jul 1998 16:24:37 GMT
From: "Ron Savage" <rpsavage@ozemail.com.au>
Subject: ANNOUNCE: VCS::CVS.pm
Message-Id: <6p2fc5$1m$1@news.neta.com>
A Perl interface to GNU's Concurrent Versions System is available from my
web site, and will be availabe one day from CPAN. A test program is
included, but does not yet respond to 'make test' :-( if only because it
outputs lots of text.
After downloading, try 'pod2html CVS.pm --infile CVS.pm --outfile
CVS.html'.
--
Ron Savage
Home (preferred): rpsavage@ozemail.com.au
Office: Savage.Ron.RS@bhp.com.au
http://www.ozemail.com.au/~rpsavage
------------------------------
Date: 21 Jul 1998 16:25:17 GMT
From: blair@gobi.gps.caltech.edu (Blair Zajac)
Subject: ANNOUNCE: WebFS::FileCopy 0.03
Message-Id: <6p2fdd$45$1@news.neta.com>
I am happy to announce the first major release of WebFS::FileCopy 0.03.
>From the README:
This is the WebFS::FileCopy package. This module provides subroutines
for the getting, putting, copying, moving and deleting of files located
by URLs. It also supports listing directories identified by URL.
Currently, files for getting can use any URL protocol, such as file,
FTP, HTTP, etc. For putting, only the file and ftp protocols are
currently supported.
Notable features:
* Uses LWPng for simultaneous file transfers.
* Get the contents of multiple URLs simultaneously.
* Put content into multiple URLs simultaneously.
* Copy multiple files located by URLs to multiple locations simultaneously.
* Delete a file located by a URL.
* Move a file located from located at one URL to another location.
* List the contents of a URL directory.
WARNING
This package is based on Gisle Aas's LWPng-alpha module, which is still
alpha code. Because the LWPng interface may change in the future, this
module may break if LWPng is updated in the future without updating
WebFS::FileCopy.
REQUIREMENTS
* Perl 5.004_04 or greater.
* LWPng-alpha-0.23 or greater.
* Net::FTP.
SUPPORTED PLATFORMS
I have built and tested the WebFS::FileCopy package on both Solaris
and Windows NT machines.
AVAILABILITY
The latest version of this package is available for download from a CPAN
(Comprehensive Perl Archive Network) site near your at
http://www.perl.com/CPAN/authors/id/B/BZ/BZAJAC/
or from my FTP site:
ftp://ftp.gps.caltech.edu/pub/blair/Perl/
INSTALLATION
In order to use this package you will need Perl version 5.004_04 or
better.
You will need a LWPng-alpha version 0.23 or greater. Versions older
than this one will not work with WebFS::FileCopy. Get LWPng-alpha
from CPAN as CPAN/authors/id/GAAS/LWPng-alpha-?.??.tar.gz.
If you do not have Net::FTP installed, use CPAN to install Net::FTP.
If you want to install a private copy of this package in some other
directory, then you should try to produce the initial Makefile with
something like this command:
perl Makefile.PL LIB=~/perl
DOCUMENTATION
See the CHANGES file for a list of recent changes. POD style
documentation is included in all modules and scripts. These are
normally converted to manual pages end installed as part of the "make
install" process. You should also be able to use the 'perldoc'
utility to extract documentation from the module files directly.
AUTHOR, COMMENTS AND BUGS
I welcome all comments and bug reports. Please email them to
Blair Zajac <blair@gps.caltech.edu>.
COPYRIGHT
Copyright (c) 1998 Blair Zajac. All rights reserved. This package is
free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
--
Dr. Blair Zajac Division of Geological and Planetary Sciences
blair@gps.caltech.edu California Institute of Technology
(626) 583-6729, FAX: 583-7827 252-21, Pasadena, CA 91125
------------------------------
Date: Tue, 21 Jul 1998 09:38:05 -0700
From: news@russo.org (Chris Russo)
Subject: Re: beginner: better code for word separation combinations
Message-Id: <news-2107980938060001@buzz.hq.alink.net>
In article <35B3B0B4.675@min.net>, jdporter@min.net wrote:
>Ralph Brands wrote:
>> If the program finds a section of text with more than one example of one
>> or both words, I want to indicate the number of words between the first
>> and second search words in all possible combinations of those words.
>I think there must be a bug in your ("horrible") solution,
>because if there's a separation value of 1, then there is
>an occurence of "dog" and "cat" at the exact same position.
No, I think he wanted to find the words *between* the two key words, so
his output seemed to make sense to me.
Your code was nice, John, so I modified it to produce the results he wanted.
my $data = 'There is a cat and cat but also a dog and the another cat and
dog and cat in this sentence.';
my %found;
my @data = split /\W+/, $data;
for my $i ( 0 .. $#data ) {
push @{$found{$data[$i]}}, $i;
}
my $var3 = 'cat'; # or whatever
my $var4 = 'dog';
for my $x (@{$found{$var4}} ) {
print join ', ', map { $_<$x ? ($x-$_-1) : () } reverse @{$found{$var3}};
print "\n";
}
HTH,
Chris Russo
--
Chris Russo
news@russo.org
http://www.russo.org
------------------------------
Date: Tue, 21 Jul 1998 11:26:02 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
Subject: Re: Best perl book for web programming
Message-Id: <35B4B30A.1CCB@ford.com>
The O'Reilly books, _Learning Perl_ and _Programming Perl_, are
IMHO required reading. If you are serious about using Perl in
either a CGI application or a "spider"-type application I would
also recommend that you look at O'Reilly's _CGI Programming on
the WWW_ and their _Web Client Programming with Perl_ books.
Also, if CGI is going to be your focus, using CGI.pm is a
required skill. For that I would say buy the book written by
the source; get Lincoln Stein's _Official Guide to CGI.pm ..._.
With that arsenal and the newsgroups, FAQs and code samples
available on CPAN you should be a guru by Christmas...
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-201-9978
------------------------------
Date: Tue, 21 Jul 1998 13:29:12 -0400
From: "Robert L. Doerr" <rdoerr@bizserve.com>
Subject: Calling Perl from a batch file (Windows NT)
Message-Id: <35B4CFE8.A263C221@bizserve.com>
Has anyone used a Batch file to execute the Forms-Handler
that comes with NetObjects?? I need to have a shareware
program called BLAT run after the Forms-Handler each time
it is run. I do get a reponse back but for some reason I only
get back the first field from the response file. If I directly execute
the Forms-Handler.cgi with Perl it works correctly but when I
call it from a batch file it doesn't work right. Below is a copy
of the batch file called Forms-Handler.bat
@echo off
perl forms-handler.cgi %1 %2 %3 %4 %5 %6 %7 %8 %9
blat -install mail.mycompany.com feedback@sparks.dmbb.com
blat response -t myname@mycompany.com
del response
The Server is running Netscape Enterprise server 3.5.1 on
Windows NT 4.0 and it has pl,cgi,bat configured as shell
cgi programs. Any ideas?
Regards,
Robert
------------------------------
Date: Tue, 21 Jul 1998 11:16:56 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
To: Alex Dong Li <ali@genet.sickkids.on.ca>
Subject: Re: CGI: how to force Netscape to show results line by line?
Message-Id: <35B4B0E8.1716@ford.com>
Alex Dong Li wrote:
>
> Hello, CGI experts,
>
> I have written a CGI script to run another, big script.
> This big script will print out some message to the web client during the
> process. My question is: how to force Netscape to show the results line by
> line, instead of showing the whole results at the end of big script
> processing?
>
This is almost something that should be an FAQ (but it should be
in comp.infosystems.www.authoring.cgi :^) ).
The Perl-related portion of the answer has to do with setting the
$OUTPUT_AUTOFLUSH ($|) such that output is flushed from the buffers
after every write|print. See the Camel book for more information.
BTW - this *MAY NOT* be the total solution; suppose that your
browser decides that it will not show any document UNTIL it has
seen the </body></html> at the end of the generated page? What
then?
Perhaps you ought to consult a good CGI programming book and
look at using 'push' documents.
> (((remainder of post excised to save electrons)))
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-201-9978
------------------------------
Date: Tue, 21 Jul 1998 16:19:18 GMT
From: tolberv@my-dejanews.com
Subject: Help! splitting a text file into separate files
Message-Id: <6p2f26$ndl$1@nnrp1.dejanews.com>
Hello all,
I am new to Perl and I have just gotten an opportunity to use Perl to solve a
real job-related problem. I have been given the task of taking a text file
delimited by a ";#########" pattern and create separate files. I know that
Perl is capable, I am not sure how to do it.
The Task:
I must split the file at the ;######## lines and write every line until the
next ;######## to a file with a filename equal to the number on the
corresponding CLIENTS line. (eq 00012487.TXT and 0045664.TXT) The pattern of
the file is listed below
Any help is appreciated.
Victor
The file has this pattern:
TYPE = CLIENT
CLIENTS = 00012487
ACTION = ADD_OR_UPDATE
;========== GENERAL ==========
DRIVE = C
PATH = \
TIMEZONE = -5
CONFIG = APPLICATIONS
CONFIG_OFF = FILE_ATTRIBUTES
CONFIG = REMOTEWARE_APPLICATIONS
;========= CLIENT COMMUNICATIONS =========
PROTOCOL = TCP/IP - Default
;========= SERVER COMMUNICATIONS =========
PRIMARY_RESOURCE = TCP/IP
;######################################
TYPE = CLIENT
CLIENTS = 0045664
ACTION = ADD_OR_UPDATE
;========== GENERAL ==========
DRIVE = C
PATH = \
TIMEZONE = -5
CONFIG = APPLICATIONS
CONFIG_OFF = FILE_ATTRIBUTES
CONFIG = REMOTEWARE_APPLICATIONS
;========= CLIENT COMMUNICATIONS =========
PROTOCOL = TCP/IP - Default
;========= SERVER COMMUNICATIONS =========
PRIMARY_RESOURCE = TCP/IP
;######################################
End_of_text file
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 21 Jul 1998 10:31:31 -0700
From: "Mishra Aditya" <mishra.aditya@emeryworld.com>
Subject: Re: Help! splitting a text file into separate files
Message-Id: <6p2j9i$ol6@news.cnf.com>
Reading the FAQ and
perldoc -f split
Adi
------------------------------
Date: Tue, 21 Jul 1998 10:35:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Inconsistent 'use strict;' error for undefined HASH reference
Message-Id: <MPG.101e71497ced5272989734@nntp.hpl.hp.com>
#!/usr/local/bin/perl -w
use strict;
my $href;
print scalar %$href, "\n";
__END__
This draws the error
Can't use an undefined value as a HASH reference at ...
But if that print statement is replaced by
print scalar keys %$href, "\n";
the program prints 0 (there is no error from 'use strict;').
Is this inconsistent behavior reasonable?
This is perl, version 5.004_03
BTW, if instead of an undefined reference to a hash, we use simply an
undefined hash:
my %hash;
print scalar %hash, "\n";
the program prints 0 also.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 21 Jul 1998 12:01:11 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: mod_perl on RedHat 5.1
Message-Id: <6p2hgn$j9v$1@Mars.mcs.net>
In article <35B4B3DF.A500D128@shell.com>, Yong Huang <yong@shell.com> wrote:
>Mine gives its signature at SERVER_SOFTWARE not GATEWAY_INTERFACE:
>
>SERVER_SOFTWARE = Apache/1.3.0 (Unix) mod_perl/1.13
>
>> If you have the 'printenv' script that is distributed with apache or
>> some similar script that displays environment variables,
>> you will see:
>> GATEWAY_INTERFACE = CGI/1.1 if you are running normal CGI and:
>> GATEWAY_INTERFACE = CGI-Perl/1.1 under mod_perl.
>>
(A) The SERVER_SOFTWARE string tells you that the server was compiled
with mod_perl included but it doesn't tell you that the script
being executed is being run by the embedded perl handler. The
GATEWAY_INTERFACE tells you whether this particular directory,
location, or extension is configured for a perl handler or regular
cgi invocation.
(B) That's not the stock RedHat 5.1 server unless they have updated
very recently. I don't think it reports either php or mod_perl
in the server string even though it contains both.
Les Mikesell
les@mcs.com
------------------------------
Date: Tue, 21 Jul 1998 16:49:23 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: More on Perl Conference 2.0
Message-Id: <8cn2a3taig.fsf@gadget.cscaper.com>
>>>>> "Chris" == Chris Nandor <pudge@pobox.com> writes:
Chris> I am honored to be mentioned in the same sentence as some of
Chris> these people, especially Larry Wall, but I think it was
Chris> somewhat of an undersight ... I have never really developed
Chris> core perl, unless you count one patch to one standard module,
Chris> and the writing of one of the PODs.
Chris, you bought me a beer. That makes you a "core developer". :-)
Chris> I don't think it is false humility to say that I don't think I
Chris> should have been mentioned there. C'est la vie.
Come to think of it, the only code I've ever written that was present
in a distribution was that crazy "chat2.pl" that I've now completely
disowned and had removed from the latest releases. Oh yeah, and the
one line s/// command to un-control the control characters in the
debugger. And my only CPAN submission so far has been my
"shell-2-perl" translator.
I guess I'm not a core developer either. :-)
print "Just another Perl scribe,"
--
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@teleport.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: Tue, 21 Jul 1998 11:52:21 -0500
From: Indra Rosadi <rosadi@students.uiuc.edu>
Subject: more perl uploading problems
Message-Id: <Pine.SOL.3.96.980721114447.114A-100000@ux5.cso.uiuc.edu>
Hi,
I keep getting trouble with perl uploading feature.. This is the
combination that I used for my machine:
IE 4.01
IIS 4.0
ActivePerl 5.00471 (by Activestate) with CGI.pm 2.42 bundled with it
And it gave me this error message:
Malformed multipart POST
However, when I tried it with Netscape Navigator 4.05.. everything is
cool (at least for the example that I used)..
BTW, the code that I tried in my machine is available in:
http://stein.cshl.org/WWW/software/CGI/examples/file_upload.txt
Anybody has any suggestion on how to fix the IE 4.01 problem or upload
problems in general?
And one more thing, where can I download Perl 5.004+ ? (beside
Activeperl)?
Any comments, suggestions, helps will be appreciated..
Thanks in advance..
Indra
--------------------------------------------------------------------------
"The position from which you view your reality will change your perception
of its nature"
- Neon Genesis Evangelion
------------------------------
Date: 21 Jul 1998 16:05:36 GMT
From: scott@softbase.com
Subject: Re: Perl CGI's under Windows NT
Message-Id: <35b4bc50.0@news.new-era.net>
mikep (mikep@rt66.com) wrote:
> I've never had a problem with this. ISAPI is what you have to use yes.
> But ISAPI is a DLL that _requires_ PERL.EXE to be installed beforehand.
> The DLL simply points to the executable (or at least that's what I
> understand).
Well, I've never run it *without* the exe installed. What I'm trying to
say is plain perl.exe doesn't work. You definitely need the ISAPI
version, you can't run perl.exe directly from the web server.
> Now I haven't been able to make server side executables work perse
> using IIS. (e.g. <!--#exec cmd="..."--> so anything you can tell me
> there will be much appreciated.
IIS doesn't support server side includes. You need to either
learn about ASP, or get Apache or some other web browser that
does.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: 21 Jul 1998 16:06:52 GMT
From: scott@softbase.com
Subject: Re: Perl CGI's under Windows NT
Message-Id: <35b4bc9c.0@news.new-era.net>
mikep (mikep@rt66.com) wrote:
> Actually the PERL ISAPI docs are clear (though you have to dig a little
> for it) that you have to manually hack the registry yourself in order
> for .pl extension files to be properly handled by the ISAPI PERL DLL.
I've never had to do this manually. The setup program that comes with
the ISAPI version does it for you.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: Tue, 21 Jul 1998 10:28:29 -0700
From: "Mishra Aditya" <mishra.aditya@emeryworld.com>
Subject: Re: Perl script run in process space of another?!???
Message-Id: <6p2j3t$die@news.cnf.com>
eval the called script by reading it into a string first
Adi
------------------------------
Date: 21 Jul 1998 08:39:02 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Perl Win32 DOS window size
Message-Id: <ulnpnmcx5.fsf@vansel.alcatel.com>
Mark P Stackhouse <stackhou@elk.cray.com> writes:
> Can the DOS shell window size be controlled or configured from within my
> Perl scripts? I'd like to be able to display text in a typical 80
> column x 66 line format but that option is not offered in the DOS shell
> window header.
In NT:
system ("mode", "con", "cols=80", "lines=66");
In other words, this requires knowledge of your operating system, not Perl
in particular.
--
Brad Murray "...and they that weave networks shall be confounded"
Software Analyst Isaiah, 19:9
Alcatel Canada
------------------------------
Date: Tue, 21 Jul 1998 18:58:51 +0200
From: "delta" <delta@netpage.tm.fr>
Subject: print FIC : An easy question !
Message-Id: <6p2h70$geu$1@front4.grolier.fr>
Hello,
I' am sorry but my question is really very basic....
I send a texte line in a file width the following "script":
print FIC "$in{'fond1'}" if $in{'fond1'} =~ m/\S/;
It's OK, I get my texte line, but if :
fond1=I love comp.lang.perl.misc
I would like that print in my file :
"I love comp.lang.perl.misc"
Here, it is the " " that I would like automatically add to my line text
Thank's in advance for your help
Best regards
------------------------------
Date: Tue, 21 Jul 1998 17:23:22 GMT
From: ubitt@my-dejanews.com
Subject: Refox...........~!!!!!!!!!!!!
Message-Id: <6p2iqb$smo$1@nnrp1.dejanews.com>
Hi:
I am facing a very serious problem hope somebody can help.
I had made a program for Inventery Control in Foxpro for Dos 6.2 about two
years back. While giving the compiled version of the software I had used
Refox Branding to further encrypt the software so that it cannot be
decompiled.
Now the software is giving some problems and is not fully y2k compliant I
have been asked to rectify the problem. My problem is that I cannot recall
password that I had used while Branding and I am not able to decompile it. I
had tried to explain this to the company to whom I had sold the software.
They are threatning to sue me in court if I cannot rectify since it is a
mistake commited by me while writing the software.
Can anyone suggest any way to decompile it. Can it be decompiled using any
other decompiler. Any suggestion by email would be of great help.
Thanks,
Best regard,
John
email : ubitt@hotmail.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 21 Jul 1998 15:51:39 GMT
From: dbharper@tasc.com
Subject: Software Developer/Webmaster
Message-Id: <6p2deb$k38$1@nnrp1.dejanews.com>
Major Software Developer/Systems Integrator located in Dayton ,Ohio is in
need of a Software/Web Developer to support a major client server system for
a USAF contract. The project involves developing/converting a large inventory
management system that uses Flying hour data to forcast demand. It is a very
large system and is using the most current development tools. (VB,Active-X,
SQL/Server,MS web server,Interdev,MS-IIS,Oracle etc. The individuals role
will not be only in content publishing, but rather supporting other
subcontractors that are content publishers as well as serving as
Webmaster/Technical Management and supporting internet database applications
(SQL Server), so they need to have a strong backgound in programming,embedded
SQL,internet servers and at least one of the following Java-script,
Active-X,VB-script, MS-IIS web development tools. It is an excellent
opportunity to learn, grow and develop a web based Front end. Please contact:
Blake Harper TASC 2555 University Blvd Fairborn, Ohio 45324 T-937-426-1040 ex
286 Fax- 937-426-2932 E-Mail dbharper@tasc.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 21 Jul 1998 16:43:05 GMT
From: TolberV@salestech.com
Subject: Splitting a text file and creating separate files.
Message-Id: <6p2gep$pbd$1@nnrp1.dejanews.com>
Hello All,
I am still a Perl newbie and have been assigned a job-related task in which
Perl seems to be the approriate tool. Any clues or suggestions?
I must take a file (file pattern below), split the text at each ;########...
line and write every line until the next ;########... line to a file with the
filename equal to the number on the CLIENTS line in each section. (eq
00012487.TXT and 0045664.TXT). Otherwise I would have to manually cut and
paste about 300 times.
Help!
V
File Begins next line:
TYPE = CLIENT
CLIENTS = 00012487
ACTION = ADD_OR_UPDATE
;========== GENERAL ==========
CLIENT_TYPE = WINDOWS_95
DESCRIPTION = Carmen Poliseno
STATUS = ENABLE
DRIVE = C
TIMEZONE = -5
CONFIG = APPLICATIONS
CONFIG_OFF = FILE_ATTRIBUTES
;========= CLIENT COMMUNICATIONS =========
PROTOCOL = TCP/IP - Default
;========= SERVER COMMUNICATIONS =========
PRIMARY_RESOURCE = TCP/IP
;###########################################
TYPE = CLIENT
CLIENTS = 00045664
ACTION = ADD_OR_UPDATE
;========== GENERAL ==========
CLIENT_TYPE = WINDOWS_95
DESCRIPTION = Carmen Poliseno
STATUS = ENABLE
DRIVE = C
TIMEZONE = -5
CONFIG = APPLICATIONS
CONFIG_OFF = FILE_ATTRIBUTES
;========= CLIENT COMMUNICATIONS =========
PROTOCOL = TCP/IP - Default
;========= SERVER COMMUNICATIONS =========
PRIMARY_RESOURCE = TCP/IP
;###############################################
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 21 Jul 1998 18:11:46 +0300
From: Ophir Marko <ophir@saifun.com>
Subject: Spool using perl
Message-Id: <35B4AFB2.776E89C6@saifun.com>
How can I create a spool with perl?
------------------------------
Date: Tue, 21 Jul 1998 16:24:20 GMT
From: merzky@physik.hu-berlin.de
Subject: Re: wordwrap code snippet
Message-Id: <6p2fbl$nks$1@nnrp1.dejanews.com>
In article <Pine.OSF.3.96b.980721001149.373A-100000@saul1.u.washington.edu>,
"T. Youderian" <tyoud@u.washington.edu> wrote:
>
> Hi there, I wrote a quick subroutine to take a entry from the textfield
> off a web page and to quickly rework it so that it doesnt run-on in one
> big long line. Here's the function... it has a bug though :)
> (It still mostly works!!) The bug is that it seems like if you call the
> function multiple times, it concatenates the output one onto the end of
> another... maybe thats not really a bug, just an effect of @_ ?
> Need enlightenment, hope you see the problem right off :) I would
> normally do something like this in c with strtok() but I thought I'd try
> it with perl and it was surprisingly easy?
Hmm, if you would use 'perl -w' ans 'use strict', you would have seen
it 'right off' :-)
the solution is, that newentry is not local.
A 'my ($newentry) = "";' at the begin of the routine should
do it.
my version looks like this:
>
> ---------------------------------------------
> #!/usr/local/bin/perl
>
> #----------------------------------
> # take a run-on string and put in returns
> # so that it wraps nicely
> #----------------------------------
- sub wordwrap ($$) {
- my ($linelength) = $_[0];
- my (@words) = split (/\s+/, $_[1]);
--- my ($newentry) = "";
>
> $len = 0;
> foreach $word (@words) {
> if ($len + length($word) >= $linelength) {
> if ($len != 0) {
- $newentry .= "\n";
> }
> $len = 0;
- $newentry .= "$word ";
> $len += length($word) + 1;
> } else {
- $newentry .= "$word ";
> $len += length($word) + 1;
> }
> }
- $newentry .= "\n";
>
> # Put in a space after a ". ", "! " or a "? " to make it look nice
- $newentry =~ s/\. [^\s]/\. /g;
- $newentry =~ s/\! [^\s]/\! /g;
- $newentry =~ s/\? [^\s]/\? /g;
>
- return ($newentry);
> }
>
> $entry = "Yeah, you know it baby!!! Supercalifragilisticexpialidocious! The
quick brown fox jumps over the lazy dog. When the cat's away, the mice will
play. Hey diddle diddle, the cat and the fiddle, the cow jumped over the moon.
Three blind mice, three blind mice, see how they run, see how they run.\n";
>
- $entry = &wordwrap(65, $entry);
- print "\n--------\n 2. Entry:\n$entry\n";
- $entry = &wordwrap(65, $entry);
- print "\n--------\n 1. Entry:\n$entry\n";
>
>
Hth.
Andre.
--
Andre Merzky
pinocchio@earthling.net
http://pino.home.pages.de/
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3216
**************************************