[10226] in Perl-Users-Digest
Perl-Users Digest, Issue: 3819 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 25 02:07:35 1998
Date: Thu, 24 Sep 98 23:00:20 -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 Thu, 24 Sep 1998 Volume: 8 Number: 3819
Today's topics:
.pl to .bat conversion <brianjulz@earthlink.net>
Re: any way to encrypt my script? (Ronald J Kimball)
Re: changing $ 'variables' in regexprs (David Rouse)
Re: changing $ 'variables' in regexprs (David Rouse)
Re: changing $ 'variables' in regexprs (David Rouse)
Re: Database with Perl (Eric Lee Green)
Re: Database with Perl (brian d foy)
Re: exec cgi in apache 1.3.1 (n3gzw)
Globbing directories <don@emedia.net.nz>
Help using Perl and Tk <eatonn@msn.com>
Re: Help using Perl and Tk <jdf@pobox.com>
Re: help with pattern matching (Craig Berry)
Re: help with pattern matching (Ronald J Kimball)
Re: How to activate a process on filechange? <rra@stanford.edu>
Re: How to activate a process on filechange? <sugalskd@netserve.ous.edu>
Re: How to activate a process on filechange? <igor.k@usa.net>
Re: in-place-edit regex substitution in multiple files <fredmill@jaws.greatwhite.com>
not parsing on first attempt <imchat@imchat.com>
Oracle 8.0.5 on Linux <broom@nospam-voicenet.com>
Re: Perl & Java - differences and uses <bjohnsto@usa.net>
Re: Perl under Win95 and Binary files (Ethan H. Poole)
Re: Poll: How Did You Learn Perl? Lee.Lindley@bigfoot.com
Re: sending email attachments using just perl? <maierc@chesco.com>
Re: Simple, efficient way of checking whether $VAR is a (Ronald J Kimball)
Re: Using 'use' <jdf@pobox.com>
Re: Using 'use' (Ronald J Kimball)
Re: Where to put cgi-lib.pl (Ronald J Kimball)
win32 builds <yinso@u.washington.edu>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 24 Sep 1998 18:59:00 -0700
From: Brian Day <brianjulz@earthlink.net>
Subject: .pl to .bat conversion
Message-Id: <360AF8E3.B75A11F1@earthlink.net>
I used the pl2bat file that comes with the perl distribution to convert
a perl script to a batch file. I'm on a Win95 system, and whenever I
call any of my standard batch files by name alone they work fine.
However, even if I give the explicit path to the converted .bat file, I
still get a "bad command or filename" message. The only way it works is
if I am actually in the c:\perl\bin directory and call it with the
explicit path c:\perl_work\hello
Is there any way to get this to work by simply typing hello while in
c:\perl_work ???
Any info is greatly appreciated
Thanks,
Brian Day
------------------------------
Date: Fri, 25 Sep 1998 01:18:35 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: any way to encrypt my script?
Message-Id: <1dfvyka.tuw5ecevgc58N@bay1-140.quincy.ziplink.net>
<bitnut1@my-dejanews.com> wrote:
> A "shc" created executable works fine from command line
> but fails when run as a CGI script (with the infamous
> "500" error; it does not carp out any message).
Check the server's error logs. If you don't know how to do that, it's
not Perl's fault. ;-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 24 Sep 1998 07:49:11 -0400
From: 4newsargus@mail.entrsft.com (David Rouse)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <4newsargus-2409980749110001@192.36.36.47>
In article <4newsargus-2209981514390001@192.36.36.47>,
4newsargus@mail.entrsft.com (David Rouse) wrote:
>Any advice welcome!
And thanks especially for the advice to try the actual documentation when
I get stuck. The O'Reilly books are nice, but you can't run grep on them.
David Rouse
------------------------------
Date: Thu, 24 Sep 1998 07:49:34 -0400
From: 4newsargus@mail.entrsft.com (David Rouse)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <4newsargus-2409980749340001@192.36.36.47>
In article <4newsargus-2209981514390001@192.36.36.47>,
4newsargus@mail.entrsft.com (David Rouse) wrote:
>Any advice welcome!
And thanks especially for the advice to try the actual documentation when
I get stuck. The O'Reilly books are nice, but you can't run grep on them.
David Rouse
------------------------------
Date: Thu, 24 Sep 1998 07:52:20 -0400
From: 4newsargus@mail.entrsft.com (David Rouse)
Subject: Re: changing $ 'variables' in regexprs
Message-Id: <4newsargus-2409980752200001@192.36.36.47>
In article <m3emt3hp6v.fsf@joshua.panix.com>, Jonathan Feinberg
<jdf@pobox.com> wrote:
>The specific method for searching Perl documentation differs depending
>on your platform. However, in general, you should use something like
>"grep" to search through the files in the pod directory that was
>created when you or your sysadmin installed perl. I happen to use
>Jeffrey Friedl's "search" program, which has many groovy features and
>accepts perl regexen. "search" is very helpful on those platforms
>which lack grep. Tom Christiansen also has a search utility, written
>in Perl. I don't know the name, off hand.
>
Thanks (everyone) and thanks for the reminder to try the actual
documentation when I get stuck. The O'Reilly books are nice, but you can't
run grep on them.
David Rouse
------------------------------
Date: 25 Sep 1998 02:10:26 GMT
From: eric@linux-hw.com (Eric Lee Green)
Subject: Re: Database with Perl
Message-Id: <14092CC329AF0C8A.C4A92FAF91181EBE.CA7C8365610C5DC7@library-proxy.airnews.net>
On Thu, 24 Sep 1998 16:09:52 -0400, brian d foy <comdog@computerdog.com> wrote:
>In article <B0B72B93CDB8E0FE.52BD4C9B77BC6560.E54CDACED0DA6285@library-proxy.airnews.net>, eric@linux-hw.com posted:
>>CGI runs on the web server.
>
>CGI doesn't run at all. it's a protocol, not a program. note that
>CGI.pm allows one to run CGI scripts from the command line without
Thank you for telling us what we already know. That still won't help
this poor newbie see the results of CGI scripts when he points his web
browser (sans web server) at files on his local CD-ROM. He'll just see
the actual perl or, at best, the non-perl parts of a 'bristled' perl
file (ePerl/ embPerl/etc.).
The guy was asking how to get "active" content on a pre-packaged CD, not
for technical details of CGI (yes I too have used CGI.pm to test CGI
scripts at the command line). Answer: He'll need to use a client-side
scripting language such as JavaScript or Java. He could use Perl as a
client-side language, if a plug-in exists for his particular browser, but
most people don't have Perl plug-ins for their browser. (Did anybody ever
finish that, anyhow?). I left that detail off too, since it would have
confused him even more.
[Sorry if I sound a little testy, been programming too much Perl CGI
lately... Perl reminds me more and more of its Camel mascot, ugly,
ill-tempered, hard to live with, and indispensible. ]
--
Eric Lee Green eric@linux-hw.com
------------------------------
Date: Thu, 24 Sep 1998 23:41:11 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Database with Perl
Message-Id: <comdog-ya02408000R2409982341110001@news.panix.com>
Keywords: from just another new york perl hacker
In article <14092CC329AF0C8A.C4A92FAF91181EBE.CA7C8365610C5DC7@library-proxy.airnews.net>, eric@linux-hw.com posted:
>On Thu, 24 Sep 1998 16:09:52 -0400, brian d foy <comdog@computerdog.com> wrote:
>>In article <B0B72B93CDB8E0FE.52BD4C9B77BC6560.E54CDACED0DA6285@library-proxy.airnews.net>, eric@linux-hw.com posted:
>>>CGI runs on the web server.
>>
>>CGI doesn't run at all. it's a protocol, not a program. note that
>>CGI.pm allows one to run CGI scripts from the command line without
>
>Thank you for telling us what we already know.
then say things that aren't true. a user agent is not required to
use a web server to communicate with a CGI program. the web is
not needed if everything is local.
>That still won't help
>this poor newbie see the results of CGI scripts when he points his web
>browser (sans web server) at files on his local CD-ROM.
it might. one can imagine a lightweight CGI server that handles the
CGI stuff. put that on the CD and run the requests to CGI scripts
through it. this takes a bit of CD authoring experience and so on,
but it's certainly possible. one might even put a specially hacked
browser on the CD. there are all sorts of possibilities, and some of
them might even use Perl.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Fri, 25 Sep 1998 02:20:37 GMT
From: n3gzw@repeater.net (n3gzw)
Subject: Re: exec cgi in apache 1.3.1
Message-Id: <360afdc6.22142391@news.epix.net>
I think the guy is looking for a command for it and where to put it.
How about some examples along with all the technical stuff.
On Thu, 24 Sep 1998 19:34:50 +0200, Sevo Stille <sevo@inm.de> wrote:
>ssantini@my-dejanews.com wrote:
>
>> What can I do inside Directory or Location sections of the config file for run
>> SSI "exec cgi" ?
>
>"Options Includes", just as in .htaccess. To repeat it: Anything that
>can go inside a .htaccess file (and some more) can go inside a directory
>context.
>
>Sevo
>
>--
>Sevo Stille
>sevo@inm.de
------------------------------
Date: Fri, 25 Sep 1998 14:06:37 +1200
From: "Don Robertson" <don@emedia.net.nz>
Subject: Globbing directories
Message-Id: <360afb80.0@news.actrix.gen.nz>
Greetings - I am running Perl 5 on win95, and am wanting to read a file list
form a directory.
the example in "learning Perl on Win 32 Systems is :
While (defined($nextname = <c:/scripts/*.plx>)){
print "one of the files is $nextname\n";
}
when I try this but with d:/acenz/*.TXT, I get an error:
Bad command or file name
Now i know I am actually hitting the script with the run command.
Any help appreciated
Don
don@emedia.net.nz
------------------------------
Date: Thu, 24 Sep 1998 22:45:16 -0500
From: "Nathan Eaton" <eatonn@msn.com>
Subject: Help using Perl and Tk
Message-Id: <eF9i3cD69GA.273@upnetnews02.moswest.msn.net>
I'm interested in using Perl and Tk to build a more visual version of one of
my Perl scripts. Any tips on the quickest way to get up to speed on Tk?
------------------------------
Date: 25 Sep 1998 06:57:39 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: "Nathan Eaton" <eatonn@msn.com>
Subject: Re: Help using Perl and Tk
Message-Id: <m3g1dg6b7g.fsf@joshua.panix.com>
"Nathan Eaton" <eatonn@msn.com> writes:
> I'm interested in using Perl and Tk to build a more visual version
> of one of my Perl scripts. Any tips on the quickest way to get up
> to speed on Tk?
At the moment there is no quick way. You must read all of the docs
that come with the Tk distribution; you must lurk comp.lang.perl.tk
and read the dejanews archives for same; you must seek out Tk examples
in the Panther book, and somehow ignore the numerous errors that
plague those examples in the first (and only) edition of same; you
must read and grok the examples of Tk composite widgets that come with
the distribution; you must write a few Tk applications and beat your
head against a few walls.
Soon there will be an O'Reilly book about Perl/Tk. Hang in there.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 25 Sep 1998 04:26:14 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: help with pattern matching
Message-Id: <6uf616$nib$1@marina.cinenet.net>
jasonW ("westi"@(remove)leland.stanford.edu) wrote:
: I am sure the answer to this is probably obvious. I don't have alot of
: experience with Perl, but I have tried everything and I cannot figure it
: out.I am trying to use perl to extract the I.P addresses out of a web
: log file. The problem is that while I can pattern match and use grep to
: only select the lines that have an i.p address in them, I don't know how
: to get rid of the rest of the information. I want to end up with an
: array that only has I.p addresses in it. If anyone can give me some
: advice, I would really appreciate it.
This quick and dirty technique will do the trick. It is deficient in that
it will match invalid IP addresses like 999.9.9.999, but should be good
enough for any practical use -- and if it's not, you're welcome to tighten
the regex, or use the one you imply you already have above in this idiom.
my @ipAddrs = ();
while (<LOG>) {
push @ipAddrs, $1 if /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/;
}
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Fri, 25 Sep 1998 01:18:39 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: help with pattern matching
Message-Id: <1dfvz6u.a47dgzigsbz1N@bay1-140.quincy.ziplink.net>
jasonW <"westi"@(remove)leland.stanford.edu> wrote:
> I am trying to use perl to extract the I.P addresses out of a web
> log file. The problem is that while I can pattern match and use grep to
> only select the lines that have an i.p address in them, I don't know how
> to get rid of the rest of the information. I want to end up with an
> array that only has I.p addresses in it. If anyone can give me some
> advice, I would really appreciate it.
{
local $/;
$file = <STDIN>;
}
@ips = $file =~ m/(\d+\.\d+\.\d+\.\d+)/g;
Replace the regex above with whatever regex you want to use to match ip
addresses. That one is not very good.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 24 Sep 1998 18:52:28 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: How to activate a process on filechange?
Message-Id: <yl7lyt557n.fsf@windlord.stanford.edu>
Beaker Ben Shapiro <bjshapir@undergrad.math.uwaterloo.ca> writes:
> I am in the situation where I need to write a program that essentially
> sits and watches a set of files to see if any one of them changes, and
> if it does, it needs to copy it quickly to a few other filenames as well
> - they are configuration files and any one of them may change.
> Obviously I can write some CPU-intensive code that checks and checks and
> checks and checksandchecksandchecks.. But that is unfeasible
> (infeasible?); also if I choose to check only every five minutes - or
> two minutes - or 10 seconds, then I am opening up windows where
> collisions may occur (well, _bigger_ windows, anyway.)..
Standard Unix semantics give no way of notifying a process when a file
changes besides polling (the algorithm you're trying to avoid). I'm not
sure about Windows, but I somewhat doubt it there too. I believe that SGI
provides its own proprietary interface for this with IRIX called fam, but
I odn't have a lot of experience with it. (And am not completely positive
that's what it does.)
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 25 Sep 1998 02:49:13 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: How to activate a process on filechange?
Message-Id: <6uf0b9$48u$1@news.NERO.NET>
Beaker Ben Shapiro <bjshapir@undergrad.math.uwaterloo.ca> wrote:
: Hi everyone - up until this time, I've been a pretty
: successful lurker on this newsgroup, but a problem has come up
: that is beyond my perl knowledge.
: I am in the situation where I need to write a program that
: essentially sits and watches a set of files to see if any one of
: them changes, and if it does, it needs to copy it quickly to a
: few other filenames as well - they are configuration files and any
: one of them may change.
: Obviously I can write some CPU-intensive code that checks
: and checks and checks and checksandchecksandchecks.. But that is
: unfeasible (infeasible?); also if I choose to check only every
: five minutes - or two minutes - or 10 seconds, then I am opening
: up windows where collisions may occur (well, _bigger_ windows,
: anyway.)..
The only way that I can think of to do this is to have your config files
reside on a VMS system that NFS-exports a chunk of the filesystem with the
files in it, then put an ACL on the file(s) that pops a notification
message to a mailbox (VMS mailbox--has nothing to do with mail. They're
more like sockets), with a perl program listening on that mailbox for the
change notices.
I don't think there are any other systems that run perl that have any sort
of mechanism to do this. (Maybe IRIX, but I'm not sure)
Dan
------------------------------
Date: Thu, 24 Sep 1998 22:17:52 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: How to activate a process on filechange?
Message-Id: <6uf8v5$5bj$1@news.ncal.verio.com>
Beaker Ben Shapiro wrote in message ...
>
> Hi everyone - up until this time, I've been a pretty
>successful lurker on this newsgroup, but a problem has come up
>that is beyond my perl knowledge.
>
> I am in the situation where I need to write a program that
>essentially sits and watches a set of files to see if any one of
>them changes, and if it does, it needs to copy it quickly to a
>few other filenames as well - they are configuration files and any
>one of them may change.
It's quite easy to monitor file-related events under Win32 (using C/C++).
I have never tried to do it in Perl, though.
Take a look at Win32::ChangeNotify module, it seems to do the trick.
As for unices, I don't know any good solution (without polling)
Regards,
Igor Krivokon
<igor.k@usa.net>
---
"Science is a differential equation. Religion is a boundary condition"
(Alan Turing)
------------------------------
Date: 23 Sep 1998 20:07:44 -0600
From: "Fred C. Miller" <fredmill@jaws.greatwhite.com>
Subject: Re: in-place-edit regex substitution in multiple files
Message-Id: <6uc9hg$4s2$1@salamander.localnet.taz>
Dr. H.-Christian Waldmann <waldmann@tiffy.fire.uni-bremen.de> wrote:
> DEAR PERL COMMUNITY
> MY DEPARTMENT RUNS STATISTICAL SOFTWARE AND APACHE-WEBSERVERS ON SEVERAL
> PLATFORMS WITH DIFFERENT DIRECTORY STRUCTURES. I HAVE TO TRANSFER LOTS
> OF FILES BETWEEN MACHINES AND ADJUST THEIR CONTENTS TO MEET HOSTSPECIFIC
> FORMATS ETC. IT'S A JOB FOR A REGEX-SUBSTITUTION TAKING EACH LINE OF EVERY
> FILE IN EVERY DIRECTORY FOR AN IN-PLACE-EDIT, THAT IS RELPACE AND WRITE TO
> THE SAME FILE.
> AS ANYBODY WILL SEE IMMEDIATELEY FROM THE CODE FRAGMENT BELOW, I AM WHAT YOU
> CALL A "NEWBIE". ANYWAY, PLEASE DON'T DIRECT ME TO THE DOCS BECAUSE I HAVE
> INDEED READ "LEARNING PERL" AND ONLINE-DOC BUT I SEEM TO BE CONSTANTLY MISS-
> SING THE MAGIC POINT.
> THE CODE BELOW MAKES UP A LIST OF DIRECTORIES FORM A "du"-STATEMENT AND
> READS THE FILENAME INTO A SCALAR (LOOP 2) AFTER CHANGING TO THAT DIRECTORY
> (LOOP 1). NOW I HAVE TO PERFORM A 's/old/new/g' ON THAT FILE ( THAT IS: ANY
> LINE IN IT). THIS IS WHERE THE TROUBLE STARTS.
I too am a relative newbie, so I won't try to run through the code
from the previous post.
I have something simpler.
----------------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
my $dir = shift; #name the start-directory on the command line
my @list;
my @files = `find $dir -type f` or die "problem with find: $!";
for (@files) {
chomp $_; #This surprised me a bit
# I thought the filenames from find would be
# null terminated
-T $_ and push @list, $_;
}
my $file;
foreach $file (@list){
my $contents = "";
open(CHANGE, "$file") or die "urp...$file will not open: $!";
while (<CHANGE>){$contents .= $_}
close CHANGE;
if ($contents =~ s/www\.fire/samson.fire/gs){
open(FIX, ">$file") or die "Cannot open $file for fixing: $!";
print FIX $contents;
close FIX;
}
}
---------------------------------------------------------------------------
The first line would need editing on most systems, I suppose.
Other than that, I think the biggest flaw with my code is
my use of a system call to \emph{find}
when I could have used \emph{find2perl} to keep everything in the script.
Still, this should be much more efficient than using \emph{du} to generate
a list of directories to search for files.
Find is your friend.
[where did I read that?]
--
fred
------------------------------
Date: Thu, 24 Sep 1998 22:21:00 -0500
From: "Mark P." <imchat@imchat.com>
Subject: not parsing on first attempt
Message-Id: <360B0C1B.AD8D2AB1@imchat.com>
Hi, having a little trouble with a script not parsing a query sent along
with the url to the script. The url is passing simple data to the script
but cgi-lib.pl seems like its slow to parse out the data and add it. If
I enter the url again everything works fine but the first attempt never
works.This is one of my first scripts so don't be cruel. :-)
The url sent is
http://imchat.com/pub/secure.cgi?amount=5.00&invoice=10068&cust_id=166&name=Mark&lastname=Porter
This script is just meant to add these items to another form. The name
stuff doesn't matter but the invoice# and amount are critical. Here's
the script.
-----------------------------------------
#!/usr/bin/perl
require "cgi-lib.cgi";
&ReadParse(*form_data);
if ($form_data{'lastname'} ne "")
{
$lastname = $form_data{'lastname'};
}
else
{
$lastname = "";
}
if ($form_data{'name'} ne "")
{
$name = $form_data{'name'};
}
else
{
$name = "";
}
if ($form_data{'cust_id'} ne "")
{
$cust_id = $form_data{'cust_id'};
}
else
{
$cust_id = "";
}
if ($form_data{'invoice'} ne "")
{
$invoice = $form_data{'invoice'};
}
else
{
$invoice = "";
}
if ($form_data{'amount'} ne "")
{
$amount = $form_data{'amount'};
}
else
{
$amount = "";
}
print "Content-type: text/html\n\n";
print "<html><head></head><body bgcolor=fffccc>";
print "<center><h2><b>Please enter all data</b></h2></center>";
print "<p><form name=secureform method=post value=secureform.cgi>";
print "<TABLE WIDTH=100% BORDER=0 cellpadding=5>";
print "<tr><td align=right>Customer Id :</td><td><input name=cust_id
value=\"$cust_id\" size=6></td></tr><tr><td
align=right>Invoice#:</td><td><input type=\"text\" size=10
name=\"Invoice#\" value=\"$invoice\"><tr><td align=right>Amount
: DM</td><td><input name=amount value=$amount
size=8></td></tr><tr><td align=right>Name :</td><td><input
type=\"text\" size=35 name=\"Name\" value=\"$name\"></td></tr><tr><td
align=right>LastName:</td><td><input type=\"text\" size=35
name=\"LastName\" value=\"$lastname\"></td></tr><tr><td
align=right>Select</td><td><select
name=\"CardType\"><option>KONTO<option>Visa<option>MasterCard<option>AmExCard<option>Discover<option>Diners
Club</select></td></tr><tr><td align=right>KONTO #:</td><td><input
name=\"KONTO\" size=\"18\" maxlength=\"19\"></tr><tr><td
align=right>Card Number:</td><td><input name=\"CardNumber\" size=\"18\"
maxlength=\"19\"></tr><tr><td align=right>Expires</td><td><select
name=\"ExpMon\"><option value=\"1\" selected>1<option
value=\"2\">2<option value=\"3\">3<option value=\"4\">4<option
value=\"5\">5<option value=\"6\">6<option value=\"7\">7<option
value=\"8\">8<option value=\"9\">9<option value=\"10\">10<option
value=\"11\">11<option
value=\"12\">12</select> Month <input name=\"ExpYear\"
size=\"2\"
maxlength=\"2\"> Year</td></tr></table></form><p><center><b>No
Submit. This is a test form.</b></center></body></html>";
exit;
------------------------------
Date: Thu, 24 Sep 1998 22:24:17 -0400
From: Barry Roomberg <broom@nospam-voicenet.com>
Subject: Oracle 8.0.5 on Linux
Message-Id: <360AFED1.C6173FA6@nospam-voicenet.com>
Anybody play with this yet?
I'm using DBD:Oracle .054 and it segmentation faults when the module is
loaded.
ARRRGGG!
------------------------------
Date: Thu, 24 Sep 1998 21:18:29 -0700
From: Brendan Johnston <bjohnsto@usa.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <360B1995.96368E91@usa.net>
[snip]
> Okay, I can see why you might like the other style,
> but I still don't know anything interesting about
> what I can do with one style that I can't do with
> the other, if we can start acting like grown ups,
> if you don't mind.
> -- Aaron Watters
I will investigate these closures more.
At this point I can't see anything more than a way to add state to a
function pointer.
Since Java's function pointers are pointers to objects they already have
a better mechanism for dealing with state than closures.
Zenin's example required references versus values. Java has references.
A language which lacked references would indeed be impoverished.
Java does not have the ideal language consturct for every occasion. It
does have a very small set of simple constructs which still cover a very
large range of design idea's. It is more of a case of bang for back
that just bang alone.
Brendan Johnston
------------------------------
Date: 25 Sep 1998 04:14:13 GMT
From: ehp@gte.net (Ethan H. Poole)
Subject: Re: Perl under Win95 and Binary files
Message-Id: <6uf5al$3va$2@news-2.news.gte.net>
[Posted and Emailed] In article <6uerjs$sua$1@plug.news.pipex.net>,
nhon@*spam*hons.compulink.co.uk says...
>
>The script below works under Linux and not under Win95. I'm trying to read
>in a JPG image and duplicate it. The file size of out.jpg(OUTFILE) is larger
>than the infile so I guess it must be carriage returns or something. Any
>ideas on solving this? Thanks in advance.
>
>---------------------
>#!/usr/bin/perl
>$fname=<STDIN>;
>open(IMG,$fname);
>open(OUT,">out.jpg");
>binmode(IMG);
>my $image;
>my $size = -s IMG;
>my $bytes=read(IMG,$image,$size);
>print OUT "$image" if $bytes==$size;
>----------------------
You need to binmode(OUT) as well.
--
Ethan H. Poole | Website Design and Hosting,
| CGI Programming (Perl & C)..
========Personal========= | ============================
* ehp @ gte . net * | --Interact2Day--
http://home1.gte.net/ehp/ | http://www.interact2day.com/
------------------------------
Date: Fri, 25 Sep 1998 03:24:51 GMT
From: Lee.Lindley@bigfoot.com
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <6uf2e3$qv7$1@nnrp1.dejanews.com>
In article <906635587.696072@thrush.omix.com>,
Zenin <zenin@bawdycaste.org> wrote:
> Matt Knecht <hex@voicenet.com> wrote:
> : When I'm done learning perl, I'll let you know! So far I've been at it
> : for almost 7 months now. I have a feeling I have quite of bit time left
> : to go.
>
> When I'm done learning perl, I'll let you know! So far I've been at it
> for almost 7 years now. I have a feeling I have quite a bit of time left
> to go.
>
> :-).
======================================================================
How did I learn perl?
======================================================================
I learned "ed" (vi wasn't available on a DEC pdp of some vintage (don't
remember which) when I first learned) and got started on regular expressions.
I read man pages on a 4410 terminal. Hey, man pages contain a lot of
information; you just have to read them carefully (meaning every single
word) a few (or 20) times.
I discovered sed and was pleased. I could do edits on the fly.
Started using ksh and learned vi. Love that vi command line in ksh.
Use C and curses to do real work. Lex and yacc are powerful, but
oh so cumbersome.
I discovered awk and read the "Aho" book and was really pleased. This
was powerful and much faster than writing C for many tasks.
Oh, these SunOS machines come with csh -- isn't this
if ($var =~ somepattern) stuff handy (well, ksh was better, but it didn't
come with the machine).
Wow. I can do a lot with an 'expr' command in a cshell script.
Hey! This language called perl 4 has lots of neat stuff!
Rather than take some boring database class, I'll just spend
some training budget money on this camel book.
Oh. Look at this Tcl/Tk stuff. I can make pretty (and useful)
windows. Expect is cool too!
Holy Cow, Batman! Perl 5 has exploded out of Perl 4 like a world
class sprinter on steroids (They don't cheat, do they?).
Along with Perl/Tk I think I can abandon these klutzy and expensive C++
toolkits. How about that new Camel book. This time I read cover to
cover. Let's try the Panther. Nice clarification on those typeglobs,
Siriam.
Let's just write code and when something doesn't work like I expect,
just do "perl -d" followed by a ctrl-d and the wicked expression that
won't behave. Live is good when you can debug your understanding of
the language with the same tool you use to debug your program.
========================================================================
Perl has every useful tool I ever learned "growing up" and many I'll
probably never master. It is so rich that the way a person "learns"
it must depend on their experience level going into it. This issue is
relatively fresh for me because I have a set of coworkers to introduce
to Perl with varied past experiences. Each is learning at their own
pace and using a variety of the available resources. The one thing I
insist on is that each have access to the Camel book. The index in
that book is worth the price.
I did not review all of the posts on this thread, so please forgive
me if I'm repeating history.
--
// Lee.Lindley@Bigfoot.com
// Be nice. It isn't that hard to do and it
// makes people happy.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 24 Sep 1998 22:14:44 -0400
From: Charles Maier <maierc@chesco.com>
Subject: Re: sending email attachments using just perl?
Message-Id: <360AFC94.38D8453B@chesco.com>
tim pickup wrote:
>
> I am writnig a perl script which sends an email built up on an html
> form on a browser. Similar to the service yahoo/hotmail provides.
>
> The problem is I want to attach a local file to the email message.
> I think yahoo.com uses java to encode the file and attach it.
> Is there a way of doing this directly using just perl?
>
> Thanks
>
> tim
Try Sender.pm
It will do normal email sends as well as atachments directly to any smtp
server using sockets.
--
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 942-2726
------------------------------
Date: Fri, 25 Sep 1998 01:18:41 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Simple, efficient way of checking whether $VAR is an element of set @LIST ?
Message-Id: <1dfw02m.1lh155i1gtje8xN@bay1-140.quincy.ziplink.net>
Douglas Clifton <doug@weboneinc.com> wrote:
> Uri Guttman wrote:
> [bitch, whine, make myself look important]
>
> The original poster wanted a simple built-in to test whether a string is a
> member of a list. We all know `exists' is the easiest way to test for a
> defined key in a hash. Sure, using grep is not particularly suitable for
> anything other than a short list, but it is simple/understandable solution.
You're saying that
grep /^$var$/, keys %hash
is somehow simpler or more understandable than
exists $hash{$var}
???
Yeah, right. You posted a poor answer. Don't bitch and whine just
because you were corrected.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 25 Sep 1998 06:49:36 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: pgiesin@my-dejanews.com
Subject: Re: Using 'use'
Message-Id: <m3iuic6bkv.fsf@joshua.panix.com>
pgiesin@my-dejanews.com writes:
> Does anybody know of a way to dynamically use 'use'?
If you read the documentation for use()
$ perldoc -f use
you'll see that use() is exactly equivalent to a construct that can be
used at run-time rather than compile-time. RTFM, and see if that
doesn't do it for you.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 25 Sep 1998 01:18:46 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Using 'use'
Message-Id: <1dfw0d1.1k6spau1n2rr5xN@bay1-140.quincy.ziplink.net>
<pgiesin@my-dejanews.com> wrote:
> Does anybody know of a way to dynamically use 'use'?
Yes.
For proof of the correctness of this answer, refer to dejanews. This
topic was discussed this very week.
(hint: search for the keywords 'use' and 'require')
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Fri, 25 Sep 1998 01:18:53 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Where to put cgi-lib.pl
Message-Id: <1dfw0rg.1y96vbv1syg4wlN@bay1-140.quincy.ziplink.net>
Patrick Timmins <ptimmins@netserv.unmc.edu> wrote:
> In article <906633948.7548@wren.supernews.com>,
> robert.van.der.elst@centric.nl (Robert) wrote:
> > I want to know where to put the cgi-lib.pl file ...
>
> Ohhhhhhhhh ... I don't know ...
>
> Please re-phrase that ... and probably in a cgi news group!
CGI newsgroups are concerned with the CGI protocol and general issues
about CGI scripts. cgi-lib.pl is specifically a Perl library. Perl
needs to be able to find it so it can load it for the script.
The same old test works in reverse, too:
Would this question also apply for a CGI script written in a language
other than Perl? Usually we gets questions where the answer is yes, and
the questions should have been asked in a CGI newsgroup.
In this case, the answer is no, making the question a Perl question and
not a CGI question.
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 24 Sep 1998 21:05:59 -0700
From: Y Chen <yinso@u.washington.edu>
Subject: win32 builds
Message-Id: <Pine.OSF.3.96b.980924210225.29532E-100000@saul7.u.washington.edu>
Hi,
I was under the impression that starting from version 5.005, the source
code between the unix & win32 version of perl is the same source. Is this
true? Also, what are the differences between the GS & ActiveStates' most
current build?
Thanks,
yin-so
------------------------------
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 3819
**************************************