[6772] in Perl-Users-Digest
Perl-Users Digest, Issue: 397 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 30 10:27:38 1997
Date: Wed, 30 Apr 97 07:00:27 -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 Wed, 30 Apr 1997 Volume: 8 Number: 397
Today's topics:
Re: Beeping sound when use cgi/perl script with apple m (Chris Nandor)
Re: BITMAPS & Backgrounds (Donal K. Fellows)
Compiling Perl5 on SUNOS <eajeong@robot.csie.ntu.edu.tw>
Re: Deleting Files <rootbeer@teleport.com>
Re: Dups in a array.. how to clear? <rootbeer@teleport.com>
Re: Executing htpasswd from within Perl (Jim Allenspach)
HELP: PERL -> EXE or C(++) !!!! <konink@telebyte.nl>
Re: HELP: PERL -> EXE or C(++) !!!! <seay@absyss.fr>
How to write '&' through Perl's decoding <O.C.Kwon@durham.ac.uk>
Re: MacPerl <-> text editor? (Chris Nandor)
Re: Multi line matching problem. Should be simple?!? (Andreas Schmidt)
Re: Notice to antispammers <rsi@lucent.com>
Re: Notice to antispammers <rsi@lucent.com>
Re: Output of sorted dated from an array into a table? <rootbeer@teleport.com>
Re: PERL Editor <wmeahan@ford.com>
Re: Perl on the Mac - hep me! (Chris Nandor)
Perl on Win95? <grantt@nortel.ca>
Perl using Microsoft Personal Web Server <jspencer@netcomuk.co.uk>
Re: Perl4 script under Perl5 interpreter (Clay Irving)
Re: push or unshift simple question <rootbeer@teleport.com>
Re: Q: Extracting multi-line text between keywords (Tad McClellan)
Re: question: how to trim a string passed via hard refe (Andreas Schmidt)
Re: servers/chmod and stuff (Clay Irving)
sourcing a ksh script within PERL <olsend@ms.FAKETAG.com>
Re: Windows 95 and FTP (Clay Irving)
WWW timeout error <Anon@Anon.com>
Re: WWW timeout error (Clay Irving)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 30 Apr 1997 09:44:18 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Beeping sound when use cgi/perl script with apple mac
Message-Id: <pudge-ya02408000R3004970944180001@news.erols.com>
In article <5k5hfd$7qv@bcrkh13.bnr.ca>, rjdavis@bhl3hc9.bnr.co.uk (Robert
Davis) wrote:
#Hi,
# I have written a cgi perl script which processes input from
# a HTML form in a web browser.
#
# This works fine on HP (HPUX) workstations. It also works
# an apple mac, but after the form has been processed,
# a succession of about 50 beeps is sounded.
#
# Has anyone else experienced this problem?
#
# Could someone tell me how to solve this problem?
I guess we'd have to see the script ...
#================================================================
When I found the skull in the woods, the first thing I did was
call the police. But then I got curious about it. I picked it
up, and started wondering who this person was, and why he had
deer horns.
--Jack Handey
Chris Nandor pudge@pobox.com
PGP Key 1024/B76E72AD http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6
------------------------------
Date: 30 Apr 1997 10:55:52 GMT
From: fellowsd@cs.man.ac.uk (Donal K. Fellows)
Subject: Re: BITMAPS & Backgrounds
Message-Id: <5k78fo$lml@m1.cs.man.ac.uk>
In article <33657016.7BB@nortel.com>,
Mohammed Shoaib <mshoaib@nortel.com> wrote:
> Is there a way in tk that I can use say a gif or bmp file as my
> background to frame or canvas.
Yes for canvases. Create an image item with the picture as its
contents, and then place that item underneath all the other objects on
the canvas. Simple!
Donal.
--
Donal K. Fellows http://r8h.cs.man.ac.uk:8000/ (SAY NO TO COMMERCIAL SPAMS!)
(work) fellowsd@cs.man.ac.uk Dept. Comp. Sci, Univ. Manchester, U.K.
| donal@ugglan.demon.co.uk 6,Randall Place, Heaton, Bradford, U.K. (home)
+-> ++44-161-275-6137 Send correspondence to my office ++44-1274-401017 <-+
------------------------------
Date: Wed, 30 Apr 1997 19:45:51 +0800
From: Euna Jeong <eajeong@robot.csie.ntu.edu.tw>
Subject: Compiling Perl5 on SUNOS
Message-Id: <336730EF.41C67EA6@robot.csie.ntu.edu.tw>
When I compiled perl5.003 on SUNOS 4.1.3 and did "make test", I met a
problem as follow:
-------------------------------
make test
AutoSplitting perl library
Making DynaLoader (static)
make[1]: Entering directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DynaLoader'
make[1]: Leaving directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DynaLoader'
make[1]: Entering directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DynaLoader'
make[1]: Leaving directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DynaLoader'
Making DB_File (static)
make[1]: Entering directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DB_File'
make[1]: Leaving directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DB_File'
make[1]: Entering directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DB_File'
gcc -c -I/usr/local/include -O -DVERSION=\"1.01\"
-DXS_VERSION=\"1.01\" -I../.. DB_File.c
In file included from DB_File.c:34:
/usr/local/include/db.h:40: sys/cdefs.h: No such file or directory
make[1]: *** [DB_File.o] Error 1
make[1]: Leaving directory
`/automount/home/nomad/tmp-collector/perl/perl5.003/ext/DB_File'
make: *** [lib/auto/DB_File/DB_File.a] Error 1
-----------------------------
I can't find "sys/cdefs.h" file in my system.
Thanks for the help.
Euna Jeong
------------------------------
Date: Wed, 30 Apr 1997 06:46:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Cristo <cristo@consotech.se>
Subject: Re: Deleting Files
Message-Id: <Pine.GSO.3.96.970430064412.29715K-100000@kelly.teleport.com>
On Mon, 28 Apr 1997, Cristo wrote:
> A quick question. How do I delete a file in Perl?
I recommend that you use the method in perlfunc(1). Search through that
for 'delete' until you find what you want.
> Second question. How do I make a back button with HTML?
I think this one is in the FAQ. But if it's not, that's because it's not a
Perl question. Try an HTML group, or their FAQ (which should tell you that
you can't do it).
> Third question. How do I create a Directory?
That should also be in perlfunc(1). 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: Wed, 30 Apr 1997 06:42:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tony Reeves <tony@vegas.es.hac.com>
Subject: Re: Dups in a array.. how to clear?
Message-Id: <Pine.GSO.3.96.970430064029.29715H-100000@kelly.teleport.com>
On 28 Apr 1997, Tony Reeves wrote:
> I'd like to know a simple way to remove any duplicates that might be in
> the file.
You might try the method from the FAQ, but it sounds as if you might be
worried that you can't hold the whole hash in memory at once. The trick is
to keep the hash in a file, which can grow as needed. Check out the
modules on CPAN for doing this. 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: 30 Apr 1997 07:20:21 -0500
From: jima@mcs.com (Jim Allenspach)
Subject: Re: Executing htpasswd from within Perl
Message-Id: <5k7de5$56i$1@Mercury.mcs.net>
>> My problem is: how in Perl would I execute htpasswd on a username and
>> feed it the password twice?
>why go through all of that trouble? it's not as if htpasswd really
>does all that much. just rewrite it in perl :) the c source to
>htpasswd comes with the apache distribution.
Or even better, see if someone else has already written it for you.
(Cough! Cough! CPAN! Cough! Cough! HTTPD::UserAdmin!)
jma
------------------------------
Date: Wed, 30 Apr 1997 13:12:47 +0200
From: "T. de Konink" <konink@telebyte.nl>
Subject: HELP: PERL -> EXE or C(++) !!!!
Message-Id: <3367292F.46B6@telebyte.nl>
Hello,
Somebody please help me. I've got this huge problem. I've wrote a set of
scripts for an chatbox using Perl under UNIX. This chatbox is now a
success and much used on the internet. That's why it causes real great
performance-problems.
QUESTIONS:
1) Can I turn perl scripts into executables ?
2) Can I turn perl scripts into C-source code (so I can compile it) ?
3) Can I configure the Perl interpeter beter, so that performance gets
better ?
4) Have you any other suggestions about how to solve my problem.
Thanks in advance,
T. de Konink
------------------------------
Date: Wed, 30 Apr 1997 14:54:19 +0100
From: Douglas Seay <seay@absyss.fr>
Subject: Re: HELP: PERL -> EXE or C(++) !!!!
Message-Id: <33674F0B.67FA4FBA@absyss.fr>
T. de Konink wrote:
>
> Hello,
>
> Somebody please help me. I've got this huge problem. I've wrote a set of
> scripts for an chatbox using Perl under UNIX. This chatbox is now a
> success and much used on the internet. That's why it causes real great
> performance-problems.
>
> QUESTIONS:
> 1) Can I turn perl scripts into executables ?
Look into the perl compiler (at a CPAN site near you).
> 2) Can I turn perl scripts into C-source code (so I can compile it) ?
See #1
> 3) Can I configure the Perl interpeter beter, so that performance gets
> better ?
Look into shared libraries and make sure that perl was compiled with the
highest level of optimization that your compiler supports. You might
want to strip the executable to make it smaller if you are worried about
swapping/thrashing. Look at things like vmstat to check overall memory
usage.
> 4) Have you any other suggestions about how to solve my problem.
Open your Camel to p537 and read. Think about your basic structures.
Do you slurp whole files, launch processes for no real reason, use eval
just for the fun of it, not cache constant values, use REs when string
commands will do, etc etc etc? Look into the Benchmark package for
comparing several alternativites and use the profiler (I forget the
name, DProf maybe?) to find your critical sections.
Although I've never looked into heavy duty code tuning, I've always
heard that tuning buys 10-20% usually, but fixing structural problems
saves much more. I'd start there if it were my code I was tuning.
- doug
------------------------------
Date: 30 Apr 1997 11:26:17 GMT
From: O C Kwon <O.C.Kwon@durham.ac.uk>
Subject: How to write '&' through Perl's decoding
Message-Id: <5k7a8p$sp7@mercury.dur.ac.uk>
Dear All,
I used & in an HTML file in order to display '&' in
an HTML form. However, when an '&' in a word is written
in a file it is processed as a new line, because I had to
use the '&' to split the whole data and to write each
name-value pair in each line of a file.
Can anyone tell me how to write a special character,'&',
in a file, which is inserted by user's selection from
a fill-out form.
Any help would be appreciated.
Oh-Cheon email o.c.kwon@durham.ac.uk
------------------------------
Date: Wed, 30 Apr 1997 09:46:21 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MacPerl <-> text editor?
Message-Id: <pudge-ya02408000R3004970946210001@news.erols.com>
In article <19970429163237152213@i2-27.islandnet.com>, michael@tenzo.com
(Michael O'Henly) wrote:
#Adam Schneider <acs@bitstream.net> wrote:
#
#> I just installed MacPerl 5 (I'd been using version 4). My text editor of
#> choice is Tex-Edit 1.8.5, and I'm getting a "Tex-Edit" menu in MacPerl,
#> but when I select the items under that menu (Edit... or Update...), all
#> that happens is that Tex-Edit is opened. I thought the script I was
#> currently working on in MacPerl would be opened in my editor.
#>
#> I can't find ANY mention of this menu in any of the MacPerl 5 notes, so I
#> can't begin to figure out why it doesn't work. I'd love to be able to use
#> this Edit/Update feature, because MacPerl's editor leaves a lot to be
#> desired.
#>
#> Thanks in advance for any help!
#
#Pete Keleher's Alpha has a MacPerl mode and is a superb editor for other
#uses as well.
#
# http://www.cs.umd.edu/~keleher/alpha.html
#
#If you're interested in a powerful non-WYSIWYG HTML editor, take a look
#at our Alpha HTML Mode Intro site...
#
# http://www.tenzo.com/alpha/
#
#
# Michael O'Henly
# Tenzo Design
#--
#
That's not at all helpful. He said his text editor of choice is Tex-Edit.
My best guess is that Tex-Edit does not fully support the AppleEvents
required for MacPerl to communicate with Tex-Edit.
#================================================================
Nobody likes sunburn slappers.
--Bart Simpson
Chris Nandor pudge@pobox.com
PGP Key 1024/B76E72AD http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6
------------------------------
Date: 30 Apr 1997 11:03:50 GMT
From: schmidt@miserv2iai.kfk.de (Andreas Schmidt)
To: Pascal Houde <houde@fox.cisti.nrc.ca>
Subject: Re: Multi line matching problem. Should be simple?!?
Message-Id: <5k78um$jrg$1@nz12.rz.uni-karlsruhe.de>
In article <33665309.41A550C7@fox.cisti.nrc.ca>, Pascal Houde <houde@fox.cisti.nrc.ca> writes:
|> Here's a small example of what I want to do:
|>
|> $var="some\nthing"
|> $var =~ s/something/blablabla/;
|> print $var; # which would print blablabla
hi pascal,
if it is possible that you can delete in a first step all the '\n' characters from
your string i thing that i've an solution for you. in this case you could do
something like this:
$var="some\nthing"
$var =~s/\n//g; # removing all newline characters
$var =~ s/something/blablabla/;
print "Resulting string \$var is: $var\n";
hope that helps
smiff
========================================================================
andreas schmidt email: schmidt@iai.fzk.de
institut fuer angewandte informatik (iai) phone: +49 7247 82 5714
forschungszentrum karlsruhe gmbh
- technik und umwelt -
postfach 3640 76021 karlsruhe (germany)
------------------------------
Date: 30 Apr 1997 08:39:42 -0400
From: Rajappa Iyer <rsi@lucent.com>
Subject: Re: Notice to antispammers
Message-Id: <xnyn2qghegh.fsf@placebo.hr.lucent.com>
Russ Allbery <rra@stanford.edu> writes:
> Rajappa Iyer <rsi@lucent.com> writes:
>
> > Sure... and if all Tom said was "This really pisses me off" I would have
> > no argument. But when he threatens to hand addresses on a platter for
> > spambots to harvest, he oversteps a line.
>
> E-mail addresses are not private property, secret information, or secure.
So what? My snail-mail address is not a private property in the same
sense. It is listed in the telephone book. Does not mean that it is an
invitation for anybody to drop by. If too many people drop in saying
`I saw your address on the telephone book' I will unlist my
address. My right, my privilege. Do you disagree?
> There are a variety of solutions to e-mail spam. Munging your address in
> posts isn't one of the better of them.
Be that as it may, that's my business and not yours. My purpose is to
foil spam mail... and I'll do whatever it takes. If it means that
people compelled to mail as well as post their replies find it
bothersome, I'm sorry but that's just the way it is.
Address munging is like having an unlisted number in my opinion... it
is done to get rid of annoying telemarketers. Yes, it does mean that
someone who is not a telemarketer and who doesn't have your number
cannot look you up with directory assistance, but that's not grounds
for this someone to claim that I have no right to have an unlisted
number.
--
Rajappa Iyer <rsi@lucent.com> #include <std_disclaimer.h>
They also surf who only stand on the waves.
------------------------------
Date: 30 Apr 1997 09:10:04 -0400
From: Rajappa Iyer <rsi@lucent.com>
Subject: Re: Notice to antispammers
Message-Id: <xnylo60hd1v.fsf@placebo.hr.lucent.com>
Russ Allbery <rra@stanford.edu> writes:
> Rajappa Iyer <rsi@lucent.com> writes:
>
> > Sure... and if all Tom said was "This really pisses me off" I would have
> > no argument. But when he threatens to hand addresses on a platter for
> > spambots to harvest, he oversteps a line.
>
> E-mail addresses are not private property, secret information, or secure.
I said my mailbox was my (or my employer's) property. Surely you're
not questioning the fact that when you send me mail, it ends up using
my computer's resources?
--
Rajappa Iyer <rsi@lucent.com> #include <std_disclaimer.h>
They also surf who only stand on the waves.
------------------------------
Date: Wed, 30 Apr 1997 06:38:41 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: r.polanskis@nepean.uws.edu.au, grove@zeta.org.au
Subject: Re: Output of sorted dated from an array into a table?
Message-Id: <Pine.GSO.3.96.970430063436.29715G-100000@kelly.teleport.com>
On 27 Apr 1997, Rachel Polanskis wrote:
> I am trying to figure out how to format the output of my
> backup log to print a special report table out for me.
[ Most of 138-line message elided ]
> Can anyone help me with some suggestions, to get my table formatted
> the way I want it?
As near as I could tell, you're asking how to sort an array by date,
although you may be asking how to deal with a data structure, or you might
be asking something else. Check out perldsc(1) and related pages, and if
you really want to sort by date, consider using one of the Date modules.
If I've totally misunderstood what you need, could you re-write your
request as one or two sentences and try again? Thanks.
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, 29 Apr 1997 08:16:31 -0400
From: Bill Meahan <wmeahan@ford.com>
Subject: Re: PERL Editor
Message-Id: <3365E69F.21EB@ford.com>
Peter G. Martin wrote:
>
> emacs.pl, potatoes, vi, ed....
> So none of you own a pencil, huh ?
>
> --
> Peter G. Martin, Contract Tech Writer
> peterm@zeta.org.au martin@shl.dec.com
Don't forget the coding forms and a Faber "Pink Pe(a)rl" eraser [what
other kind could do as well?] to go with the pencil. And an 029
keypunch to perform the actual data entry from the forms!!
Keeping up with the fontification features and syntax highlighting, one
also needs a box of _colored_ pencils and a couple of fluorescent
highlighters for block marking. But then one _doesn't_ need batteries,
a power cord, 64GB of RAM or a gigabit ethernet connection or anything
originating in Redmond, Washington.
--
Bill Meahan wmeahan@ford.com
Ford Motor Company -- End User Support - North America
Not an official statement of Ford Motor Company or anyone else
except the author.
------------------------------
Date: Wed, 30 Apr 1997 09:43:19 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl on the Mac - hep me!
Message-Id: <pudge-ya02408000R3004970943190001@news.erols.com>
In article <eyoung-2904970838250001@bopc3.ncsa.uiuc.edu>,
eyoung@ncsa.uiuc.edu (Ed Young) wrote:
#Ok, I'm just learning...know very little...and going nowhere fast.
#
#I'm learning perl from the "learn Perl" book (the one with the camel)
^^^^^
It's a llama. The camel is on the Programming Perl book. FYI.
#Are there any MacPerl scripts out there and where...and where can I find
#something that shows me the diffrences between Unix Perl and MacPerl?
Try the MacPerl FAQ.
http://www.industrialstrengthsw.sk.ca/MacPerl/MacPerlFAQ.html
#================================================================
I wish I lived back in the old west days, because I'd save up my
money for about twenty years so I could buy a solid-gold pick.
Then I'd go out West and start digging for gold. When someone
came up and asked what I was doing, I'd say, "Looking for gold,
ya durn fool." He'd say, "Your pick is gold," and I'd say, "Well,
that was easy." Good joke, huh.
--Jack Handey
Chris Nandor pudge@pobox.com
PGP Key 1024/B76E72AD http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6
------------------------------
Date: Wed, 30 Apr 1997 08:06:18 -0400
From: Grant Totten <grantt@nortel.ca>
Subject: Perl on Win95?
Message-Id: <336735BA.2164@nortel.ca>
Hi Perl gurus,
So, is it possible to use perl5 on a Windows 95 platform?
Thanks,
Grant Totten
Nortel Broadband Networks
grantt@nortel.ca
------------------------------
Date: 28 Apr 1997 14:17:48 GMT
From: "Sidney Snodgrass" <jspencer@netcomuk.co.uk>
Subject: Perl using Microsoft Personal Web Server
Message-Id: <01bc53de$ac80d260$6502a713@fce04438.jubilee.ford.com>
I have just installed MS PWS and need to run Perl, can someone tell me
where to download it from and if there are any 'special' install
instructions to be aware of.
Many thanks,
------------------------------
Date: 30 Apr 1997 09:40:12 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Perl4 script under Perl5 interpreter
Message-Id: <5k7i3s$o8p@panix.com>
In <336708FF.3965@aol.com> LokiWebLtd <lokiwebltd@aol.com> writes:
>I'm having a problem with opening and writing files using perl5.
>The following command is what originally came with the script.
> open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
>Of course this caused an error on the perl5 interpreter.
>I have fixed the line to
> open(NEWFILE,">$basedir/$mesgdir/$num\.$ext" || die $!);
>this avoids the error however the file is not getting written.
Eeeww.
Why not:
open NEWFILE, ">$basedir/$mesgdir/$num.$ext"
or die "Can't open $basedir/$mesgdir/$num.$ext: $!";
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: Wed, 30 Apr 1997 06:43:40 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Geoffrey Hebert <soccer@microserve.net>
Subject: Re: push or unshift simple question
Message-Id: <Pine.GSO.3.96.970430064316.29715I-100000@kelly.teleport.com>
On Tue, 29 Apr 1997, Geoffrey Hebert wrote:
> unshift @myarray $one_element;
I think you're missing a comma. 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: Wed, 30 Apr 1997 05:53:30 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Q: Extracting multi-line text between keywords
Message-Id: <ab87k5.4j.ln@localhost>
Stephan Petersen (sp@gtt-ws3.lth.rwth-aachen.de) wrote:
: Hi,
: I was wondering whether there's a simple (and preferably elegant :-)
: way to extract the text from a file embedded between "begin" and "end"
: markers like this:
: --begin <keyword>---
: line 1
: line 2
: line 3
: ..
: ..
: ..
: line x
: --end <keyword>---
: <keyword> can be one of several possible. One data block consists of
: these chunks for all of the several keywords, the input file has many
: of these blocks (sort of like a free-form text file database).
: I looked at regular expressions, but I didn't really find documentaion
: and examples on this type of problem. I don't even know at the moment
: whether this can be handled with regexs at all, or whether I have to
: employ auxiliary logic...
: If anybody can give me a pointer of what to try or where to look, I'd
^^^^^^^^^^^^^
Perl FAQ part 6:
-------------
=head2 How can I pull out lines between two patterns that are themselves on different lines?
You can use Perl's somewhat exotic C<..> operator (documented in
L<perlop>):
perl -ne 'print if /START/ .. /END/' file1 file2 ...
If you wanted text and not lines, you would use
perl -0777 -pe 'print "$1\n" while /START(.*?)END/gs' file1 file2 ...
But if you want nested occurrences of C<START> through C<END>, you'll
run up against the problem described in the question in this section
on matching balanced text.
-------------
: be grateful.
: Thanks in advance,
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 30 Apr 1997 12:55:39 GMT
From: schmidt@miserv2iai.kfk.de (Andreas Schmidt)
To: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Re: question: how to trim a string passed via hard reference?
Message-Id: <5k7fgb$m29$1@nz12.rz.uni-karlsruhe.de>
In article <ysizyba1z1x7.fsf@bufo.usc.edu>, brannon@bufo.usc.edu (Terrence M. Brannon) writes:
|> sub trim {
|> chomp($$_[0]);
|> ${$_[0]} =~ s/^\s+//;
^ ^
|> ${$_[0]} =~ s/\s+$//;
^ ^
|> }
|>
|> trim(\$x)
|>
|> does not trim away leading and trailing whitespace. why?
|>
hi terrence,
$$_[0] does not what you want, because the dereference of the scalar variable
happens before any key lookup take place. so you have to put braces around the
first parameter ({$_[0]}). now you can dereference the first parameter with the
'$' sign.
see point 7. in the perlref manpage (version 5.003 patch 93, from 30/12/96).
hope that helps
smiff
========================================================================
andreas schmidt email: schmidt@iai.fzk.de
institut fuer angewandte informatik (iai) phone: +49 7247 82 5714
forschungszentrum karlsruhe gmbh
- technik und umwelt -
postfach 3640 76021 karlsruhe (germany)
------------------------------
Date: 30 Apr 1997 09:31:00 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: servers/chmod and stuff
Message-Id: <5k7hik$m9b@panix.com>
In <Good.Luck-2904972003320001@pm3-02-dyn4-77.nash.telalink.net> Good.Luck@Finding.My.Address.Com (Michael R. Bagnall) writes:
> Ok, I'm a newbie and I know I suck. But I need help. I am begining to
>do some perl programming for the web and need to know how to make it work
>online. I code it, upload it to my cgi-bin directory, issue the chmod nd
>am still stuck.
So are we.
>Am I forgetting a step?
Yes. You forgot to tell us what the problem is.
>Do I upload the script in the text script format?
That should be ok.
>Do I need to compile it?
No. But, Perl needs to be installed on the Web server machine. Is it where
you think it is? Did the program run from the command line?, etc., etc...
>Help? Please?
You would get better help if you read the FAQs before you post a question.
You would get alot better help if you posted a specific problem you are having
with Perl -- "I am still stuck" isn't too informative!
This is a good starting point for you:
The Idiot's Guide to Solving Perl CGI Problems
http://www.perl.com/perl/faq/idiots-guide.html
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: Wed, 30 Apr 1997 12:55:47 +0100
From: Doug Olsen <olsend@ms.FAKETAG.com>
Subject: sourcing a ksh script within PERL
Message-Id: <33673343.5A3E@ms.FAKETAG.com>
I've tried the obvious
`. /mydir/myEnvironmentFile`
but the requisite variables cannot be picked up using
$MYVAR=$ENV{"MYVARENV"}
I guess I could always parse myEnvironmentFile, but
it would be more readable if I could source it.
Thanks in advance
doug
olsend@ms.com (The FAKETAG in the header is for spammers)
--
"It is easier to confess a defect than to claim a quality"
attributed to Max Beerbohm - Arthur Burns "UNIX Shell Programming"
------------------------------
Date: 30 Apr 1997 09:11:22 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Windows 95 and FTP
Message-Id: <5k7gdq$if5@panix.com>
In <33664DF4.4C51@Sun.COM> Joe Lempkowski <joey@Sun.COM> writes:
>Does anyone have a pointer on how to use PERL to download files via
>ftp on a Windows 95 platform?
Net::FTP
Now part of the libnet distribution.
Prerequisites: To install libnet you must have the following modules installed:
Data::Dumper
IO::Socket
Source: http://perl.com/CPAN/modules/by-module/Net/libnet-1.05.tar.gz
Note: Please get the patch libnet-1.05_01.
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
Date: 30 Apr 1997 10:48:46 GMT
From: "Paul Coils" <Anon@Anon.com>
Subject: WWW timeout error
Message-Id: <01bc553e$589dc840$d0f0d4cf@paulc>
When I try to query a cgi script running on a remote server across the
internet I get a time out error.
The exact wording of the error is
HTTP::Request=HASH(0xbb6d88)
timeout8
As I am only a newbie I have no real idea whats happening
HELP PLEASE !!!!!
------------------------------
Date: 30 Apr 1997 09:50:31 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: WWW timeout error
Message-Id: <5k7in7$qvu@panix.com>
In <01bc553e$589dc840$d0f0d4cf@paulc> "Paul Coils" <Anon@Anon.com> writes:
>When I try to query a cgi script running on a remote server across the
>internet I get a time out error.
>The exact wording of the error is
> HTTP::Request=HASH(0xbb6d88)
> timeout8
>As I am only a newbie I have no real idea whats happening
>HELP PLEASE !!!!!
How?
- Is the "cgi script" written in Perl?
- Does it run from the command line?
- Is it a Web server problem? What does the error log on the Web server
say?
- Is it a CGI problem, i.e., the program runs from from the command line,
but doesn't from the Web server.
In other words, you don't provide enough information for anyone to help
you...
--
Clay Irving See the happy moron,
clay@panix.com He doesn't give a damn,
http://www.panix.com/~clay I wish I were a moron,
My God! Perhaps I am!
------------------------------
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 397
*************************************