[7406] in Perl-Users-Digest
Perl-Users Digest, Issue: 1031 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 16 10:28:48 1997
Date: Tue, 16 Sep 97 07:00:41 -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, 16 Sep 1997 Volume: 8 Number: 1031
Today's topics:
Re: about using 'require' with NT (Jeremy D. Zawodny)
Re: compiling perl 5.004 on linux 2.* with Dynaloader wedekin@ibm.net
Re: compiling perl 5.004 on linux 2.* with Dynaloader <godzilla@futuris.net>
Re: does \1 \2 \3 work? (my mistake is..where..?) (Matti Kinnunen)
Re: does \1 \2 \3 work? (my mistake is..where..?) <eike.grote@theo.phy.uni-bayreuth.de>
Re: does \1 \2 \3 work? (my mistake is..where..?) <eike.grote@theo.phy.uni-bayreuth.de>
Failing one test <n.sittampalam@southampton.gov.uk>
Re: FTP Commands (Jeremy D. Zawodny)
Re: Gotcha regarding parsing comma separated lines and (Bart Lateur)
How do I check who is connected to my socket? <michaels@mekb2.sps.mot.com>
Re: I'm in an idiom rut ... (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Re: Inserting \n in a string (Charles DeRykus)
Re: is there a better way to do this subroutine? <ghowland@hotlava.com>
Re: is there a better way to do this subroutine? <rbush@up.net>
Re: Is there a simpler syntax for: defined $a && $a ne (Johan Vromans)
Re: Newbie Question: Passing parameters <hd@elfie.rhein-neckar.de>
Re: Parsing e-mail folder (newbie) <ghowland@hotlava.com>
Re: Parsing e-mail folder (newbie) (Jeremy D. Zawodny)
passing Perl objects across the network <tgdbuch4@gd2.swissptt.ch>
Re: passing Perl objects across the network <rjm2@cornell.edu>
Re: Q:here document (Tad McClellan)
Re: Randal Schwartz: Menace to society? (Michael Tempsch)
Re: Slogans (Was Re: perl and XEmacs) (Chris Nandor)
Re: SQL program that works both in Win'95 and Linux (Jeremy D. Zawodny)
Re: Submit Using Image <cwyatt@cris.com>
Re: Submit Using Image (Jeremy D. Zawodny)
Re: Submit Using Image <flavell@mail.cern.ch>
Re: WWW & Password Access <ghowland@hotlava.com>
Xbase Module and Database Questions <jerome@marketing.co.uk>
Re: Xbase Module and Database Questions (Clay Irving)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Sep 1997 12:29:21 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: about using 'require' with NT
Message-Id: <341e7b85.433194931@igate.hst.moc.com>
[cc'd automagically to original author]
On Mon, 15 Sep 1997 15:01:17 -0700, Y Chen <yinso@u.washington.edu>
wrote:
>sorry for the repost, but no one answered my question, I guess it just got
>lost in the many emails posted in this newsgroup. Hope someone gets to
>read this email this time :)
>
>I am using NT 4.0 along w/ Website 1.1 and ActiveWare Perl 307. And
>whenever I do a require, it just doesn't want to work w/ the CGI scripts.
>I got an error message saying that the cgi doesn't produce an new line to
>separate the header and the body. I wonder if anyone knows what's going
>on?
At first glance, it sounds like a permissions or path problem... Are
any error messages generated?
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Mon, 15 Sep 1997 22:03:51 -0700
From: wedekin@ibm.net
To: Pat Trainor <ptrainor@aura.title14.com>
Subject: Re: compiling perl 5.004 on linux 2.* with Dynaloader
Message-Id: <341E1337.51F3@ibm.net>
Pat Trainor wrote:
>
> No room on the subject line to say that this wasn't a pleasant
> story.
> After several attempts at compiling perl on the above box, it was
> evident that getting DynaLoader to install properly was going to be a
> pain.
> Msqlperl was the major problem (MsqlPerl-1.11), as this was/is the
> exhumed report:
>
> Can't load module Msql, dynamic loading not available in this perl.
> (You may need to build a new perl executable which either supports
> dynamic loading or has the Msql module statically linked into it.)
> at /web/htdocs/pc/digest.pl line 6
> BEGIN failed--compilation aborted at /web/htdocs/pc/digest.pl line 6
>
> I guess I don't have to, but here's line 6:
>
> use Msql;
>
> Anyway, a search in FAQs and WWW revealed that DynaLoader was
> originated from:
>
> /usr/src/perl5.004/ext/DynaLoader/
>
> And the README there says:
>
> "The dl_*.xs files should either be named after the dynamic linking
> operating system interface used if that interface is available on more
> than one type of system, e.g.:
> dlopen for dlopen()/dlsym() type functions (SunOS, BSD)
> dld for the GNU dld library functions (linux, ?)
> or else the osname, e.g., hpux, next, vms etc."
>
> ..the files in the dir (and choices in Configure are:
>
> root[/usr/src/perl5.004/ext/DynaLoader]> ls -l *xs
> -r--r--r-- 1 root root 13270 Jan 24 1997 dl_aix.xs
> -r--r--r-- 1 root root 3589 Apr 4 16:50 dl_cygwin32.xs
> -r--r--r-- 1 root root 4754 Jan 24 1997 dl_dld.xs
> -r--r--r-- 1 root root 6130 Apr 23 14:20 dl_dlopen.xs
> -r--r--r-- 1 root root 3784 May 8 11:24 dl_hpux.xs
> -r--r--r-- 1 root root 6801 Apr 25 09:55 dl_next.xs
> -r--r--r-- 1 root root 272 Oct 18 1994 dl_none.xs
> -r--r--r-- 1 root root 12931 Apr 24 13:14 dl_vms.xs
>
> ..so.. I assumed dl_dld.xs was for the linux i586 box.
>
> Here's some notes from sh Configure:
>
> Use which C compiler? [cc]
>
> Checking for GNU cc in disguise and/or its version number...
> You are using GNU cc 2.7.2.1.
>
> ------
>
> Checking for optional libraries...
> No -lsfio.
> No -lnet.
> No -lsocket.
> No -linet.
> No -lnsl.
> No -lnm.
> Found -lndbm (shared).
> Found -lgdbm (shared).
> Found -ldbm (shared).
> Found -ldb (shared).
> No -lmalloc.
> Found -ldl (shared).
> No -ldld.
> No -lld.
> No -lsun.
> Found -lm (shared).
> Found -lc (shared).
> No -lcposix.
> No -lposix.
> No -lndir.
> No -ldir.
> No -lcrypt.
> No -lucb.
> No -lBSD.
> No -lPW.
> No -lx.
>
> --------- eek!
>
> I think this may have something to do with my problem:
>
> Checking your choice of C compiler, libs, and flags for coherency...
> I've tried to compile and run a simple program with:
>
> cc -O2 -Dbool=char -DHAS_BOOL -I/usr/local/include
> -L/usr/local/lib -o try try.c -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc
> ./try
>
> and I got the following output:
>
> /usr/i486-linux/bin/ld: cannot open -ldl: No such file or directory
> I can't compile the test program.
> (The supplied flags might be incorrect with this C compiler.)
>
> You have a BIG problem. Shall I abort Configure [y]
>
> ----------
>
> mind you, /usr/i486-linux/bin/ld _is_ there, it's another file
> it's arguing about.
>
> If I continue on, hoping for the best, I notice there is a problem
> with pp.o/pp.c compiling. I trust I don't have to bore you with that
> output.
> Anyway, my 5.003 +suid patch was from a cd distribution, and
> worked well. So, after I force it through and try it, I realize how bad
> this is, and restore the /usr/binperl link to the old 5.003 executable.
> One thing is wrong, though.. Now all access to dbm files that was ok with
> 5.003 does not work. Core dumps, error_log shows incomplete script
> (really?!).
> I'll re-write the dbm access scripts to use msql, but now I seem
> to be stuck between versions, unable to fully either go back or go ahead.
>
> Any ideas, or similar horror stories? If I'm ignorantly leaving
> some scrap of pivotal info out, forgive me as I just got pretty
> comfortable with the programming in perl! Now the compilation is kicking
> my butt!
>
> As always, thanks very, very much in advance.
>
> pat
> :)
>
> # ptrainor@aura.title14.com (PT46) ptrainor@bbnplanet.net
> # Perl, PHP/FI, *NIX, HTML, CGI, SQL, RDBMS, NT*, Security, Admin, ...
> # "I've got LOTS of experience doing practically nothing!" -Heffer Wolfe
I also am trying to install perl on a linux box. My linux is from a
slackware cd
and perl5.001 comes with it. I installed perl when I installed the
linux from the
cd. But I think there is something wrong with it because when I typed
in a sample
program from page 10 of Programming Perl by O'Reilly & Associates, Inc.
it gives
me an error message about <GRADES> being uninitialized. So I downloaded
the latest
perl5.004.001 from the internet and tried to install that. It was a
latest.tar.gz
file that I had to gunzip. After all the files were placed into their
own directory
I did sh configure. A lot of stuff scrolled by as perl was configuring
itself.
While it was scrolling by I saw a message that said "you have problems"
but it
scrolled by too fast for me to see what exactly the problems were. I
then tried
to do a "make" to build the new perl. When I did I got a message saying
that I
should not try it because it would not work. It advised me not to
proceed and to
e-mail doughera@lafcol.lafayette.edu. I guess what I need to do is find
a way
to test that my linux is installed properly and then to slow down the
error messages
so I can see why "I have problems" before I can try to find a way to fix
the
problem.
------------------------------
Date: 16 Sep 1997 08:38:11 -0400
From: Les Schaffer <godzilla@futuris.net>
Subject: Re: compiling perl 5.004 on linux 2.* with Dynaloader
Message-Id: <m2raapa0y4.fsf@futuris.net>
> Pat Trainor wrote:
> > No room on the subject line to say that this wasn't a pleasant
> > story.
there will be a happy ending, though....
> >
> > "The dl_*.xs files should either be named after the dynamic linking
> > operating system interface used if that interface is available on more
> > than one type of system, e.g.:
> > dlopen for dlopen()/dlsym() type functions (SunOS, BSD)
> > dld for the GNU dld library functions (linux, ?)
you want to use the dlopen function (the documentation is wrong here). so use:
> > root[/usr/src/perl5.004/ext/DynaLoader]> ls -l *xs
> > -r--r--r-- 1 root root 6130 Apr 23 14:20 dl_dlopen.xs
> > ..so.. I assumed dl_dld.xs was for the linux i586 box.
worng...
you may want to check and make sure your dl libs are up to date:
(gustav)/lib/: ls -l libdl*
-rwxr-xr-x 1 root root 37319 Sep 16 00:08 libdl-2.0.5.so*
lrwxrwxrwx 1 root root 14 Sep 16 00:08 libdl.so.2 -> libdl-2.0.5.so*
mine is from glibc-2.0.5(c).
for the older libc5 you should have a libdl.so.1.* file.
also,if you are using glibc, make sure you use the GNU dynamic loader:
(gustav)/lib/: ls -l ld-*
-rwxr-xr-x 1 root root 161220 Sep 16 00:08 ld-2.0.5.so*
lrwxrwxrwx 1 root root 11 Sep 16 00:08 ld-linux.so.2 -> ld-2.0.5.so*
this is the new gnu loader for glibc2.
this is for the older libs:
lrwxrwxrwx 1 root root 13 Aug 13 04:46 ld-linux.so -> ld-linux.so.1*
lrwxrwxrwx 1 root root 17 Aug 13 04:46 ld-linux.so.1 -> ld-linux.so.1.9.5*
-rwxr-xr-x 1 root root 22637 Aug 10 23:32 ld-linux.so.1.9.5*
then all should be well with DynaLoad....
Les Schaffer
------------------------------
Date: 16 Sep 1997 14:38:46 +0300
From: matti@universe.pc.helsinki.fi (Matti Kinnunen)
Subject: Re: does \1 \2 \3 work? (my mistake is..where..?)
Message-Id: <lzn2ldtrnc.fsf@universe.pc.helsinki.fi>
to count vowels on a line I'd use something like:
echo "aasdasdasasoiiu" | perl -pe 's/[aieouy]/_/g' | perl -pe 's/[^_]//g' | perl -pe 's/(_*)/length($1)/e'
HTH
- matti -
--
* matti.kinnunen@helsinki.fi *
* http://universe.pc.helsinki.fi/~matti/contact.html *
* +358-(0)40-593 50 91 but try first +358-(0)9-191 23978 *
------------------------------
Date: Tue, 16 Sep 1997 14:24:03 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: does \1 \2 \3 work? (my mistake is..where..?)
Message-Id: <341E7A63.446B@theo.phy.uni-bayreuth.de>
Hi,
Matti Kinnunen wrote:
>
> to count vowels on a line I'd use something like:
>
> echo "aasdasdasasoiiu" | perl -pe 's/[aieouy]/_/g' | perl -pe 's/[^_]//g' | perl -pe 's/(_*)/length($1)/e'
Why that long and complicated ?
echo "aasdasdasasoiiu" | perl -pe '$_=tr/aieouy//'
Bye, Eike
--
======================================================================
Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
e-mail -> eike.grote@theo.phy.uni-bayreuth.de
WWW -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html
http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================
------------------------------
Date: Tue, 16 Sep 1997 14:47:14 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: does \1 \2 \3 work? (my mistake is..where..?)
Message-Id: <341E7FD2.794B@theo.phy.uni-bayreuth.de>
Hi,
Richard Freytag wrote:
>
> Run the following and you should see that the vowels get pulled out
> of _all_ the example strings and matched. But in the last 6 cases
> they don't; please why?
[code snipped]
There seems to be something rather strange going on ...
I've tried the following (simpler) examples:
$s = 'xx';
$s =~ /^([x])([x])/; # works fine
print "\$1 = $1\n\$2 = $2\n"; # gives 'x' and 'x'
$s = 'xx';
$s =~ /^([x])(\1)/; # fine, too
print "\$1 = $1\n\$2 = $2\n"; # gives 'x' and 'x'
$s = 'xx';
$s =~ /^([x])([\1])/; # (like in the original posting)
print "\$1 = $1\n\$2 = $2\n";
In the last case my Perl (5.004_01) says:
Use of uninitialized value at ./test.pl line 5.
Use of uninitialized value at ./test.pl line 5.
$1 =
$2 =
Anybody out there who can explain why ?
Bye, Eike
--
======================================================================
Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
e-mail -> eike.grote@theo.phy.uni-bayreuth.de
WWW -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html
http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================
------------------------------
Date: 16 Sep 1997 10:19:58 GMT
From: "Nagu Sitttampalam" <n.sittampalam@southampton.gov.uk>
Subject: Failing one test
Message-Id: <01bcc28a$308306e0$7d05fa80@inv-09884-nagu.southampton.gov.uk>
Hello
I am trying to install perl v5.003 on a SUN Solaris 2.5.1 machine. I am
getting one test which is failing
op/undef.......ok
op/unshift.....ok
op/vec.........ok
op/write.......ok
lib/anydbm.....ok
lib/bigint.....ok
lib/bigintpm...ok
lib/db-btree...ok
lib/db-hash....ok
lib/db-recno...ok
lib/dirhand....FAILED on test 3
lib/english....ok
lib/filehand...ok
lib/gdbm.......ok
lib/ndbm.......ok
lib/odbm.......ok
lib/posix......ok
lib/safe.......ok
lib/sdbm.......ok
lib/socket.....ok
lib/soundex....ok
Failed 1 test, 98.94% okay.
u=0.27 s=0.27 cu=8.94 cs=5.82 files=94 tests=1968
$
Can anybody give me a clue as to what is missing or what I have not done to
get this error.
Thank You.
Nagu Sittampalam - CPS Southampton City Council
email - nagu@southampton.gov.uk
------------------------------
Date: Tue, 16 Sep 1997 12:31:53 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: FTP Commands
Message-Id: <341f7c00.433317808@igate.hst.moc.com>
[cc'd automagically to original author]
On Mon, 15 Sep 1997 17:51:45 -0700, <alpengeist@msn.com> wrote:
>Can any please tell me how to use cgi for ftp? Thanks...
Someone in the proper newsgroup can. Try one of the CGI-related
newsgroup, as your question isn't Perl-specific. CGI scripts can be
developed in most any language.
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 16 Sep 1997 12:39:21 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Gotcha regarding parsing comma separated lines and the FAQ
Message-Id: <341e671e.417704@news.tornado.be>
Mark Atwood <zot@ampersand.com> wrote:
>I was trying to parse a database of CSV lines, and some of the values
>are URLs and so look like
>
>"foo","http://domain/path/part/","bar"
>
>but some were like
>
>"baz","http://domain/path\part\","zug"
>
>(Bloody Microsoft brainwashed droids....)
>
>And so parsewords would see the pair \" and interpret it as the
>character " instead of the end of string delimiter, and then blow up
>with a "Unmatched quote" error when it reached the EOL for that
>record.
This style of quoting quotes isn't Microsoft compatible. I know most of
you people don't like the "Microsoft way", but since many of those CSV
will be generated on PC's the following is relevant.
In M$ compatible CSV files, a quote is inserted by DOUBLING it, not by
putting a backslash in front of it.
Example: The text
"Drive", he said.
will on a PC be encoded as
"""Drive"", he said."
while parsewords seems to expect
"\"Drive\", he said."
On a PC, the backslash is just an ordinary character.
Bart.
------------------------------
Date: Tue, 16 Sep 1997 14:32:34 +0100
From: Michael Scott <michaels@mekb2.sps.mot.com>
Subject: How do I check who is connected to my socket?
Message-Id: <341E8A72.8949D73E@mekb2.sps.mot.com>
Hello out there.
I am in the process of writing my first client-server programs with
sockets, but have encountered a problem. I can check what (remote)
machine connected to the server port, but cannot find a simple way
of finding out who owns the remote (client) process. Any suggestions?
--
=======================================================================
Michael Scott email: michaels@mekb2.sps.mot.com
CACTG ISD Product Engineering WACCVM: R11630
Motorola Ltd, Telephone: +44 1355 565247
East Kilbride G75 0TG, Fax: +44 1355 246335
Scotland.
------------------------------
Date: Tue, 16 Sep 97 09:02:28 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: I'm in an idiom rut ...
Message-Id: <341e85d7$1$ofn$mr2ice@speaker.kf8nh.apk.net>
In <341dd3fd.1413769@news.one.net>, on 09/16/97 at 12:34 AM,
over@the.net (dave) said:
+-----
| >| while( @_ > 0 )
| >| {
| >| last unless defined $_[1];
| >| $hash{$_[0]} = $_[1];
| >| shift; shift;
| >| }
| > %hash = @_;
| Now that is what I call a "trick answer" :)
+--->8
In that case, Perl is a "trick language". :-) In any case, it's not much of
a trick; it's no different from the normal way to initialize a hash:
%hash = (key, value, key, value, ...);
since the initializer is just a normal list, not "something that looks like a
list but is treated specially because the recipient is a hash". Indeed,
that's one of the older idioms in the language.
(Of course, Perl *is* a trick language. The irony is that simplifying the
syntax in Perl5 added even more tricks....)
--
brandon s. allbery [Team OS/2][Linux] bsa@void.apk.net
cleveland, ohio mr/2 ice's "rfc guru" :-) FORZA CREW!
Warpstock '97: OS/2 for the rest of us! http://www.warpstock.org
------------------------------
Date: Mon, 15 Sep 1997 19:50:50 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Inserting \n in a string
Message-Id: <EGKF4r.Cns@bcstec.ca.boeing.com>
In article <5vi4ge$3ll$1@solaris.cc.vt.edu>, Matt Weber <mweber@vt.edu> wrote:
>I want to insert a new line (\n) every 75 charectors in a string...any
>suggestions? I just don't know what function to use.
>
A regex is a possibility, e.g.,
$string =~ s/(.{75})/$1\n/g;
HTH,
--
Charles DeRykus
------------------------------
Date: Tue, 16 Sep 1997 10:25:12 +0200
From: Gary Howland <ghowland@hotlava.com>
Subject: Re: is there a better way to do this subroutine?
Message-Id: <341E4268.7DAD@hotlava.com>
Raymond K. Bush wrote:
>
> Tom Phoenix wrote:
> >
> > I'll say it right here. :-) Don't use a typeglob if you can use a
> > reference instead. References are better in every way: faster, more
> > reliable, more efficient, easier to understand, tastes great, less
>
> I dont think references are easier to understand ... I think that's a
> subjective thing.
Sure it's subjective, but when Tom says 'easier to understand' he
means 'most people find it easier to understand'. And in this case
I think he's right - most people do find references easier to understand
than globs.
Gary
------------------------------
Date: Tue, 16 Sep 1997 07:32:55 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: is there a better way to do this subroutine?
Message-Id: <341E6E67.3D96@up.net>
Jeremy D. Zawodny wrote:
>
> [cc'd automagically to original author]
>
> On Mon, 15 Sep 1997 15:45:39 -0400, "Raymond K. Bush" <rbush@up.net>
> wrote:
>
> >> I'll say it right here. :-) Don't use a typeglob if you can use a
> >> reference instead. References are better in every way: faster, more
> >> reliable, more efficient, easier to understand, tastes great, less
> >
> >I dont think references are easier to understand ... I think that's a
> >subjective thing.
> >Now as for speed yes its faster. I put a call in a loop and waited.
> >Then did the same for
> >a reference version. I did see ssome obscure mention in the FAQ about
> >speed but nothing else ...
> >if it's such an issue why isnt it there?
>
> Have a look at "Advanced Perl Programming", published by O'Reilly &
> Associates. The first few chapters go a long way toward where Tom is
> headed with his comments, I believe.
>
I'll buy that for 24.50+3.15 shipping! And wear it out just like my
copy of the perl 4 book (and the perl5 book i keep thumbing through).
--Ray
.70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
--- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
--- in order to receive a faster response ---
------------------------------
Date: 16 Sep 1997 13:03:24 +0200
From: JVromans@Squirrel.NL (Johan Vromans)
Subject: Re: Is there a simpler syntax for: defined $a && $a ne ''
Message-Id: <wl3wwkhzfk3.fsf@plume.nl.compuware.com>
Randal Schwartz <merlyn@stonehenge.com> writes:
> Russell> $a = 1 if $a eq '';
>
> Or, to be Way Cooler (as we say on the left coast):
>
> $a ||= 1;
Not quite. This one sets $a to 1 if $a == 0.
-- Johan
------------------------------
Date: 16 Sep 1997 00:08:28 +0200
From: Heinz Diehl <hd@elfie.rhein-neckar.de>
Subject: Re: Newbie Question: Passing parameters
Message-Id: <5vkbks$1t1$1@elfie.rhein-neckar.de>
Jeff Motter <jmotter@fgi.net> wrote:
: I have a script named "me.pl" and I want to pass a filename to the script
: when it is started.
: Ex: c:\perl\me.pl data.txt".
: What would be the variable for the file "data.txt" in the script. I'm
: going to open the file in the script to parse it.
Have a look at @ARGV, it contains the commandline-options.
open (IN, "< $ARGV[0]") || die "Can't open $ARGV[0]: $!\n";
If you want to know how many options are given, you can use
$#ARGV (number of elements -1):
die "Usage: $0 [file]\n" if $#ARGV < 0;
Regards, Heinz.
--
# Heinz Diehl, 68259 Mannheim, Germany
# PGP-encrypted mails welcome, key on request [subj: get pgpkey]
------------------------------
Date: Tue, 16 Sep 1997 10:31:24 +0200
From: Gary Howland <ghowland@hotlava.com>
To: dave@hmw.com
Subject: Re: Parsing e-mail folder (newbie)
Message-Id: <341E43DC.557F@hotlava.com>
David W. Wong wrote:
>
> In the next few days I will need to create (or help create) a script
> that will parse the e-mail folder file on a UNIX (actually, SGI IRIX)
> system to get the most recent message and output that message to an
> external text file. The file will be inserted (via server-side include)
> into an HTML file.
>
> To better illustrate the situation, here it is: the crew of a yacht on
> an ocean voyage will be e-mailing their status, messages, etc. to an
> e-mail account on our central server. The most recent message will be
> posted to the HTML page, where visitors of the site can read the
> message.
>
> I'm not looking for a complete solution, but if anyone has/can explain
> how to create a script that will parse the mail folder file and extract
> the most recent message, it would be tremendous help.
If you are using 'mh' then life should be easy. A command along the
lines of 'show +inbox last' will display the last mail message you
received.
Do a search on MH for more information.
Gary
------------------------------
Date: Tue, 16 Sep 1997 12:34:31 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Parsing e-mail folder (newbie)
Message-Id: <34217cb3.433496975@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 16 Sep 1997 00:36:27 -0700, "David W. Wong"
<hmw-dave@pplus.best.com> wrote:
>In the next few days I will need to create (or help create) a script
>that will parse the e-mail folder file on a UNIX (actually, SGI IRIX)
>system to get the most recent message and output that message to an
>external text file. The file will be inserted (via server-side include)
>into an HTML file.
>
>To better illustrate the situation, here it is: the crew of a yacht on
>an ocean voyage will be e-mailing their status, messages, etc. to an
>e-mail account on our central server. The most recent message will be
>posted to the HTML page, where visitors of the site can read the
>message.
There are modules on CPAN which have been built to specifically handle
mail folders. Check 'em out and you'll be saving yourself a lot of
time.
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 16 Sep 1997 09:59:19 +0200
From: Bueche Charles <tgdbuch4@gd2.swissptt.ch>
Subject: passing Perl objects across the network
Message-Id: <341E3C57.C5668176@gd2.swissptt.ch>
Hi all,
Is there some Perl module enabling easy object passing between
networked machines ?
I know I can use the socket libs, but I would like a layer on top of
it enabling stuff like :
client :
$h = connect(server, process);
send(@Perl_array, $h);
client :
$h = listen(server);
@Perl_array = receive($h);
The CPAN section 5 doesn't seem to have such a module. Any pointer
welcome.
--
Charles Bueche (PGP key available)
http://home.worldcom.ch/~cbueche
IS-B-5, Communication Services
Swiss Telecom, Bern, Switzerland
------------------------------
Date: Tue, 16 Sep 1997 08:50:40 -0400
From: "Richard J. Marisa" <rjm2@cornell.edu>
To: Bueche Charles <tgdbuch4@gd2.swissptt.ch>
Subject: Re: passing Perl objects across the network
Message-Id: <Pine.OSF.3.96.970916084514.24354A-100000@cupid.cit.cornell.edu>
On Tue, 16 Sep 1997, Bueche Charles wrote:
> Hi all,
>
> Is there some Perl module enabling easy object passing between
> networked machines ?
Take a look at DATA::Dumper
This will package an instance of an object as text.
This is most of the work; send and receive are easy additions...
Richard Marisa, Special Projects: Electronic Publishing Initiatives
Office of Information Technology, Cornell University
110 Maple Avenue, Room 109, Ithaca, NY 14850
rjm2@cornell.edu (607) 255-7636
> I know I can use the socket libs, but I would like a layer on top of
> it enabling stuff like :
>
> client :
> $h = connect(server, process);
> send(@Perl_array, $h);
>
> client :
> $h = listen(server);
> @Perl_array = receive($h);
>
> The CPAN section 5 doesn't seem to have such a module. Any pointer
> welcome.
>
> --
> Charles Bueche (PGP key available)
> http://home.worldcom.ch/~cbueche
> IS-B-5, Communication Services
> Swiss Telecom, Bern, Switzerland
>
>
>
>
>
------------------------------
Date: Tue, 16 Sep 1997 06:32:14 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Q:here document
Message-Id: <unqlv5.o36.ln@localhost>
Jerry Xia (jxia@worldnet.att.net) wrote:
: I am trying to run Oracle SQL command in perl script. In shell, I can use
: something like:
: sqlplus user/passwd <<!
: select * from my_table;
: ...
: !
: How can I do this in perl ?
system "sqlplus user/passwd <<!
select * from my_table;
...
!";
Or if you want to capture the output:
@results = `sqlplus user/passwd <<!
select * from my_table;
...
!`; # backticks are run in a shell, so you do it the same as in the shell
: Thanks!
You're welcome ;-)
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Sep 1997 07:57:30 GMT
From: d1temp@dtek.chalmers.se (Michael Tempsch)
Subject: Re: Randal Schwartz: Menace to society?
Message-Id: <5vle5a$ho3$1@nyheter.chalmers.se>
In article <341E2F59.C56271AB@dannet.dk>,
Lars Thegler <lth@dannet.dk> writes:
>Joe Petrow wrote:
>> I see that Randal's story has made the big time, as I found an
>> interesting article on his situation on http://www.news.com
>Is there an URL for that article? I can't seem to find it using the search
>mechanism at www.news.com...
http://www.washingtonpost.com/wp-srv/WPlate/1997-09/15/032l-091597-idx.html
Currently (970916 09:51 MET DST) at the bottom of the start page
(http://www.news.com) too...
/Michael
--
| Linux: Turn on...Tune in...Fork out... |
| d1temp@dtek.chalmers.se | [d1temp@bigfoot.com] | [d1temp@hotmail.com] |
| Cell.Phone:+46 705487554 URL:http://www.dtek.chalmers.se/%7Ed1temp |
------------------------------
Date: Tue, 16 Sep 1997 09:14:53 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Slogans (Was Re: perl and XEmacs)
Message-Id: <pudge-ya02408000R1609970914530001@news.idt.net>
In article <kig90x064ou.fsf@jagor.srce.hr>, Hrvoje Niksic <hniksic@srce.hr>
wrote:
# Vladimir Alexiev <vladimir@cs.ualberta.ca> writes:
#
# > open(FOO,"foo") or die $OS_ERROR;
# > What's so evil about this?
#
# Perl is OK when you write it and you parse it. It is a little-bit
# less OK when you parse someone else's code, because the "intuitive"
# bits tend to byte you then.
But that is the point. Just like human languages like English, a poorly
written or intentionally obfuscated bit of code can be hard or impossible
to grok. But a well-written piece can be immediately understood by
everyone. But a higly idiomatic code sample can be understood only by
those are up to date with the language. That's what's so great about it.
This is a feature, not a bug.
If you (pl) don't like coding like this, no one will hate you for it. But
to say it is not a good language because of it is ignoring the thousands
(millions?) of people who work BEST in such an environment.
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
------------------------------
Date: Tue, 16 Sep 1997 12:33:09 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: SQL program that works both in Win'95 and Linux
Message-Id: <34207c5b.433408879@igate.hst.moc.com>
[cc'd automagically to original author]
On 16 Sep 1997 03:39:58 GMT, kiet@uclink2.berkeley.edu (kiet) wrote:
>Hi people of the world:
>
>Anyone know of a SQL program that works both in Win'95 and Linux. The
>only thing that I found are exclusive for Win'95 or Linux. Such programs
>for Win'95 are Access, MS-SQL, Fox Pro. For Linux they are mSQL, Oracle.
>I just want a mini-SQL that works in both environment.
I'd ask in one of the database newsgroups, since your question seems
to have little (if anything) to do with Perl. You'll get more helpful
answers there. :-)
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 16 Sep 1997 08:32:25 -0400
From: Charles Wyatt <cwyatt@cris.com>
Subject: Re: Submit Using Image
Message-Id: <341E7C59.4DCA@cris.com>
Chris Russo wrote:
>
> In article <874329132.641@dejanews.com>, Charles Wyatt <cwyatt@cris.com> wrote:
>
> >This must have been asked dozens of times, but a Deja News search
> >didn't yield any helpful results for me.
> >
> >Is there a common routine that allows one to convert the coordinates
> >on a given image on a GET/POST form to equal the function "submit" button?
>
> This is a PERL newsgroup.
>
> You might have more luck by posting to
> comp.infosystems.www.authoring.html, or one of the more web-based groups.
>
> Regards,
>
> Chris Russo
>
> ----------------------------------------------------------------------
> Chris Russo A-Link Network Services, Inc.
> news@russo.org Bolo me
> http://www.alink.net/~crusso
Hmmm, I thought most folks understood that Perl is the language of
choice for form processing? That's why I'm posting to a perl newsgroup.
If HTML authoring covered the topic, I wouldn't be here.
A bit over-policing, I'm afraid!
Charles
------------------------------
Date: Tue, 16 Sep 1997 12:38:12 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Submit Using Image
Message-Id: <34227d81.433703031@igate.hst.moc.com>
[cc'd automagically to original author]
On Tue, 16 Sep 1997 08:32:25 -0400, Charles Wyatt <cwyatt@cris.com>
wrote:
>Chris Russo wrote:
>>
>> In article <874329132.641@dejanews.com>, Charles Wyatt <cwyatt@cris.com> wrote:
>>
>> >This must have been asked dozens of times, but a Deja News search
>> >didn't yield any helpful results for me.
>> >
>> >Is there a common routine that allows one to convert the coordinates
>> >on a given image on a GET/POST form to equal the function "submit" button?
>Hmmm, I thought most folks understood that Perl is the language of
>choice for form processing? That's why I'm posting to a perl newsgroup.
>
>If HTML authoring covered the topic, I wouldn't be here.
Check out the CGI.pm or the CGI::* modules on CPAN. They, if anything,
are the "standard routines" for CGI development in Perl.
Good Luck,
Jeremy
--
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio
http://www.marathon.com/
Unless explicitly stated, these are my opinions only--not those of my employer.
------------------------------
Date: Tue, 16 Sep 1997 13:43:06 GMT
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Submit Using Image
Message-Id: <Pine.A41.3.95a.970916153101.30750C-100000@sp052>
On Tue, 16 Sep 1997, Charles Wyatt wrote:
(comprehensively quoting the previous discussion, including sigs. Now
trimmed in accordance with usenet convention)
> Chris Russo wrote:
> >
> > In article <874329132.641@dejanews.com>, Charles Wyatt <cwyatt@cris.com> wrote:
> > >Is there a common routine that allows one to convert the coordinates
> > >on a given image on a GET/POST form to equal the function "submit" button?
This question is no clearer than the first time I read it.
> > You might have more luck by posting to
> > comp.infosystems.www.authoring.html, or one of the more web-based groups.
Or indeed thinking about what you want to achieve, and if necessary
posting a more coherent question to comp.infosystems.www.authoring.cgi
> Hmmm, I thought most folks understood that Perl is the language of
> choice for form processing?
Perl is that language of choice for doing a lot of things. If your
question isn't about the perl language (which yours obviously wasn't)
then you're better off asking in the group that handles those other
things. In this case, even though your question is unclear, it's
obvious that you want server-side scripting (so, presumably, CGI).
> A bit over-policing, I'm afraid!
You evidently haven't been reading this group for the required
introductory period, or you wouldn't be taking this attitude.
What an image submit sends to the server is documented clearly enough in
HTML specs and tutorials. The CGI specs and tutorials show you how it
will be presented to your CGI software. Either write some code or learn
how to use CGI.pm. None of these things are questions about the perl
language.
------------------------------
Date: Tue, 16 Sep 1997 10:28:38 +0200
From: Gary Howland <ghowland@hotlava.com>
Subject: Re: WWW & Password Access
Message-Id: <341E4336.6064@hotlava.com>
Joel Shellman wrote:
>
> Tom Phoenix wrote:
> >
> > On Fri, 12 Sep 1997, Toni Makela wrote:
> >
> > > Is it possible to create system that ask validation for every one of my
> > > HTML-pages when they are accessed!
>
> This could be easily done if you had every one of your HTML documents
> fed through a cgi script. You could just require a password in the
> query string and if it wasn't there you could put up a login page. If
> the password was there, then you could send the appropriate html doc.
Never heard of server based access control? (i.e. .htaccess files).
If .htaccess files aren't up to the job, then I recommend using the
Apache web server with the mod_perl module. This will let you use perl
to do your file access control.
> TaoTree Research and Development
> Web Development/Design, Virtual Servers, hosting, Perl/CGI programming
> http://www.tou.com/rd/
!
Gary
------------------------------
Date: Tue, 16 Sep 1997 13:01:25 +0100
From: Jerome Pimmel <jerome@marketing.co.uk>
Subject: Xbase Module and Database Questions
Message-Id: <341E7515.B01EF18@marketing.co.uk>
due to the fact that the authors page on the Xbase DB module for perl
has vanished, i cant figure out whether it is likely to serve my
purpose. i need to read and write a flat file ASCII delimited DB, and i
am searching to find whether any of the PERL modules available have
concurrency checking(?) - ie: multiple users can read/write data without
loss of data. i have dowloaded and istalled Sprite, but again I have
not been able to ascertain if either Sprite or Xbase do this checking. I
have a suspicion that xBase is merely a tie in to a proprietary DB
format, in much the same was as the tie ins to Informix Databases etc.
if anyone could shed some light on these questions, i would be most
grateful. unfortuneately i have not the option to use an SQL database,
as the provider will not permit it. i am restricted to a flat file
format, and will have no more than 5000 records. however there is the
possibility that multiple users will read/write the data file(s).
jerome
------------------------------
Date: 16 Sep 1997 08:55:05 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Xbase Module and Database Questions
Message-Id: <5vlvj9$5ce@panix.com>
In <341E7515.B01EF18@marketing.co.uk> Jerome Pimmel <jerome@marketing.co.uk> writes:
>due to the fact that the authors page on the Xbase DB module for perl
>has vanished, i cant figure out whether it is likely to serve my
>purpose. i need to read and write a flat file ASCII delimited DB, and i
>am searching to find whether any of the PERL modules available have
>concurrency checking(?) - ie: multiple users can read/write data without
>loss of data. i have dowloaded and istalled Sprite, but again I have
>not been able to ascertain if either Sprite or Xbase do this checking. I
>have a suspicion that xBase is merely a tie in to a proprietary DB
>format, in much the same was as the tie ins to Informix Databases etc.
Xbase.pm only reads Xbase files.
--
Clay Irving <clay@panix.com> http://www.panix.com/~clay/
------------------------------
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 1031
**************************************