[13553] in Perl-Users-Digest
Perl-Users Digest, Issue: 963 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 1 11:07:22 1999
Date: Fri, 1 Oct 1999 08:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938790310-v9-i963@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 1 Oct 1999 Volume: 9 Number: 963
Today's topics:
ANNOUNCE: XML::RSS 0.6 <eisen@pobox.com>
Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca (I R A Darth Aggie)
Re: Can perl create an excel file <sjohns17@uic.edu>
Re: Can perl create an excel file <gellyfish@gellyfish.com>
Re: CGI call CGI? <flavell@mail.cern.ch>
Re: CGI call CGI? <dove@synopsys.com>
Re: CGI call CGI? <gellyfish@gellyfish.com>
Coding and encoding strings... (Bror Hellman)
Re: Coding and encoding strings... <rhomberg@ife.ee.ethz.ch>
Re: Dealing with "MS-ASCII" - again! (yes, I know it is <flavell@mail.cern.ch>
Re: help with simple interactivity (Anno Siegel)
HELP! Is the "seek" command Win32 Only? <shadow-reaper@mindless.com>
Re: How to retreive the size of a directory on NT (Scott McMahan)
Re: Install CPAN module in ActiveState Windows version <walsh@averstar.com>
Re: multi dimensional array's (Bill Moseley)
Re: Really difficult (or primitive?) problem? <ashtong@humbug.futures.bt.co.uk>
Re: Really difficult (or primitive?) problem? <pkotala@logis.cz>
Re: return ? byoodeja@my-deja.com
Re: return ? <gellyfish@gellyfish.com>
Re: Runtime exception driving me crazy <dstiff@symantec.com>
Re: setpwent <rockie@apk.net>
Re: Suggestion - comp.lang.perl.flame (was Re: You shou (I R A Darth Aggie)
Re: Understanding exec() (Bill Moseley)
Re: Validating email addresses. <skilchen@swissonline.ch>
Web Site duplicator <marcpawl@nortelnetworks.com>
Re: why use references - in laymans terms? <rick.delaney@home.com>
Win32 Modules <justin@comms81.freeserve.co.uk>
Re: Win32 Modules <l.laperrousaz@net-clic.net>
Re: Win32 Modules (Scott McMahan)
Re: Win32 Modules <justin@comms81.freeserve.co.uk>
WWW::Search 2.04 released <mthurn@tasc.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Oct 1999 12:38:19 GMT
From: Jonathan Eisenzopf <eisen@pobox.com>
Subject: ANNOUNCE: XML::RSS 0.6
Message-Id: <7t29vr$4ji$1@play.inetarena.com>
DLSI=adpO
This release fixes a a number of bugs thanks mostly
to Chris Nador's efforts.
This is an alpha release because the API has not been
finalized. The module will be available at your local
CPAN archive. Alternatively, try this URL:
http://www.perlxml.com/modules/XML-RSS-0.6.tar.gz
This Perl module provides a basic framework for creating and
maintaining Rich Site Summary (RSS) files. RSS is primarily
used for distributing news headlines, commonly called
channels, and is used primarily on Netscape's Netcenter,
http://my.netscape.com, and Userland Software's
http://my.userland.com.
More information on RSS can be found at:
http://my.netscape.com/publish/help/mnn20/quickstart.html
An article covering the use of the XML::RSS module
is available at http://www.motherofperl.com
John Udell has also written an excellent intro to RSS
which is available at:
http://www.byte.com/column/BYT19990916S0002
To learn more about the history and future of RSS,
check out Dave Winer's http://discuss.userland.com
Please send comments, flames, etc. to eisen@pobox.com.
------------------------------
Date: 1 Oct 1999 13:33:58 GMT
From: sy_nttvr@gurcragntba.pbz (I R A Darth Aggie)
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <slrn7v9dus.bgq.sy_nttvr@gurcragntba.pbz>
On Thu, 30 Sep 1999 17:35:53 -0700, David Cassell
<cassell@mail.cor.epa.gov>, in <37F401E9.506F9A33@mail.cor.epa.gov>
wrote:
+ Oops, I think that's _ad_hominem_ too. I guess I'd better
+ call someone another Hitler and end this thread. Got any
+ nominations? :-)
I'll wonder thru here and take the blame. I don't mind. Just call me
Stalin, too, while you're at it...
+ mathematical statistician
AIIIIIIIIIEEEEEEEEEEEEEE. I work for statisticians...
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Fri, 1 Oct 1999 07:59:29 -0500
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: Can perl create an excel file
Message-Id: <Pine.A41.4.10.9910010755110.1042418-100000@tigger.cc.uic.edu>
On Fri, 1 Oct 1999, AcCeSsDeNiEd wrote:
> Go check out the Win32::ODBC or DBD::ODBC modules
>
> You need to make use of the ODBC (Open Database Conectivity) in Win32.
1. What does this have to do with creating an excel file?
2. Could be wrong as I don't use MSOffice, but doesn't Excel deal strictly
with "static" files, and not open databases?
-Seth
------------------------------
Date: 1 Oct 1999 15:34:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can perl create an excel file
Message-Id: <37f4c684_2@newsread3.dircon.co.uk>
Seth David Johnson <sjohns17@uic.edu> wrote:
> On Fri, 1 Oct 1999, AcCeSsDeNiEd wrote:
>
>> Go check out the Win32::ODBC or DBD::ODBC modules
>>
>> You need to make use of the ODBC (Open Database Conectivity) in Win32.
>
> 1. What does this have to do with creating an excel file?
> 2. Could be wrong as I don't use MSOffice, but doesn't Excel deal strictly
> with "static" files, and not open databases?
>
Of course it doesnt have anything to do with Perl but there is an Excel
ODBC driver - the 'Workbook' has to exist first though ...
/J\
--
"The teenage masturbators of today are the television executives of
tomorrow" - Melissa Cabriolet, Drop the Dead Donkey
------------------------------
Date: Fri, 1 Oct 1999 15:01:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI call CGI?
Message-Id: <Pine.HPP.3.95a.991001144425.18075D-100000@hpplus01.cern.ch>
On Fri, 1 Oct 1999, Bangert Goldsmith wrote:
> I can't see any suggestions except yours. Well, a long story! In
> short: because of using Java to call a webpage in CGI, I can not use
> HTTP_REFERER. Then I try to fix the problem by using parameters (to
> the CGI script) instead.
With respect, you seem to have painted yourself into a corner
without a clear concept of what you aim to achieve.
Quite what Java has got to do with this is unclear. Java is an
object-oriented programming language. Is this an applet, or something?
I've always found that the vital step in application design is deciding
what functionality is needed, and ensuring that this functionality makes
sense in the relevant context, which in this case is presumably the WWW.
Getting distracted by the fact you have a few pre-programmed components
in the toolkit already, that do a different but somewhat analogous job
to what is currently required, is often a recipe for a kludge, not to
say in some cases a real disaster.
To address your particular point here...
The CGI (common gateway interface) is an interworking specfication,
that deals with the relationship between a web server and a process
that is programmed by you. In other words, one of the partners in the
transaction is meant to be a web server. So, calling one CGI process
from another CGI process is kind-of perverse, since neither of them is a
web server. OK, you can mock-up an environment if you must, or you can
redirect from the one process to the other such that the web server
will schedule them both. But not normally to be recommendeed, if I may
say so.
> I have figured it out with very simple
> solution.
I don't think so. A "simple solution" _can_ be made from simple
components, if they have been carefully designed for their task. But a
ramshackle edifice of random "simple" components does not constitute a
simple solution.
What you're asking for, can be done with a redirection. But I don't
think it's the solution to your problem. My assessment, for what it's
worth, is that you need to go back to your requirements analysis and
identify what functionality you are really looking for, instead of
getting lost in the detail of one particular incomplete solution. And
then this group has some people, much better at Perl than I am, who will
be able to advise you how to approach a real solution to your
requirement.
Another approach that can be recommended is to work your way through
Merlyn's Web Techniques columns attentively. That can help to develop
the kind of "mindset" that recognises appropriate ways to address
this kind of thing in a WWW context.
IMHO anyway.
------------------------------
Date: Fri, 01 Oct 1999 07:30:20 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: CGI call CGI?
Message-Id: <37F4C57C.3E8B8C2A@synopsys.com>
Hi Alan,
"Alan J. Flavell" wrote:
> Another approach that can be recommended is to work your way through
> Merlyn's Web Techniques columns attentively.
Where are Merlyn's Web Techniques articles? (Who is Merlyn? Randall
Schwartz?)
-=dav
------------------------------
Date: 1 Oct 1999 15:39:27 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI call CGI?
Message-Id: <37f4c79f_2@newsread3.dircon.co.uk>
David Amann <dove@synopsys.com> wrote:
> Hi Alan,
>
> "Alan J. Flavell" wrote:
>
>> Another approach that can be recommended is to work your way through
>> Merlyn's Web Techniques columns attentively.
>
> Where are Merlyn's Web Techniques articles? (Who is Merlyn? Randall
> Schwartz?)
>
No Merlyn was King Arthurs court magician ....
<http://web.stonehenge.com/merlyn/WebTechniques/>
/J\
--
"Over the years I've always had Max Factor in my box" - Tina Earnshaw,
Chief Make-Up Artist, Titanic
------------------------------
Date: 1 Oct 1999 14:28:01 +0200
From: m8100@abc.se (Bror Hellman)
Subject: Coding and encoding strings...
Message-Id: <7t29ch$18o@atle.abc.se>
Keywords: perl, uudecode, uuencode, uucode, base64, rot13
I wonder if anyone can give me some perlcode to do
UUencode, UUdecode and Base64 encoding/decoding.
I'd like to write a sub each to do these codings
and wondered if someone already did it.
I found a module somewhwere that did this,
but I'm not allowed to use modules, my ISP
doesn't allow me, so I have to write them
in ordinary perl instead. I presume such
encoding/decoding can't be too complicated in perl.
Also, I did several subs to make a rot13 substitution.
I really enjoyed making rot13 in perl.
Which is the best way to do a rot13? Have someone
made a real nifty and elegant solution in perl?
I'm curious to see who made the best rot13.. ;-)
Steamboat Willie
--
.
------------------------------
Date: Fri, 01 Oct 1999 16:41:09 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Coding and encoding strings...
Message-Id: <37F4C805.6789DD97@ife.ee.ethz.ch>
Bror Hellman wrote:
>
> I wonder if anyone can give me some perlcode to do
> UUencode, UUdecode and Base64 encoding/decoding.
base64 is in MIME::base64
dunno about uu
> I found a module somewhwere that did this,
> but I'm not allowed to use modules, my ISP
> doesn't allow me, so I have to write them
> in ordinary perl instead. I presume such
> encoding/decoding can't be too complicated in perl.
There is a pure perl implementation you can copy from MIME::base64
your ISP assumes your code is better than that in the modules?
> Also, I did several subs to make a rot13 substitution.
> I really enjoyed making rot13 in perl.
>
> Which is the best way to do a rot13? Have someone
> made a real nifty and elegant solution in perl?
> I'm curious to see who made the best rot13.. ;-)
$_=uc;tr/A-MN-Z/N-ZA-M/;
- Alex
------------------------------
Date: Fri, 1 Oct 1999 14:43:59 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Dealing with "MS-ASCII" - again! (yes, I know it is a bad term, but we're stuck with it)
Message-Id: <Pine.HPP.3.95a.991001143751.18075C-100000@hpplus01.cern.ch>
On Fri, 1 Oct 1999, PEZ wrote:
> Hmmm. No, it was me that translated MS-ASCII to CP-850. MS Word did
> show up on the DOS platform first though, so maybe some Word documents
> can have CP 850 coding...
MS Word (at least, based on what an outside observer can tell by looking
at its published RTF format) retains the original coding of the input
characters. So for example a Word document that has been worked-on on a
Mac and on Windows will contain a mixture of different codings
internally, each marked according to which machine was used to input
them.
The published RTF format contains a coding for DOS format, which I
suppose could well involve CP-850.
This is still dreadfully off-topic for a Perl group, so I'll say no more
than that the last pointer I located to an RTF format specification was
at the rtftohtml site, www.sunpack.com/RTF/
------------------------------
Date: 1 Oct 1999 14:19:52 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help with simple interactivity
Message-Id: <7t2fu8$dkl$1@lublin.zrz.tu-berlin.de>
<albuck@my-deja.com> wrote in comp.lang.perl.misc:
>
>
>I have a system script for bulk labeling of storage
>volumes in a robotic library. These scripts are
>written in ksh, and they build another small ksh
>script on the fly which is a here document of the
>following form:
>
>labelvol-command arg1 arg2 ... argn <<EOF
>VOLSER1
>VOLSER2
>VOLSER3
>
>EOF
>
>(The labelvol command exits when it receives a blank line.)
>
>I am trying to move my scripts to perl. Obviously, I can still
>build this ksh here document script and run it, but somehow
>that seems to defeat the purpose of using perl. How can I
>build and execute the same here document without involving
>the shell? I know, TMTOWTDI. :-) Multiple solutions gladly
>accepted by this eager student.
Well, the standard solution would be something like (untested):
my $cmd = 'labelvol-command';
open LV, "| $cmd arg1 arg2 ... argn" or die "Can't run $cmd\n";
for my $label ( 'VOLSER1', 'VOLSER2', 'VOLSER3', '') {
print LV "$label\n";
}
close LV;
die "$cmd failed\n" if $?;
>Also, this is the blind input solution, since I am not
>checking for errors being returned by the labelvol utility.
>How would I go about driving the input of this program line
>by line, and capturing the output line by line? I could
>show some of my attempts but they fail so miserably, I would
>rather not.
You may want to look into the IPC::Open3 module. It allows you
to send input to a program (via print) and receive its output
and its STDERR (via <...> on two separate filehandles).
There is always a risk of blocking with this sort of setup, so
you may also need select() (the four-argument form) to see which
filehandle is ready.
Anno
------------------------------
Date: Fri, 01 Oct 1999 22:38:10 +0800
From: Shadow Reaper <shadow-reaper@mindless.com>
Subject: HELP! Is the "seek" command Win32 Only?
Message-Id: <37F4C752.DBB4C17F@mindless.com>
Hi,
I'm trying to program this CGI but am running into one major problem...
When I use Perl Builder with Perl 5 installed, it runs on my computer
with no syntax errors and processing faults.
When I however upload it to Virtual Avenue, I get a "Server Processing
Error"... so I tried one of "Matt's free scripts" to see if it was my
code, and Matt's scripts run. I'm not sure of the type of server Virtual
Avenue uses, but when connecting via FTP it is described as UNIX. The
file is "folded" the way it should be coz I'm using Perl Builder and
have told it to save the files in UNIX format and non-UNIX format and I
have tried both, and neither work. So I was wondering if the SEEK
command is Win32 only...
I have enclosed a sample of the code... if anyone is willing to sift
through the 21Kb of code to try and resolve the problem... PLEASE EMAIL
ME!
The seek code is as follows:
=========PERL CODE===================
$bytesToSkip = $cycVal*22;
seek(INFILE, $bytesToSkip, 0);
$theLine = <INFILE>;
#Split up this line for the data it has
($currentStatus, $description) = split(/\W+/, $theLine);
if ($currentStatus==0){
&display('get_bookdata_error');
}
====================================
and I have used it another time, but somewhat differently:
==========PERL CODE=================
$lineInFile = ((($coordt-1)*7)+($coordo-1));
if (-e "$file_dir$file_name") {
open(INFILE, "<$file_dir$file_name");
copy ("$file_dir$file_name", "$file_dir$file_name.bak");
while (<INFILE>){
if ($notOpened){
$notOpened=0;
open(OUTFILE, ">$filedir$file_name");
}
($var1, $var2) = split(/\W+/);
if ($passOvers==$lineInFile){
if ($var1==3){
$var1 = "1";
$var1 .= $filler x (10 - length($var1));
$var2 = "$username";
$var2 .= $filler x (10 - length($var2));
print OUTFILE "$var1$var2\n";
}
else{
&display('bad_coord_selection')
}
}
else{
$var1 .= $filler x (10 - length($var1));
$var2 .= $filler x (10 - length($var2));
print OUTFILE "$var1$var2\n";
}
$passOvers++;
}
close (INFILE);
close (OUTFILE);
==================================
If anyone can see any obvious problems here please tell me! I'm not sure
if this programming method is for Win32, but it needs to run on a common
web server... if the problem can't be seen here... do you have any idea
what it could be? I'm willing to send the code to anyone who thinks they
may be able to help as I need to finish this ASAP!
Thanks a lot!
Shadow Reaper
shadow-reaper@mindless.com
------------------------------
Date: Fri, 01 Oct 1999 13:06:58 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: How to retreive the size of a directory on NT
Message-Id: <Sl2J3.615$QE1.38703@newshog.newsread.com>
s5dw (s5dw@telecom.co.nz) wrote:
> Is there an easy way to get the size of a directory without adding up the
> size of all the files in that directory.
No.
Scott
------------------------------
Date: Fri, 1 Oct 1999 14:02:16 GMT
From: John P Walsh <walsh@averstar.com>
Subject: Re: Install CPAN module in ActiveState Windows version of Perl?
Message-Id: <37F4BEE8.F5B1414D@averstar.com>
Thanks for the input Jonathan. I checked the other ActiveState sites, and
they too have a limited set of modules. The sites, as published on the
ActiveState web site, are listed in the following text quoted from the
ActiveState site:
Start quote -
"By default, PPM will use the ActiveState package repository, but there are
other repositories on the Internet. At the moment there are these
repositories:
http://www.activestate.com/packages The default package repository from
ActiveState
http://Jenda.Krynicky.cz/perl Jan Krynicky's package repository
http://www.roth.net/perl/packages/ Roth Consulting's package repository
http://www.xray.mpe.mpg.de/~ach/ptk/ppm Achim Bohnet's package repository
http://rto.dk/packages/ RTO's packages repository (mostly
mirrors of
the
above)
http://www.fastnetltd.ndirect.co.uk/Perl/zips/ Fastnet Software Ltd's
packages - not directly accessible from PPM at present "
End quote -
If possible, I would like to be able to use a simple process to install CPAN
modules into the ActiveState-Windows directory structure, and maintain the
latest versions of these modules. From what I see posted on the net, I need
to maintain both the ActiveState ppm software, and the set of
CPAN-installation modules normally used with non-ActiveState Perl. Is this
correct?
- John Walsh
Jonathan Stowe wrote:
> On Thu, 30 Sep 1999 18:05:25 GMT John P Walsh wrote:
> > What is the procedure to install an CPAN module into an ActiveState Win
> > version of Perl? The PPM program provided by ActiveState appears to be
> > limited to modules available at the ActiveState site.
> >
>
> There are other PPM repositories available and these are configurable
> within the PPM program - I'm afraid I can t remember the URL of any
> at the moment but you might want to inquire of one of the mailing lists
> that are referenced on the Activestate site.
>
> If a module has no XS components then you might be able to install it
> if you obtain 'nmake' (microsofts make utility) which is available from
> microsofts ftp server.
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> <http://www.gellyfish.com>
> Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 1 Oct 1999 05:46:10 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: multi dimensional array's
Message-Id: <MPG.125e4cea3b91367a9897aa@206.184.139.132>
MeTAlMollY (sorry@geen.nl) seems to say...
> Hello everybody,
>
> Is it possible to have a 3 dimensional array with Perl??
> I know this is possible:
>
> %table = ('key1' => 'value1'
> 'key2' => 'value2'); etc. etc.
>
> But now I want different %table's something like this:
>
> %table[0] = ('key1' => 'value1'
> 'key2' => 'value2');
As a hash of hashes
$table{1} = {
key1 => 'value1',
key2 => 'value2',
};
As an array of hashes
my @array;
push @array, {
key1 => 'value1',
key2 => 'value2',
};
or
$array[3] = {
key1 => 'value1',
key2 => 'value2',
};
perldoc perlol
perldoc perlref
perldoc perldsc
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 01 Oct 1999 13:14:47 +0100
From: Graham Ashton <ashtong@humbug.futures.bt.co.uk>
Subject: Re: Really difficult (or primitive?) problem?
Message-Id: <u9er9jf6zwo.fsf@humbug.futures.bt.co.uk>
"Pavel Kotala" <pkotala@logis.cz> writes:
> Is there any way to set timeout for listening on TCP/IP (script should be
> run on either unix and win32)?
Seeing as you seem rather disgruntled that you've not had an answer I
thought I'd wade in... all the following is untested, use it at your
own risk.
You could try "perldoc -f alarm", and then when you've read that set
up a signal handler to trap the alarms;
local $SIG{ALRM} = sub { die "alarm!\n" };
You can then eval the code that needs timing out;
eval {
local $SIG{ALRM} = sub { die "alarm!\n" };
alarm(10);
# put thing that takes ages here
alarm(0); # phew, we finished -> cancel alarm
};
if ($@) {
# oops, we timed out. take care of it
}
else {
# everything went sweetly and we didn't time out. how nice
}
How's that?
> I would like to listen on some port and if I would not get message in some
> time, I would need to stop listening and return from procedure.
The above should do it.
P.S. I don't think nobody answered because they couldn't be arsed, its
just that things sometimes get missed by the people who can help.
Concise descriptive subject lines can be a bit of an art form...
--
Graham
------------------------------
Date: Fri, 1 Oct 1999 14:47:18 +0200
From: "Pavel Kotala" <pkotala@logis.cz>
Subject: Re: Really difficult (or primitive?) problem?
Message-Id: <938782056.904758@gate.logis.cz>
Thank You very much for answer, but I need for script to work on Win 32 as
weel as on unix.
Function alarm does not work on Win32, so I search for another solution.
Thank you once more
Pavel
------------------------------
Date: Fri, 01 Oct 1999 12:22:54 GMT
From: byoodeja@my-deja.com
Subject: Re: return ?
Message-Id: <7t292m$qg7$1@nnrp1.deja.com>
In article <pd3dvw1m5z.fsf@baynetworks.com>,
Joe Marzot <gmarzot@baynetworks.com> wrote:
> byoodeja@my-deja.com writes:
>
> > Perl gurus out there,
> >
> >
> > What does this return ?
> >
> > $year = ($birthdate =~ /^(dddd)-(dd)s*$/);
$birthdate has form of "YYYY-MM"...1999-03
I'm using "param("birthdate") to get the string using CGI.
I know that after "param("birthdate"), $birthdate has a string
"YYYY-MM".
And by reading "perlop", "=~" should return the indication of operation.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 1 Oct 1999 13:39:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: return ?
Message-Id: <37f4ab96_2@newsread3.dircon.co.uk>
byoodeja@my-deja.com wrote:
> In article <pd3dvw1m5z.fsf@baynetworks.com>,
> Joe Marzot <gmarzot@baynetworks.com> wrote:
>> byoodeja@my-deja.com writes:
>>
>> > Perl gurus out there,
>> >
>> >
>> > What does this return ?
>> >
>> > $year = ($birthdate =~ /^(dddd)-(dd)s*$/);
>
> $birthdate has form of "YYYY-MM"...1999-03
> I'm using "param("birthdate") to get the string using CGI.
> I know that after "param("birthdate"), $birthdate has a string
> "YYYY-MM".
>
> And by reading "perlop", "=~" should return the indication of operation.
>
>
But you didnt read perlre did you ?
($year,$month) = ($birthdate =~ /^(\d{4})-(\d\d)\s*$/);
OK ?
/J\
--
"While we've been on the air we've had reports that Prince Charles has
eaten beef on the bone" - Justin Webb, BBC One O'Clock News
------------------------------
Date: Fri, 1 Oct 1999 09:19:49 -0400
From: "David Stiff" <dstiff@symantec.com>
Subject: Re: Runtime exception driving me crazy
Message-Id: <7t2cbb$31v$1@news2.symantec.com>
After doing some more testing and debugging I have determined that this is
not code related. I can comment out any code and it will still continue to
give me the Runtime Exception error. I am using Perl 5 under NT 4 SP5.
If anyone has any insight into what could be causing this I would appreciate
it. Environment settings? Perl version? NT?
Thanks,
Dave Stiff
David Stiff <dstiff@symantec.com> wrote in message
news:7t020s$t8v$1@news2.symantec.com...
> Hi,
>
> I am migrating a Perl process from one machine to another. The new machine
> is a very high end dual Pentium system with 512 MB of RAM (clone machine).
> The Perl code has not changed but I am receiving a Runtime exception when
> comparing two arrays.
>
> The code looks like this:
>
> sub listSubtraction {
>
> local($refListA, $refListB) = @_;
> local(@listDiff) = ();
> local($a);
> local($b);
>
> foreach $a (@$refListA)
>
>
> $exist = 0;
>
> foreach $b (@$refListB)
>
>
> if (uc($b) eq uc($a))
>
> $exist = 1;
> }
> }
>
> if (!$exist)
>
> push( @listDiff,$a);
> }
> }
>
> return @listDiff;
> }
>
>
> The process runs for several minutes comparing the arrays before stopping.
> Any ideas?
>
> Thanks,
> Dave Stiff
>
>
------------------------------
Date: Fri, 01 Oct 1999 10:02:44 -0300
From: "R. Brockway" <rockie@apk.net>
Subject: Re: setpwent
Message-Id: <37F4B0F4.92AD62A8@apk.net>
Martien Verbruggen wrote:
> I think the -c option to usermod changes the gcos field, they
> just call it 'comment' for whatever silly reason. Note that passwd -g
> is Solaris specific. It's -f on many other systems, and chfn on others
> still.
>
you are absolutely correct, i just re read my man pages. obviously i never looked
hard enough.
>
> I have never seen passwd -g not free up the passwd file (meaning that
> the lock stays around or something?), but I have seen some odd
> behaviour under sudo on Solaris, although I can't remember exactly
> anymore what it was doing.
>
yea, from what i can tell on the rare occasions this happens the tmp locks files
never dissolve, but also the actual process passwd -g never exits. in theory it
could be a potential flaw in combination with sudo if the command was run and the
passwd file was already locked, or it just blows out on its own. we never pursued
it (other than to temporarily remove passwd -g from sudoers) and was hoping to
write a perl equiv.
thanks again for you time.
-rockie
------------------------------
Date: 1 Oct 1999 13:42:47 GMT
From: sy_nttvr@gurcragntba.pbz (I R A Darth Aggie)
Subject: Re: Suggestion - comp.lang.perl.flame (was Re: You should be admired)
Message-Id: <slrn7v9efd.bgq.sy_nttvr@gurcragntba.pbz>
On 30 Sep 1999 22:07:09 GMT, Eric Bohlman <ebohlman@netcom.com>, in
<7t0mud$8de@dfw-ixnews5.ix.netcom.com> wrote:
+ But experience shows that what will happen is that if a new CGI-Perl
+ group is created, the script kiddies will simply crosspost into it rather
+ than using it exclusively.
So? If you know that ahead of time, add it into the charter:
No cross-posts. Make it robo-moderated, and let the robot strip out the
crossposting before posting it.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Fri, 1 Oct 1999 05:39:39 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Understanding exec()
Message-Id: <MPG.125e4b69194fc8849897a9@206.184.139.132>
John Stanley (stanley@skyking.OCE.ORST.EDU) seems to say...
> You should read the documentation for your
> external program to find out what it expects and give it what it
> wants.
Normally, yes. Lets see. Oh, here's the relevant part of the docs now:
"You don't need to put quotes around search words, however it is highly
recomanded that you do so if you are using [program] in a perl script
since command lines passed through a command of the type:
open([program],"|$commandLine"); can create unexpected returns or loops
if no quotes are used. "
"unexpected returns" and "loops"? How about "unexpected deleted files
on your file system", and "system break-ins"?
So I should use quotes: Ok, so this should be safe:
open([program],"|$prog -w \"search words\" -p subject");
(I'M JOKING! - don't do that)
BTW -- thanks for the help.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Fri, 01 Oct 1999 14:06:39 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Validating email addresses.
Message-Id: <Pd3J3.20829$m4.79649806@news.magma.ca>
Abigail <abigail@delanet.com> wrote in:
news:slrn7v8ual.8i.abigail@alexandra.delanet.com...
>
> We've had this question many times in this newgroups, with all
> sorts of attempts to do it all in a wacky regex.
>
> But why use a regex if there's this wonderful Parse::RecDescent
> module of Damian Conway? Here's a module using Parse::RecDescent
> to check the syntax of email addresses.
>
> Have fun.
>
Thanks a lot! Here are some results of my experiments:
The following _are_ valid addresses according to RFC822
and are recognized as such by Abigail's package:
use RFC::822::Address qw /valid/;
print "Valid 1\n" if valid ('-@[]');
print "Valid 2\n" if valid ('"
"."
isn\'t that a silly address?
"@-');
print "Valid 3\n" if valid ('"hihi haha".hoho."huhu hehe"@[]');
I don't know if i have an installation or a Perl version problem but
addresses following the rule:
mailbox = phrase route-addr
are not considered valid on my system.
use RFC::822::Address qw /valid/;
print "Valid 4\n" if valid ('Abigail <abigail@delanet.com>');
print "Valid 5\n" if valid ('Abigail <@a,@b,@c:abigail@delanet.com>');
print "Valid 6\n" if valid ('"this is a phrase" <abigail@delanet.com>');
Could someone please check the results of my example addresses which are
all valid as far as i understand RFC822, but Abigail's package doesn't
accept the examples 4-6 on my system.
------------------------------
Date: Fri, 01 Oct 1999 09:04:21 -0400
From: Marc Pawlowsky <marcpawl@nortelnetworks.com>
Subject: Web Site duplicator
Message-Id: <37F4B155.19FDC2C2@nortelnetworks.com>
Before reinventing the wheel, is there a perl library/module that
copies a web site to a local hard drive, and modifies the links
so the info can be viewed off-line?
The use I am envision is to copy documentation to a CD-ROM so I can
view it when not hooked up to the net.
Thanks
Marc
------------------------------
Date: Fri, 01 Oct 1999 12:43:29 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: why use references - in laymans terms?
Message-Id: <37F4AC70.551A253E@home.com>
[posted & mailed]
Anno Siegel wrote:
>
> Jonathan Stowe <gellyfish@gellyfish.com> wrote in comp.lang.perl.misc:
> >
> >Maybe it was bitten before it was dead ...
>
> Maybe it was, but that doesn't have the appropriate yuck appeal.
Maybe it was bitten to death.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Fri, 1 Oct 1999 13:30:25 +0100
From: "Justin Wyllie" <justin@comms81.freeserve.co.uk>
Subject: Win32 Modules
Message-Id: <7t29qk$l5$1@news4.svr.pol.co.uk>
Hello
I am looking for a module to experiment with DBM, any one of the
implementations would do. I would like to locate a binary (at my own risk,
of course) one if anyone can point me in the right direction. The purpose of
the exercise is to learn about this module which I will eventually implement
on a server to which I have only remote access, running Linux.
thanks
Justin Wyllie
email to: jwyllie81@cs.com
------------------------------
Date: Fri, 1 Oct 1999 14:54:38 +0200
From: "Laurent.Laperrousaz" <l.laperrousaz@net-clic.net>
Subject: Re: Win32 Modules
Message-Id: <7t2b7t$as4$1@jaydee.iway.fr>
On WIn32, in native PERL you have SDBM available which is very similar to
GDBM, NDBM or DBM which run on U**X.
for the differences, look at the TIEHASH examples on the Documentation at:
http://www.perl.com/pub/doc/manual/html/lib/GDBM_File.html
http://www.perl.com/pub/doc/manual/html/lib/SDBM_File.html
http://www.perl.com/pub/doc/manual/html/lib/NDBM_File.html
http://www.perl.com/pub/doc/manual/html/lib/AnyDBM_File.html
------------------------------
Date: Fri, 01 Oct 1999 13:10:32 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Win32 Modules
Message-Id: <cp2J3.616$QE1.38703@newshog.newsread.com>
Justin Wyllie (justin@comms81.freeserve.co.uk) wrote:
> I am looking for a module to experiment with DBM, any one of the
> implementations would do. I would like to locate a binary (at my own risk,
> of course) one if anyone can point me in the right direction. The purpose of
> the exercise is to learn about this module which I will eventually implement
> on a server to which I have only remote access, running Linux.
I don't understand the question -- Perl comes with AnyDBM_File
out of the box (or tarball, or zip), which'll work on
Windows and UNIX. Was that the question? You can install other
DBM files if you need faster/better support.
Scott
------------------------------
Date: Fri, 1 Oct 1999 15:38:58 +0100
From: "Justin Wyllie" <justin@comms81.freeserve.co.uk>
Subject: Re: Win32 Modules
Message-Id: <7t2hbr$51d$1@news4.svr.pol.co.uk>
Thanks Laurent
I was embarrassed to discover about the SDBM module by reading the Win32 FAQ
just after my posting. Your pointers to where I can see about the
differences will come in useful.
Thanks.
JW
Laurent.Laperrousaz <l.laperrousaz@net-clic.net> wrote in message
news:7t2b7t$as4$1@jaydee.iway.fr...
> On WIn32, in native PERL you have SDBM available which is very similar to
> GDBM, NDBM or DBM which run on U**X.
> for the differences, look at the TIEHASH examples on the Documentation at:
> http://www.perl.com/pub/doc/manual/html/lib/GDBM_File.html
> http://www.perl.com/pub/doc/manual/html/lib/SDBM_File.html
> http://www.perl.com/pub/doc/manual/html/lib/NDBM_File.html
> http://www.perl.com/pub/doc/manual/html/lib/AnyDBM_File.html
>
>
>
>
------------------------------
Date: 1 Oct 1999 12:36:46 GMT
From: Kingpin <mthurn@tasc.com>
Subject: WWW::Search 2.04 released
Message-Id: <7t29su$4j4$1@play.inetarena.com>
perl module WWW::Search 2.04 has been released!
Look for it soon on a CPAN mirror near you.
--
- - Martin "Kingpin" Thurn mthurn@tasc.com
Research Software Engineer (703) 793-3700 x2651
The Information Refinery http://tir.tasc.com
TASC, Inc. http://www.tasc.com
I have a really bad feeling about this. -- Han, Return of the Jedi
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 963
*************************************