[10777] in Perl-Users-Digest
Perl-Users Digest, Issue: 4378 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 8 09:07:26 1998
Date: Tue, 8 Dec 98 06:00:21 -0800
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, 8 Dec 1998 Volume: 8 Number: 4378
Today's topics:
Re: 80 column conversion (I.J. Garlick)
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: Beginner Book? <23_skidoo@geocities.com>
change a graphical image <marcov@ctrl-v.nl>
Re: change a graphical image <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Check file exist in the client directory <nospam.eam@starfire.mlb.semi.harris.com>
Re: Check file exist in the client directory (brian d foy)
Re: Checking before I post! <Richard@nugget.demon.co.uk>
Re: Easy regx please help.... (Gilly)
file locking question (umsee)
Re: Generating a Reference Number (Mark-Jason Dominus)
Hash slices - why are these equivalent?... <simonp@ftel.co.uk>
Re: Hey look! Im an expert too <bradw@kannews.newbridge.com>
Re: How to disallow fields to input puncuations excepts (Tad McClellan)
Re: Need Help on code! <schuette@umr.edu>
Newbie help plz clemenr@westminster.ac.uk
Re: Newbie question <Allan@due.net>
Oraperl and stored procedures (David Cantrell)
PERL -- What did I miss? <jamie@powernetonline.com>
Re: PERL -- What did I miss? (brian d foy)
Perl on AS400 <mafr0007@stud.uni-sb.de>
Re: Perlscript timeout <matt@teamamiga.org_NOSPAM>
PerlScript? Non-asp, & UNIX ... Is it out here? adcoment@earthling.net
Re: PID ($$) of system() call? otis@my-dejanews.com
Re: PID ($$) of system() call? (Andrew M. Langmead)
Read/Edit a file <ram@ghl.com>
Re: Read/Edit a file (Tad McClellan)
Re: SSI from Perl on IIS scott@softbase.com
Re: Uploading files with Perl? (I.J. Garlick)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 8 Dec 1998 09:05:45 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: 80 column conversion
Message-Id: <F3n2LM.7z7@csc.liv.ac.uk>
In article <366cdb6d.9767916@news.skynet.be>,
bart.lateur@skynet.be (Bart Lateur) writes:
> I.J. Garlick wrote:
>
>>Don't like Text::Wrap, does screwy things with lines of characters greater
>>than the max column width when there are no spaces in the line.
>
> What WOULD you like it to do? I can only think of two possibilities:
>
> A) Split the word that is too long onto chunks of at most 80 characters
> B) Don't split the word, leave it as a chunk that is far too long
>
> Neither seems ideal. I don't know what Text::Wrap does, I haven't used
> it yet.
Agreed. However I would be happy with either.
But Text::Wrap does, soemthing altogether weirder. If the line has no
spaces and is greater than the column width specified it seems to save the
line until it has finished with the rest and then print it out at the end.
The two situations you specify I could do something about if I wanted to,
what actually happens is impossible to deal with as the line is out of
context and you don't know where to re-insert it.
Apparently, according to Eric (see other posts), this is what the author of
Text::Format didn't like and why that module was written. Going to have a
good play with that to day, it maybe easier than continueing to wrestle with
my attempt. (I was getting close but I had reached my limits on reg exps I
feel.)
I knew if I lurked long enough something good would come of reading this
group, but this is the first time what I am currently trying to do has come
up as a specific topic just in time.
Anyway thanks to all of the Perl gurus who have been helping me without
knowing it.
>
> Bart.
--
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
<postmaster@merseymail.com>
THE LESSER-KNOWN PROGRAMMING LANGUAGES #13: SLOBOL
SLOBOL is best known for the speed, or lack of it, of its compiler.
Although many compilers allow you to take a coffee break while they
compile, SLOBOL compilers allow you to travel to Bolivia to pick the
coffee. Forty-three programmers are known to have died of boredom
sitting at their terminals while waiting for a SLOBOL program to
compile. Weary SLOBOL programmers often turn to a related (but
infinitely faster) language, COCAINE.
------------------------------
Date: Tue, 08 Dec 1998 11:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage913116240.3330@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 08 Dec 1998 11:09:46 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: Re: Beginner Book?
Message-Id: <366D08F8.5729@geocities.com>
> > paulwade@my-dejanews.com wrote:
> > > In article <3650788e.14819289@news.newsguy.com>,
> > > jeff.kennedy@natdecsys.com (Jeff Kennedy) wrote:
> > > > I need a book geared to an ABSOLUTE BEGINNER! No perl experience, no
> > > > programming experience, no real shell scripting experience.
>
> > The Larry Wall book is good though.
>
> You mean Programming Perl I presume. I strongly disagree if this is
> the case. The Camel is NOT for absolute beginners. I would suggest the
> Llama (Learning Perl) as a starting point.
i totally agree, speaking as a newbie perl hacker, Programming Perl is
way too deep to start with, i can't understand half of it yet but have
got by with the help of assorted tutorials online and more recently with
the help of people in this group, just make sure you search the faq
first!
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html
-23
------------------------------
Date: Tue, 08 Dec 1998 11:28:36 +0100
From: Marco Vlemmings <marcov@ctrl-v.nl>
Subject: change a graphical image
Message-Id: <366CFF54.5AEB153F@ctrl-v.nl>
Hi,
i want to read a gif file into my script and change it.For example
rotate the image.
I want to know if it is possible in perl.Can anyone gif me a hint?
With kind regards,
Marco Vlemmings
email:marcov@ctrl-v.nl
------------------------------
Date: 08 Dec 1998 11:43:22 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: change a graphical image
Message-Id: <834sr6vrqt.fsf@vcpc.univie.ac.at>
Re: change a graphical image, Marco
<marcov@ctrl-v.nl> said:
Marco> Hi, i want to read a gif file into my script
Marco> and change it.For example rotate the image.
Marco> I want to know if it is possible in perl.Can
Marco> anyone gif me a hint?
TIMTOWTDI of course, but a nice way is via
ImageMagick:
perldoc Image::Magick
(which gives you much more than rotation)
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Tue, 08 Dec 1998 07:01:27 -0500
From: Software Sciences <nospam.eam@starfire.mlb.semi.harris.com>
Subject: Re: Check file exist in the client directory
Message-Id: <366D1517.DA513F91@starfire.mlb.semi.harris.com>
Look up -e filetest operator.
Eddie Tso wrote:
> Hi all,
>
------------------------------
Date: Tue, 08 Dec 1998 07:35:22 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Check file exist in the client directory
Message-Id: <comdog-ya02408000R0812980735220001@news.panix.com>
In article <366D1517.DA513F91@starfire.mlb.semi.harris.com>, Software Sciences <nospam.eam@starfire.mlb.semi.harris.com> posted:
> Look up -e filetest operator.
which, of course, will not work over the web which is what the
original poster wanted.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 8 Dec 1998 08:26:32 +0000
From: Chunky <Richard@nugget.demon.co.uk>
Subject: Re: Checking before I post!
Message-Id: <qEJTZFA4KOb2Ewdy@nugget.demon.co.uk>
In article <VbysuDAV0Bb2Ewqz@nugget.demon.co.uk>, Richard
<Richard@nugget.demon.co.uk> writes
>I've just completed my largest cgi script attempt so far. It's not large
>by most peoples standards but I'm pretty pleased with it as it does
>exactly what I want.
>
>I realise that this group is not for cgi issues but I would be grateful
>if I could post the code here for constructive criticism on the coding.
>This would help me get it right first time next time and hopefully help
>others new to Perl lurking here. So if I post it will I be flamed?
Following up my own post, it has been suggested by email that I post the
script on my web site. That I have done and the script is now available
at http://www.nugget.demon.co.uk/Misc/viewstock.txt. Many thanks for any
criticism.
Cheers
Richard
--
Richard Eyles | General techie anorak
Principle Pharmacist Computer Services | DOS Win95 AIX HP-Unix (just)
Queen Alexandra Hospital, Portsmouth | TCPIP IPX Novell
------------------------------
Date: Tue, 08 Dec 1998 11:50:21 GMT
From: mingtian@hanmail.net (Gilly)
Subject: Re: Easy regx please help....
Message-Id: <366d11fb.1788455@usenet.kornet21.net>
:chad@gurucom.net wrote:
:: I know this is essy, but i keep screwing it up could someone please give me
:: the regx to parse this line. thanks.
:
:
:: $line = '<a href="http://i.am.stupid.com/index.html">Yes that's me</a>';
:
:: this is what I want:
:
:: ($link, $title) = ( $line =~ /(?)(?)/; }
$_=<<END;
<a href="http://soback.kornet21.net/~hklife/1W821.jpg" onMouseOver="Show()" >1W
821</a>
<a onMouseOver="Show()"
href=http://soback.kornet21.net/~hklife/pic2
>1W822</a>
<a Class=my_link href="http://soback.kornet21.
net/~hklife/1W823.jpg"
onMouseOver="Show()"> 1W82
3</a>
<a href=>
END
while(/<A\s+(?:[A-GI-Z]\w*(?:\s*=\s*(?:(["']?).*?\1|\S+?)))*\s*href(?:\s*=\s*(?:(["']?)(.*?)\2|\S+?))*\s*(?:[A-GI-Z]\w*(?:\s*=\s*(?:(["']?).*?\4|\S+?)))*\s*>(.+?)<\/A>/sig) {
($name, $link) = ($5, $3);
$name =~ s/\n\s+(\S)/$1/g;
$name =~ y/\r\n//d;
$name =~ s/^\s+//;
$name =~ s/\s+$//;
$link =~ y/\r\n//d;
print "$name \t $link\n";
}
@}`,--- ">#F([%Tg%e)` #me %M%o(`
ICQ: 15668514
------------------------------
Date: Tue, 08 Dec 1998 10:57:45 GMT
From: NOSPAM_umsee@microasia.com (umsee)
Subject: file locking question
Message-Id: <74j0mc$8tp$1@canopus.cc.umanitoba.ca>
I have a file which might be read or write by my program. And I am using both
linux AND windows NT version of perl.
My question is:
Can I open the file and read it while another program lock the file and write
to it?
Do I need to lock the file if I am only reading it (the other program might be
locking it for writing)?
Thanks You!!
------------------------------
Date: 8 Dec 1998 01:04:20 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Generating a Reference Number
Message-Id: <74ifh4$20d$1@monet.op.net>
In article <366ca902.351528581@news.ionet.net>, <imchat@ionet.net> wrote:
> Sure. The easiest way is to use a counter sub to assign the
>number. This is Selena Sols work BTW. It is very well documented.
It also sucks. If two copies of the program execute at the same time,
they might mangle the data file, or they might get the same number.
The Perl `File::CounterFile' module is very simple to use and is better.
It is available from
http://www.perl.com/CPAN/authors/id/GAAS/File-CounterFile-0.12.tar.gz
To use it:
use File::CounterFile;
$c = new File::CounterFile "COUNTER", 1;
Then you say
$id = $c->inc;
to get a new ID from the file.
------------------------------
Date: 08 Dec 1998 10:05:47 +0000
From: Simon Parsons <simonp@ftel.co.uk>
Subject: Hash slices - why are these equivalent?...
Message-Id: <o5hfv7lzic.fsf@dibble.ftel.co.uk>
my @a = (1, 3, 5, 7);
my %h = ();
# why are the following equivalent
# (1)
@h{@a} = ();
# (2)
@{%h}{@a} = ();
I understand (1) and amperfectly happy with it, but why does case (2) work?
Simon
--
===========================================================================
Simon Parsons (simonp@ftel.co.uk) "You have to be trusted by the
people that you lie to, So that when they turn their backs on you, You
get the chance to put the knife in." Pink Floyd
===========================================================================
FTEL., Solihull Parkway, Birmingham Business Park, Birmingham,
ENGLAND.
------------------------------
Date: 08 Dec 1998 08:33:23 -0500
From: Brad Warkentin <bradw@kannews.newbridge.com>
Subject: Re: Hey look! Im an expert too
Message-Id: <op14sr6wyfw.fsf@kannews.newbridge.com>
imchat@ionet.net writes:
> It actually does help to read. I spend a lot of time in this
> news group but post very seldom because most of my questions are
> already answered in another post. This news group is a very valuable
> resource and those peolpe that answer questions here should be
> applauded for putting up with rank amatuers such as myself. Not all of
> my questions have been answered, but I have found answers to all of my
> questions because I can read! Imagine that !!
Well said... beyond rtfm, the next most helpfull approach is most
likely dejanews... a search on "comp.lang.perl.misc" claims to produce
around 150,000 matches... and yes your querstion will have been asked
before... :-)
bj
------------------------------
Date: Tue, 8 Dec 1998 07:43:24 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to disallow fields to input puncuations excepts
Message-Id: <sdaj47.9oq.ln@metronet.com>
davidmaher@my-dejanews.com wrote:
: > How to enable the hypens , a-z , 0-9 but disable blank space and other
: > puncuations at the company??
: Try something like this:
And then try something else... ;-)
: if ($form{'company'} !~ /^[-A-z0-9]+$/) {
: print "Bad\n";
: }
: else {
: print "Good\n";
: }
$form{'company'} = 'ac[\]^_`xyz'; # above code prints 'Good' !!!
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 08 Dec 1998 07:39:14 -0600
From: Matt Schuette <schuette@umr.edu>
Subject: Re: Need Help on code!
Message-Id: <366D2C02.E40B678E@umr.edu>
I didn't know $`, $&, and $' slowed it down. Thanks for setting me
straight!
Matt
------------------------------
Date: Tue, 08 Dec 1998 13:32:01 GMT
From: clemenr@westminster.ac.uk
Subject: Newbie help plz
Message-Id: <74j9oh$oo4$1@nnrp1.dejanews.com>
Hi. I'm new to perl, though have programmed in a variety
of languages for a long time.
I need to make a cgi-bin script that does a 'ls' on a file
system. What sort of things do I need to do this? Should I
learn basic file handling, or is there a way I can do this
the same way I would do a system( "ls -R <dir>" ) on a
Unix box?
The script only needs to run on an NT server.
Thanks muchly,
Ross-c
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 8 Dec 1998 08:45:39 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Newbie question
Message-Id: <74ja8i$ei8$1@camel29.mindspring.com>
NJPin wrote in message <19981207184426.12649.00003864@ng-cc1.aol.com>...
>I want to read a text file line by line (the text file is space delimited)
and
>store each of the text values of that line in variables labelled according
to
>the line #
>eg. text file reads something like this:
>id numeric 1 1 5
>q1 single 1 20 20
>etc....
>I'd like to store 'id' in $str1_line1, 'numeric' in $str2_line1, '1' in
>$str3_line1 etc...
>any suggestions? I am a real green newbie with experience in cshell
scripting,
>awk, etc, but haven't been able to find an answer in perldoc/man pages...
Well one way might be to load your data into a hash of lists, where the hash
keys are line numbers and your values contain lists of the data.
#!/usr/local/bin/perl -w
use strict;
my (%data,$i);
open(DATA,"foo.txt") or die "Lost and alone because $!";
while (<DATA>) {
chomp;
$i++;
$data{"line$i"} = [split];
}
and then you can access each element like so:
print $data{line1}[0];
gives id
and:
print $data{line2}[3];
gives 20
HTH
AmD
------------------------------
Date: Tue, 08 Dec 1998 13:11:29 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Oraperl and stored procedures
Message-Id: <366d20bf.94597534@thunder>
[ copied to london perl mongers list just so we've got something
sensible to discuss over our beverages on Thursday ]
Does anyone know how to call Oracle stored procedures from Oraperl?
For instance, to call a stored proc 'myStoredProc' which takes two
IN VARCHAR2 arguments, I would do this in PL/SQL:
myStoredProc('arg1', 'arg2');
and I guessed I'd do this with Oraperl:
$oracle=&ora_login('ol8', 'user', 'passwd'); # connect to db
&ora_do($oracle, "myStoredProc('$param1','$param2')");
&ora_logoff($oracle); # byesy-bye Mr Ellison.
But ...
ORA-00900: invalid SQL statement ...
Fair enough - myStoredProc isn't a SQL statement. But surely there
must be _some_ way of calling a stored proc?
If I replace the &ora_do() with a normal &ora_open() and use a SELECT
statement everything is fine, so I know that my database is running,
and that Oraperl itself is OK. Additionally, myStoredProc behaves
correctly when used in sqlplus.
'perldoc oraperl' is singularly unhelpful wrt stored procedures, not
mentioning them once.
--
Dave, who has come to _really_ detest PL/SQL over the last week or so.
------------------------------
Date: Tue, 8 Dec 1998 00:26:25 -0600
From: "jamie dolan" <jamie@powernetonline.com>
Subject: PERL -- What did I miss?
Message-Id: <ZH3b2.775$ww5.66180@homer.alpha.net>
HI,
What did I miss in this script? It runs, but it prints nothing to the file
/etc/namedb/$name.hosts.
Any Clues?
Thanks.
$BOOTDIR = '/etc/';
$NAMEDB = '/etc/namedb/';
system "touch /etc/namedb/'$name'.hosts";
$NAME2 = "/etc/namedb/'$name'.hosts";
chdir ($NAMEDB);
open(RF,">>$NAME2");
print RF "@";
print RF "\t";
print RF "IN";
------------------------------
Date: Tue, 08 Dec 1998 02:15:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PERL -- What did I miss?
Message-Id: <comdog-ya02408000R0812980215580001@news.panix.com>
In article <ZH3b2.775$ww5.66180@homer.alpha.net>, "jamie dolan" <jamie@powernetonline.com> posted:
> What did I miss in this script? It runs, but it prints nothing to the file
> /etc/namedb/$name.hosts.
> open(RF,">>$NAME2");
you missed checking the return value of your open().
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 08 Dec 1998 13:04:41 +0100
From: Markus Fritz <mafr0007@stud.uni-sb.de>
Subject: Perl on AS400
Message-Id: <366D15D8.8A958BA8@stud.uni-sb.de>
Hi,
starting with Perl on the AS/400, I have the following problem:
I can write to an outfile in the IFS (in EBCDIC, which I don't want,
but it's ok).
When I try to send s.th. back to the browser (windows-pc) with print,
the browser only gets the following response
-----------------------------
Error 500
Internal error: headers
IBM Internet Connection Server for AS/400 4.1
-----------------------------
When the script accesses any environment variables, it stops and
produces
no output at all.
I think, it's got something to do with ASCII/EBCDIC conversion, but
changing the Conversion mode in the WRKHTTPCFG Exec-lines to
%%MIXED%%, %%EBCDIC%% or %%BINARY%% is all the same.
On a win nt-server (internet information server 3.0) the script works.
Any help is appreciated.
Thanks
Markus Fritz
Here are my files:
Perl-Script:
============
# !/usr/bin/perl
# when including the following line, the script won't run at all:
# read(STDIN, $data, $ENV{'CONTENT_LENGTH'});
#
# the following 3 lines work, output is done in EBCDIC.
open (OUTFILE, ">/QOpenSys/test");
print OUTFILE "hallo";
close OUTFILE;
#
# the rest of the script doesn't work.
print "CONTENT-TYPE: text/html\n\n";
# I also tried it with adding (combinations of) the following line
# print "<html><head></head>"
print "<body>";
print "hello";
print "</body></html>\n\n";
-------------------------
HTML-File:
==========
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body>
Test:
<form action="/cgi-bin/hello" method="post">
<input type="input" name="xxx">
<input type="submit" value="Go!" name="go">
</form>
</body>
</html>
------------------------------
Date: Tue, 08 Dec 1998 09:10:20 +0000
From: Matt Sergeant <matt@teamamiga.org_NOSPAM>
Subject: Re: Perlscript timeout
Message-Id: <366CECFC.479E9DA9@teamamiga.org_NOSPAM>
Ernst Christensen wrote:
>
> Hi
> I am using NT and IIS. How can I set the timeout of my perlscripts to fx
> 5 seconds. the reason is that sometimes i make a script width an
> infinite loop, that is running for ever
This is a *major* bug in IIS. Basically - if you get your ASP script
into an infinite loop, whether it's PerlScript, VBScript or whatever,
you can't stop it, even with a timeout. The only solution is to reboot
your server (yes - that really is the only option!). You can't even
force a kill of IIS.
You can set timeouts with "$Server->{ScriptTimeout} = $secs;" but it
won't affect an infinite loop.
For more PerlScript/ASP documentation see my web site.
--
<Matt email="matt@teamamiga.org" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Tue, 08 Dec 1998 07:35:29 GMT
From: adcoment@earthling.net
Subject: PerlScript? Non-asp, & UNIX ... Is it out here?
Message-Id: <74iks1$7da$1@nnrp1.dejanews.com>
It would be very nifty for me to have Perl embedded in HTML Documents that are
parsed through a server, executed, and displayed. This somewhat similiar to
what the server engines like msql does with their w3 lite package.
Is there a system out there now, or will I have to code it myself?
(Or finish coding it I should say, whew!)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 08 Dec 1998 07:05:10 GMT
From: otis@my-dejanews.com
Subject: Re: PID ($$) of system() call?
Message-Id: <74ij36$60t$1@nnrp1.dejanews.com>
Answer by example:
#!/usr/bin/perl -w
$SIG{'INT'} = 'signal_handler';
for (1 .. 3)
{
unless ($childPID = fork)
{
print "Start\n";
exec("sleep 5");
}
wait;
print "$childPID\n";
print "Done Waiting\n";
}
sub signal_handler {
my ($sig) = @_;
print "$0 Caught Signal: SIG$sig \n";
kill $sig, $childPID if $childPID;
exit(0);
}
__END__
Otis
--
eZines Db - 3,000+ magazines, newspapers, journals, e-zines...
http://www.dominis.com/Zines/?dn
> Is there a way to get the PID of the process started by a system() call from a
> perl script?
>
> I have a situation where I use a perl script as a 'wrapper' that calls
> something via system() and I need to be able to send signals (SIG*) such as
> -2 -9 -15, etc. to the process started by system(). Currently, if I kill the
> perl script, for example, the thing invoked by signal() keeps running.
I
> know how to catch signals in a perl script, but I need to know how to
> 'forward' or 'apply' them to the process invoked by system() after I catch
> them :)
>
> Thanks!
>
> Otis
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 8 Dec 1998 12:03:48 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: PID ($$) of system() call?
Message-Id: <F3nAuC.11B@world.std.com>
otis@my-dejanews.com writes:
>Is there a way to get the PID of the process started by a system() call from a
>perl script?
By the time you are back from your call to system() the process has
already finsished and there is no PID. The system() function is
essetially a combination of a fork(), followed by an exec() in the
child and a wait() in the parent. The parent sleeps in the wait()
until the child is done.
If you want to run other programs simultaneously, you might want to
handle the fork() and exec() part yourself, but keep track of the PID
instead of wait()ing on it.
--
Andrew Langmead
------------------------------
Date: Tue, 8 Dec 1998 14:57:34 +0800
From: "Sriram" <ram@ghl.com>
Subject: Read/Edit a file
Message-Id: <366ccde1.0@news.tm.net.my>
hello users,
i want to edit a file from which i am reading data. i want to add a small
piece of text once i find a delimeter in the input data file. please advise
me what to do. thanx in advance.
sriram
------------------------------
Date: Tue, 8 Dec 1998 07:53:46 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Read/Edit a file
Message-Id: <a1bj47.9oq.ln@metronet.com>
Sriram (ram@ghl.com) wrote:
: i want to edit a file from which i am reading data. i want to add a small
: piece of text once i find a delimeter in the input data file.
: please advise
: me what to do.
I advise checking the Perl FAQ before posting...
Perl FAQ, part 5:
"How do I change one line in a file/
delete a line in a file/
insert a line in the middle of a file/
append to the beginning of a file?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Dec 1998 14:20:41 GMT
From: scott@softbase.com
Subject: Re: SSI from Perl on IIS
Message-Id: <366d35b9.0@news.new-era.net>
Mark Polakow (mpolakow@emergemarketing.com) wrote:
> I am running Perl on win32 on MS IIS and generally it runs great. However I
> am trying to do SSI calls
IIS doesn't support SSI.
Scott
------------------------------
Date: Tue, 8 Dec 1998 09:55:59 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: Uploading files with Perl?
Message-Id: <F3n4xC.AoL@csc.liv.ac.uk>
In article <74gobi$amm$1@plug.news.pipex.net>,
"Artoo" <r2-d2@REMOVEbigfoot.com> writes:
> What is required in the Perl script to upload the file?
>
> Thanks
CGI.pm, available as standard with all recent Perl distributions :-)
Just use the NAME in CGI.pm's param('NAME') call. (You'll need a query
object as well, unless your stuck in the none OOP mentality and using
the alternate interface.) It caters for all tastes too.
> Artoo
>
>
>
>
--
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
<postmaster@merseymail.com>
THE LESSER-KNOWN PROGRAMMING LANGUAGES #13: SLOBOL
SLOBOL is best known for the speed, or lack of it, of its compiler.
Although many compilers allow you to take a coffee break while they
compile, SLOBOL compilers allow you to travel to Bolivia to pick the
coffee. Forty-three programmers are known to have died of boredom
sitting at their terminals while waiting for a SLOBOL program to
compile. Weary SLOBOL programmers often turn to a related (but
infinitely faster) language, COCAINE.
------------------------------
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 4378
**************************************