[6902] in Perl-Users-Digest
Perl-Users Digest, Issue: 527 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 27 17:09:50 1997
Date: Tue, 27 May 97 14:00:44 -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, 27 May 1997 Volume: 8 Number: 527
Today's topics:
"Open" instruction does'nt work... <postmaster@aspen.namur.be>
Re: ?my($foo)=shift;? <rootbeer@teleport.com>
Re: adduser.pl script I wrote <rootbeer@teleport.com>
ANNOUNCE: perl ldap module using .XS (Bart Hartgers)
Re: AWK vs Perl For Misc Data Processing Tasks (Charles F. Randall)
Re: CGI in Perl for WinNT <rootbeer@teleport.com>
Re: comp.lang.perl.web (Kyzer)
Re: comp.lang.perl.web (Tung-chiang Yang)
database record check <fergy@tomco.net>
garbled output to file <chrysafis@geocities.com>
Re: getting started... <alan@spam.me.not.com>
Re: Help w/ associative arrays <vladimir@cs.ualberta.ca>
HELP: IIS+perl+application <fribeiro@dcc.unicamp.br>
I'm having problems with my "here document" syntax <jp@dkstat.com>
Re: I'm having problems with my "here document" syntax (Shane Furlong)
Re: I'm having problems with my "here document" syntax (Nathan V. Patwardhan)
Re: I'm having problems with my "here document" syntax <rootbeer@teleport.com>
Installation Problem Perl306/PerlIS on NT 4.0 SP3 <roland@intershop.de>
Magical Auto-increment operator <robp@electriciti.com>
Re: Mass emailing (Gerard Hickey)
Re: Perl & database <rootbeer@teleport.com>
Re: Perl and ms-access <d.j.evans@rdg.ac.uk>
Re: Perl online manuals/tutorials <rootbeer@teleport.com>
Perl Packages <dmead@btg.com>
Problem with <> <bromberek@cems.umn.edu>
Re: Problem with <> <rootbeer@teleport.com>
Problems with h2ph (.ph files give errors) (Amit Bhati)
Re: PURE PERL .gif creating library needed; not in @#$ <rootbeer@teleport.com>
Re: questions about chop (Chipmunk)
Re: questions about chop (Chipmunk)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 May 1997 16:50:21 +0200
From: Nachtergale Veronique <postmaster@aspen.namur.be>
Subject: "Open" instruction does'nt work...
Message-Id: <338AF4AD.2404@aspen.namur.be>
Hello everybody,
Could someone help me ?
In the first time, I have a lot of Perl scripts that run on an Netscape
Server on Windows NT.
I use the libraries: CGI.pm and Carp.pm.
Now, I have installed IIS 3.0 and PerlIs on Windows NT 4.0 Server. Then,
I runs my Perl script
on the IIS 3.0 Server on NT 4.0, with Perl for Win32 version 5.003_07
build 306.
I also use PerlIS.
The execution of Perl scripts is right if executed with perl.exe. But
they don't execute
correctly with PerlIS.
BUT the problem appears with Carp.pm, when using PerlIS:
--------------------------------------------------------
When I attempt to use carp.pm, all is wrong. The Perl scripts doesn't
execute correctly. The problem seems to be in the following instruction
in
the Carp.pm:
open(SAVEERR, ">&STDERR");
open(STDERR, ">&$no") or
( print SAVEERR "Unable to redirect STDERR: $!\n" and exit(1) );
Does someone have ideas about this ?
To verify this, I write the following little test
(OK, the script could by written in a more effective manner,
but.... it is a simple test, and it exists only to test the execution of
the "open" instruction).
When executed without the "open" instruction, the script executes
correctly.
But, with the "open" instruction, the script displays the first two
lines and then stops.
I don't undestand why...
So, could someone help me ? Any idea about this ?
------------------------------------------------------------
print "Content-Type: text/html\n\n";
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Hello World</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<HR>";
print "<H4>Hello World </H4>\n";
print "<P>\n";
print "Beginning of the test: <BR>\n";
print "<BR>";
open (TEST, ">&STDOUT");
print "Open successfull.... <BR>\n";
print "<BR>";
print "<H4>Have a nice day</H4>\n";
print "<HR>";
print "</BODY>\n";
print "</HTML>\n";
-------------------------------------------------------------
Thanks in advance for your help.
Veronique Nachtergaele
------------------------------
Date: Tue, 27 May 1997 12:35:44 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: alex <alex.t.silverstein@bender.com>
Subject: Re: ?my($foo)=shift;?
Message-Id: <Pine.GSO.3.96.970527123358.8179P-100000@kelly.teleport.com>
On Tue, 27 May 1997, alex wrote:
> in perlref I get the following, but I can't figure out what the "my $x =
> shift" lines are doing. I know what shift() and my() do. But I get the
> feeling this is s'thing else going on here.
> sub newprint {
> my $x = shift; #huh?
That makes a my variable, $x, in the scope of the sub newprint. Then it
shifts the first argument passed to the sub, and puts it into $x. That is
to say, $x gets the first argument, and now the argument list is one
element shorter.
> return sub { my $y = shift; print "$x, $y!\n"; };
> }
> $h = newprint("Howdy");
> $g = newprint("Greetings");
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Tue, 27 May 1997 12:22:03 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Luke Burton <hagus@goulburn.net.au>
Subject: Re: adduser.pl script I wrote
Message-Id: <Pine.GSO.3.96.970527121741.8179L-100000@kelly.teleport.com>
On 27 May 1997, Luke Burton wrote:
> Subject: adduser.pl script I wrote
> # we'll start looking for a new UID from this number onwards
> $trial = 700;
>
> while ((@pw = getpwuid($trial)) != NULL) {
> $trial++;
> }
There's a concurrency problem here, since two people might be
simultaneously adding users at once. Also, what is NULL?
> if ($password = NULL) {
I don't think that's going to do what you want. :-)
> system("cp /bin/ls /home/$username/bin/ls");
That's odd. You're giving every user his or her own copy of /bin/ls? Why?
And wouldn't a symlink be better?
You probably should provide a way for the user to cleanly abort the
script, too. Good luck with your project!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 27 May 1997 19:45:48 GMT
From: barth@stack.nl (Bart Hartgers)
Subject: ANNOUNCE: perl ldap module using .XS
Message-Id: <5mfdlc$l11$1@nadine.teleport.com>
ANNOUNCING my version of a perl ldap module. This first public edition has
version number 0.2. It contains all the functionality (you'll ever need) of
RFC 1823, but using a perlish OOP interface. It uses the .XS system and
requires a RFC 1832 compatible C-library, but there is a pointer to UMich's
free implementation on my web-page.
I wrote this module because:
- I needed to talk LDAP from a perl script.
- I did not like the other .XS.
- The 'official' Net::Ldap version (an all-perl one) isn't finished yet.
- I like to program.
Check it out on http://www.stack.nl/~barth/Ldap !
--
// Bart Hartgers <bart@oke.nl> <A.Hartgers@stud.tue.nl> <barth@stack.nl>
// Snail: Jan tooropstraat 39/42 5642AJ - Eindhoven - The Netherlands
// Voice: ++31-402815565 Finger: barth@turtle.stack.nl
// Unsolicited Commercial E-mail is NOT appreciated!
------------------------------
Date: 27 May 1997 09:03:27 -0600
From: crandall@free.click-n-call.com (Charles F. Randall)
Subject: Re: AWK vs Perl For Misc Data Processing Tasks
Message-Id: <5met3v$2uf$1@free.click-n-call.com>
[Note: copy of this article sent directly to Nathan via e-mail]
Nathan T. Wild <nwild@codville.mb.ca> wrote:
>We are porting some AWK-based systems over to NT, and I am wondering
>whether I should invest in the NT version of our AWK compiler, or just take
>this opportunity to switch to Perl?
This has been discussed at length many times. Search DejaNews
(http://www.dejanews.com/) for examples. An easy way to do this is to
create a custom query filter with the newsgroups comp.lang.awk and
comp.lang.perl.* and do your searches from there.
Some interesting threads are:
perl and awk
perl vs [n]awk ?
Awk vs. Perl
In the long run, I think you'll find Perl more flexible and more
useful.
You may find it useful to run your existing Awk code through the 'a2p'
converter ("a2p - Awk to Perl translator") and benchmark the results
(we'd probably be interested too).
-Randy
--
Charles F. Randall With Click-n-Call, you can put a button
crandall@click-n-call.com on a Web page that can initiate an H.323
http://www.click-n-call.com/ Internet phone call to a plain old telephone.
------------------------------
Date: Tue, 27 May 1997 12:05:00 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jed Brewer <gbrewer@impala.ir.miami.edu>
Subject: Re: CGI in Perl for WinNT
Message-Id: <Pine.GSO.3.96.970527120439.8179G-100000@kelly.teleport.com>
On Tue, 27 May 1997, Jed Brewer wrote:
> I am having trouble porting cgi scripts I had written in perl to handle
> forms (get method) from unix to the latest version of Windows NT. If
> anyone has any pointers, suggestions, comments, or anything at all that
> could help, please send them my way.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to
solving such problems. It's available on the perl.com web pages. Hope
this helps!
http://www.perl.com/perl/
http://www.perl.com/perl/faq/
http://www.perl.com/perl/faq/idiots-guide.html
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 27 May 1997 17:11:38 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: comp.lang.perl.web
Message-Id: <5mf4ka$51v@info.abdn.ac.uk>
Aaron M. Scarisbrick, while smelling of fish, wrote:
: comp.lang.perl.web
: I'd say half the threads here have to do with the web, html, cgi and would
: probably do better in a group of their own. Comments would be appreciated.
What about
comp.lang.perl.internet
comp.lang.perl.information-superhighway
comp.lang.perl.ora.sales
comp.lang.perl.fan.randal.schwartz
comp.lang.perl.fan.tom.christiansen
comp.lang.perl.fan.larry.wall
comp.lang.perl.fan.regexp
comp.lang.perl.obfuscate
comp.lang.perl.japhs
alt.2600.perl (all these perl 'hacker's !)
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
Sir, a transmission from zone 669881a - a transmission of priviledged code!
------------------------------
Date: Tue, 27 May 1997 18:38:26 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: comp.lang.perl.web
Message-Id: <tcyangEAurs3.6q7@netcom.com>
Since Randal complains often that people misspell his name, we should have
comp.lang.perl.fan.randall.schwartz
too.
========================
: Aaron M. Scarisbrick, while smelling of fish, wrote:
: What about
: comp.lang.perl.internet
: comp.lang.perl.information-superhighway
: comp.lang.perl.ora.sales
: comp.lang.perl.fan.randal.schwartz
: comp.lang.perl.fan.tom.christiansen
: comp.lang.perl.fan.larry.wall
: comp.lang.perl.fan.regexp
: comp.lang.perl.obfuscate
: comp.lang.perl.japhs
: alt.2600.perl (all these perl 'hacker's !)
--
Tung-chiang Yang tcyang@netcom.com
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: Tue, 27 May 1997 13:14:40 -0400
From: Linda Ferguson <fergy@tomco.net>
Subject: database record check
Message-Id: <338B167F.696A@tomco.net>
Hi,
I'm a perl (and programming) newbie who would appreciate any and all
suggestions for a project I've been tasked with...
I work for a company that provides web-based access to various
databases. Most of the dbs are updated daily. Recently we've had
problems -- our data providers have not always given us the most recent
data. I've been asked to write a script that will check to make sure
that the records have been loaded properly.
I'm checking CPAN and the various help sites out there, but i haven't
found anything (yet) that addresses this type of situation.
TIA,
LJ
------------------------------
Date: Tue, 20 May 1997 18:20:24 GMT
From: George <chrysafis@geocities.com>
Subject: garbled output to file
Message-Id: <3381EB67.309D@geocities.com>
hi, I just started using Perl w/CGI and...
I'm getting a multi-line (textarea) input field from a Web page using
the ReadParse subroutine from cgi-lib.pl then writing that to a file
as well as back to the web browser (STDOUT). The output looks good at
the browser but the file contains partial lines, some appear to have
been written over by others...
I tried formatting the file output, same results.
Thanks, partial code follows (hopefully including the culprit)... gc
&ReadParse # returns the $in array.
$in{'STATUS'} =~ s/\0/ /g; # field sent by browser
@statusvals=split ('ZZZ',$in{'STATUS'}); # multiple, blank separated
# fiel, ZZZ delimeter
open(OUTFILE, "> tempout") || die "$!\n";
#---------------------------------------------------#
# print details for each ID problem #
#---------------------------------------------------#
format OUTFILE_TOP=
=========================================================
| Report Page @<<< |
$%
=========================================================
.
format OUTFILE=
STATUS: @*
"$status"
.
for ($i=0;$i<$count;$i++){
# print to file
#
$status="$statusvals[$i]";
write OUTFILE;
}
close OUTFILE;
exit;
------------------------------
Date: Tue, 27 May 1997 15:06:13 -0400
From: Alan Gutierrez <alan@spam.me.not.com>
Subject: Re: getting started...
Message-Id: <338B30A5.961C2250@spam.me.not.com>
Arathena Sprankle wrote:
>
> ok..
>
> i figured out that you are supposed to create the file in notepad and then
> test it in the dos box brought up when I execute perl.exe. However when I
> tesed a simple file..
>
> #! /perl/bin/perl
> print "Hello, world!";
>
> The file is kept in c:\hello.pl
> perl.exe is in c:\perl\bin\perl.exe
>
> when I type "perl c:\hello.pl"
> I get an error "syntax error at - line 3, near "c:"
>
> What exactly is happening here?
>
> marien@goodnet.com
I have an installation on NT. It works fine. It works wonders.
Did you try - c:\perl\bin\perl.exe hello.pl
Make sure perl in in your path, it helps.
Open the control panel for NT and go to system settings, chose the
environment tab,
edit your path or the systems path by adding the directory where perl is
installed.
I do hope you can figure it out from the environment tab.
Then instead of perl c:\hello.pl try - perl hello.pl
Hope this helps!
--
(A)lan (J)ames Gutierrez
alan at cybernet.com
------------------------------
Date: 25 May 1997 21:27:54 -0600
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
Subject: Re: Help w/ associative arrays
Message-Id: <omlo523oat.fsf@tees.cs.ualberta.ca>
In article <v7v6m5.4q.ln@localhost> tadmc@flash.net (Tad McClellan) writes:
> > 01 is interpreted in octal
> '01' is interpreted in decimal
Well, I consider this to be a bug. Is it described anywhere in the docs?
------------------------------
Date: 27 May 1997 18:35:28 GMT
From: "Fernando Souza Ribeiro" <fribeiro@dcc.unicamp.br>
Subject: HELP: IIS+perl+application
Message-Id: <01bc6acd$0ab05720$040310ac@bamp01.fcc.org.br>
Please, answer this mail with copy to fribeiro@dcc.unicamp.br Thank you
----------------------------------------------------------------------------
--------------------------------------
Hi,
I'm using:
* IIS 2.0
* NT 4.0
* one perl cgi-script (perl5)
* this perl script calls one DOS application (WWWISIS.EXE). I don't have
the
source code for this application.
Some lists in Internet have described two forms to map perl scripts to
work with IIS:
1) .pl : REG.SZ: <path>\perlIS.dll
With this configuration, I run the perl script calling WWWISIS.EXE and
all works successfully when I'm using browsers Internet Explorer and
Netscape for
Linux. But it doesn't run with Netscape for PC's because the server doesn't
send
the correct headers ("Content-type...") and the browser tries to download
the apllication.
2) .pl : REG.SZ: <path>\perl.exe %s %s
With this configuration, I run successfully one simple perl script with
any browser, but I can't call WWWISIS.EXE. The process stays stalled until
the
timeout... I think that this is because the DOS version of the application.
Some docs
say that it needs 32 bits application.
I have already included the registry:
\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters
Value name: CreateProcessWithNewConsole
Data type: REG_DWORD
Data value: 1
I have restarted IIS and the problem has continued.
Is there any kind of to solve this problem, whithout one 32
bits recompilation (as I said before I don't have the source code).
Thank you for any kind of suggestion
Fernando
------------------------------
Date: Tue, 27 May 1997 11:07:41 -0700
From: Jean-Paul Cozzatti <jp@dkstat.com>
Subject: I'm having problems with my "here document" syntax
Message-Id: <338B22ED.DA783CDE@dkstat.com>
I'm using the following code: copied from Gundavaram...CGI Programming
print <<End_Of_HTML
Content-type: text/html
..
..
..
End_Of_HTML
but I'm getting an error message that says:
Can't find string terminator "End_Of_HTML" anywhere before EOF at
filename...
I'm following all the hints laid out on page 43 of Programming Perl for
"Here documents"...
does anyone have any ideas on what I'm doing wrong?
JP
------------------------------
Date: 27 May 1997 19:00:16 GMT
From: psf@evolving.com (Shane Furlong)
Subject: Re: I'm having problems with my "here document" syntax
Message-Id: <5mfb00$hnt$1@citadel.evolving.com>
Jean-Paul Cozzatti (jp@dkstat.com) wrote:
: I'm using the following code: copied from Gundavaram...CGI Programming
: print <<End_Of_HTML
: Content-type: text/html
: ..
: ..
: ..
: End_Of_HTML
: but I'm getting an error message that says:
: Can't find string terminator "End_Of_HTML" anywhere before EOF at
: filename...
: I'm following all the hints laid out on page 43 of Programming Perl for
: "Here documents"...
: does anyone have any ideas on what I'm doing wrong?
Try a ";" after the print statement:
print <<End_Of_HTML;
--
Shane Furlong
------------------------------
Date: 27 May 1997 18:56:39 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: I'm having problems with my "here document" syntax
Message-Id: <5mfap7$bi1@fridge-nf0.shore.net>
Jean-Paul Cozzatti (jp@dkstat.com) wrote:
: I'm using the following code: copied from Gundavaram...CGI Programming
: print <<End_Of_HTML
: Content-type: text/html
: ..
: ..
: ..
: End_Of_HTML
print <<End_Of_HTML;
your text here
End_Of_HTML
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Tue, 27 May 1997 12:32:53 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jean-Paul Cozzatti <jp@dkstat.com>
Subject: Re: I'm having problems with my "here document" syntax
Message-Id: <Pine.GSO.3.96.970527122835.8179N-100000@kelly.teleport.com>
On Tue, 27 May 1997, Jean-Paul Cozzatti wrote:
> Subject: I'm having problems with my "here document" syntax
>
> I'm using the following code: copied from Gundavaram...CGI Programming
>
> print <<End_Of_HTML
There are two things that might be wrong. One is that you normally need to
put a semicolon at the end of that statement. The other, which is the
cause of this problem nearly 100% of the time, is that the "ending quote"
for this here-doc needs to say exactly
End_Of_HTML
on a line by itself, with no character after the L but a newline and no
character before the E but the preceding newline. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Tue, 27 May 1997 17:03:11 +0200
From: Roland Faszauer <roland@intershop.de>
Subject: Installation Problem Perl306/PerlIS on NT 4.0 SP3
Message-Id: <338AF7AF.972@intershop.de>
Hi folks,
I've got a problem using PerlIS.dll (build 306) on NT 4.0 SP 3 running
IIS 3.0
When I try to access my perl script I get the following error:
HTTP/1.0 500 Server Error (A dynamic link library (DLL) initialization
routine failed.)
I used to run Perl110/PerlIS.dll with IIS 2.0 on NT4.0 SP 2 and checked
- the permission to the path for the dll/executables/scriptes,
- my script mapping for IIS (.plx to perlis.dll)
- that I send a HTTP/1.0 200 OK header
Perl itself is working fine on the command line and with IIS (.pl mapped
to perl.exe).
I'm clueless ... :-(
Regards
Christian
PS: What happens to http://www.divinf.it/perl-win32/index.sht the
Perl-Win32-Archive ?
The last update was in January.
------------------------------
Date: Tue, 27 May 1997 11:46:23 -0700
From: Rob Perelman <robp@electriciti.com>
Subject: Magical Auto-increment operator
Message-Id: <338B2BFF.3CDA@electriciti.com>
I am a little confused by Perl's handling of the magical auto-increment
operator. In the second edition of the Camel, it is explained on page
79 that the variable must match the pattern /^[a-zA-Z]*[0-9]*$/ for it
to be interpreted as a string. Why is this? Shouldn't the ++ operator
work as such so that it should test to see if the variable is a number,
and if it is not, treat it as a string? To illustrate my question, I
have written a function called plusplus() to do what I expected Perl's
++ to do. Below is the function and a few test calls to show Perl and
my discrepencies. If anyone could explain why Perl isn't more robust on
this sort of handling, I would appreciate it...
#!/usr/local/bin/perl
foreach ('0', '99', 'z', 'Z', 'fh09', 'fh99', '', 'cs2#09', 'cs2#99',
'a1z9') {
$arg = $_;
printf("Testing %-10s I say %-10s Perl says %-10s Matches? %s\n",
"'$arg'", $test = plusplus($arg), ++$arg, $test eq $arg ? 'Yes' :
'No');
}
sub plusplus {
my($arg, $pos, $last) = (shift, length($arg));
while ($pos--) { substr($arg, $pos, 1) = chr(ord($last) + 1), return
$arg
unless (($last = substr($arg, $pos, 1)) eq '9' or lc $last eq 'z' or
$last !~ /^\w$/);
substr($arg, $pos, 1) = $last = chr(ord($last) - ($last eq '9' ? 9 :
25))
if ($last =~ /^\w$/);
}
return (($arg =~ /\D/ ? $last : '1') . $arg);
}
------------------------------
Date: Tue, 27 May 1997 13:39:50 -0400
From: hickey@alphapower.com (Gerard Hickey)
Subject: Re: Mass emailing
Message-Id: <MPG.df4e66f7304e028989680@news.tiac.net>
In article <3385A6AC.4FB7@nettipaja.clinet.fi>, lauri@nettipaja.clinet.fi
says...
> I am working with mass mailing system (not spam, user have to register
> first), and I need to know what is best way to send same email to
> all of @emails ?
>
> open (MAIL, "|$mailprog $mail1 $mail2 $mail3") || die "Can't open
> $mailprog!\n";
>
> ...works fine, but there may will be hundreds or thousands of
> addresses...
>
Have you looked at Majordomo? Majordomo does several things that make it
easier to implement a mailing list.
Why re-invent the wheel if it is not broken?
------------------------------
Date: Tue, 27 May 1997 12:07:30 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Miran Sepic <miran.sepic4@mss.tel.hr>
Subject: Re: Perl & database
Message-Id: <Pine.GSO.3.96.970527120535.8179H-100000@kelly.teleport.com>
On 27 May 1997, Miran Sepic wrote:
> I have to make a list which will contain usernames and dates of expiration
> of their maintenance agreement:
>
> username1:date1
> username2:date2
> ........................
> username(x):date(x)
>
> How can I open such file, use split function (split /:/ - something like
> that), and compare date(x) with today's date?
First you open the file (use open, documented in perlfunc), then you can
read in the data a line at a time (use <FILE>, documented in perlop), then
use a date module (from CPAN) to parse and compare the date. Hope this
helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Tue, 27 May 1997 17:44:54 +0100
From: "David J. Evans" <d.j.evans@rdg.ac.uk>
Subject: Re: Perl and ms-access
Message-Id: <338B0F85.31B9@rdg.ac.uk>
Sasha Higer wrote:
>
> Does anybody have a experience of connecting Perl with
> microsoft access database.
> I saw the activeware's faq (9.4) but it's not detailed enough.
> thanks.
Check out Win32::ODBC by Dave Roth - it does this and includes a demo
that shows it doing his. Also check the ODBC faqs that can be found
linked from the home of Win32::ODBC ....
http://www.roth.net/users/rothd/perl/
David
------------------------------
Date: Tue, 27 May 1997 12:04:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ighon <ighon@infostrada.it>
Subject: Re: Perl online manuals/tutorials
Message-Id: <Pine.GSO.3.96.970527120317.8179F-100000@kelly.teleport.com>
On Sun, 25 May 1997, Ighon wrote:
> Where I can find Perl online manuals/tutorials ?
On most systems, you can start by typing 'man perl'. You also can find
good things on CPAN. Hope this helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Tue, 27 May 1997 13:28:14 -0400
From: Dave Mead <dmead@btg.com>
Subject: Perl Packages
Message-Id: <338B19AD.177E6922@btg.com>
Where can I get a list of the various Perl packages' function blurbs?
For example, are there any documents out there that tell you what the
arguments, return values ,etc., of all of the functions in the FTP
package are? Please respond to both the group and my email address.
Thanks in advance,
Dave Mead
dmead@btg.com
------------------------------
Date: Tue, 27 May 1997 14:21:17 -0500
From: Bruce Bromberek <bromberek@cems.umn.edu>
Subject: Problem with <>
Message-Id: <338B342D.41C6@cems.umn.edu>
I'm writing a script to process datafiles
while($filename = <*.dat>)
will return every file in the current directly that matches the above
pattern *.dat
I tried to be sneaky and make the pattern a command line option
$pat = $ARGV[0];
but I found that
while($filename = <$pat>)
will return only the first match.
What am I missing?
Bruce Bromberek
------------------------------
Date: Tue, 27 May 1997 12:44:44 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bruce Bromberek <bromberek@cems.umn.edu>
Subject: Re: Problem with <>
Message-Id: <Pine.GSO.3.96.970527124218.8179S-100000@kelly.teleport.com>
On Tue, 27 May 1997, Bruce Bromberek wrote:
> while($filename = <*.dat>)
>
> will return every file in the current directly that matches the above
> pattern *.dat
>
> I tried to be sneaky and make the pattern a command line option
>
> $pat = $ARGV[0];
>
> but I found that
>
> while($filename = <$pat>)
>
> will return only the first match.
The pattern is being expanded by the shell, so your program only sees the
first match in $ARGV[0]. You could quote the argument, typing '*.dat' for
example, but that's a nuisance. The easy way (since it's already been
expanded by the shell) is to simply use @ARGV instead of globbing within
your code.
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 27 May 1997 19:33:52 GMT
From: amit@visi.com (Amit Bhati)
Subject: Problems with h2ph (.ph files give errors)
Message-Id: <5mfcv0$241$1@darla.visi.com>
Having trouble using h2ph.
ksh> h2ph sys/param.h
Then, following 'required' clauses in param.h, and so on, I created
the following files (by running h2ph) on my AIX 4.1.4 system:
/usr/local/perl5.003a/lib/rs6000/5.003/
float.h
standards.h
/usr/local/perl5.003a/lib/rs6000/5.003/sys/
limits.ph
m_param.ph
param.ph
/usr/local/perl5.003a/lib/rs6000/5.003/jfs
fsparams.h
Doing,
ksh> perl -e 'require "sys/param.ph";'
to test things out, results in the errors shown below. Can anyone tell
me whats up?
Operator or semicolon missing before &e at (eval 89) line 1.
Ambiguous use of & resolved as operator & at (eval 89) line 1.
Operator or semicolon missing before &F at (eval 89) line 1.
Ambiguous use of & resolved as operator & at (eval 89) line 1.
Operator or semicolon missing before &e at (eval 90) line 1.
Ambiguous use of & resolved as operator & at (eval 90) line 1.
Operator or semicolon missing before &F at (eval 90) line 1.
Ambiguous use of & resolved as operator & at (eval 90) line 1.
Operator or semicolon missing before &e at (eval 92) line 1.
Ambiguous use of & resolved as operator & at (eval 92) line 1.
Operator or semicolon missing before &e at (eval 93) line 1.
Ambiguous use of & resolved as operator & at (eval 93) line 1.
Operator or semicolon missing before &e at (eval 98) line 1.
Ambiguous use of & resolved as operator & at (eval 98) line 1.
Operator or semicolon missing before &F at (eval 98) line 1.
Ambiguous use of & resolved as operator & at (eval 98) line 1.
Operator or semicolon missing before &e at (eval 104) line 1.
Ambiguous use of & resolved as operator & at (eval 104) line 1.
Bare word found where operator expected at (eval 119) line 1, near "&
&SINFINITY"
(Missing operator before SINFINITY?)
Operator or semicolon missing before &SINFINITY at (eval 119) line 1.
Ambiguous use of & resolved as operator & at (eval 119) line 1.
Operator or semicolon missing before &e at (eval 98) line 1.
Ambiguous use of & resolved as operator & at (eval 98) line 1.
Operator or semicolon missing before &F at (eval 98) line 1.
Ambiguous use of & resolved as operator & at (eval 98) line 1.
Operator or semicolon missing before &e at (eval 104) line 1.
Ambiguous use of & resolved as operator & at (eval 104) line 1.
Bare word found where operator expected at (eval 119) line 1, near "&
&SINFINITY"
(Missing operator before SINFINITY?)
Operator or semicolon missing before &SINFINITY at (eval 119) line 1.
Ambiguous use of & resolved as operator & at (eval 119) line 1.
Bare word found where operator expected at (eval 122) line 1, near "&
&SQNAN"
(Missing operator before SQNAN?)
Operator or semicolon missing before &SQNAN at (eval 122) line 1.
Ambiguous use of & resolved as operator & at (eval 122) line 1.
Bare word found where operator expected at (eval 124) line 1, near "&
&SSNAN"
(Missing operator before SSNAN?)
Operator or semicolon missing before &SSNAN at (eval 124) line 1.
Ambiguous use of & resolved as operator & at (eval 124) line 1.
Number found where operator expected at (eval 174) line 1, near ")2"
(Missing operator before 2?)
Number found where operator expected at (eval 175) line 1, near ")1"
(Missing operator before 1?)
--
amit
------------------------------
Date: Tue, 27 May 1997 12:14:14 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Alexander Petrosyan <paf@fbit.msk.su>
Subject: Re: PURE PERL .gif creating library needed; not in @#$ C language or external modules. PERL!
Message-Id: <Pine.GSO.3.96.970527121143.8179I-100000@kelly.teleport.com>
On 27 May 1997, Alexander Petrosyan wrote:
> I'm looking for a PURE PERL library of manipulating GIF images. Perl,
> Perl and only Perl. Without patching perl sources / attaching external
> C language libraries.
Why? The external libraries are written to add speed and simplicity to
what would be slow and difficult to do in Perl directly. If you can't
compile them, your efforts would be better spent at getting a compiler to
work.
> Wanna write count.pl, which outputs "content-type: image/gif".
Not another web counter! :-)
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 27 May 1997 14:18:43 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: questions about chop
Message-Id: <5meqg3$hut$1@dartvax.dartmouth.edu>
In article <5mcdke$1p9@guardian.cba.ua.edu>
jrobert1@guardian.cba.ua.edu (Jeff Robertson) writes:
> In article <5mb40n$tqr$2@dartvax.dartmouth.edu>,
> Chipmunk <Ronald.J.Kimball@dartmouth.edu> wrote:
> >
> >substr($_, -7) = ""; # there's more than three ways to do it
>
> That works, but it makes me wonder -- how is it that Perl allows
> a call to substr to be used as an lvalue ? Is substr a special,
> magical case, or is there a more general mechanism at work here ?
> Could a subroutine be written which exhibits this behavior ?
> How would it do it, by somehow knowing whether it was being used
> as an lvalue or not ?
This is how the 1st Camel explains it:
substr(EXPR, OFFSET, LENGTH)
substr(EXPR, OFFSET)
...
You can use the substr() function as an lvalue, in which case EXPR must
be an lvalue. If you assign something shorter than LENGTH, the string
will shrink, and if you assign something longer than LENGTH, the string
will grow to accomodate it.
---
It looks like substr() is a special case.
It's not hard to know whether something is being used as an lvalue or
not - is it on the left hand side of an assignment or not?
Chipmunk
------------------------------
Date: 27 May 1997 18:38:38 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: questions about chop
Message-Id: <5mf9ne$14t$1@dartvax.dartmouth.edu>
In article <5md1ac$oso$1@mathserv.mps.ohio-state.edu>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> [A complimentary Cc of this posting was sent to Chipmunk
> <Ronald.J.Kimball@dartmouth.edu>],
> who wrote in article <5mb5l6$lrf$4@dartvax.dartmouth.edu>:
> > In article <5m7gib$bgi$1@mathserv.mps.ohio-state.edu>
> > ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> > > > $line = substr( $line, 0, -2);
>
> > > Note also that the second usage is not documented:
>
> > > If LEN is negative, leaves that many characters off the end of the string.
>
> > It looks pretty well documented to me.
>
> Stoopid me, I've read it as
> substr( $line, 0, -2) = "";
> !!! (which indeed would be hard to explain - if it worked as described ;-).
That would replace everything except the last two characters with "".
So, it would have the opposite effect - instead of removing the last
two characters, it would remove everything but the last two characters.
:-)
Chipmunk
------------------------------
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 527
*************************************