[12970] in Perl-Users-Digest
Perl-Users Digest, Issue: 380 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 5 09:10:53 1999
Date: Thu, 5 Aug 1999 06:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 5 Aug 1999 Volume: 9 Number: 380
Today's topics:
Re: => only in hash initialization? (WAS: mySQL & Perl (Anno Siegel)
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: A matter of style? (Gary O'Keefe)
Re: A matter of style? (Gary O'Keefe)
AIX fork() / exec() waiting for child process (Gerard Zavislak)
Re: Complex data structure (I.J. Garlick)
format-question (Steffen Koehler)
Re: Get Executables path (Mike Bristow)
Re: Hash (Anno Siegel)
Re: Hash (Anno Siegel)
Re: How do I open another browser window using Perl? <c4jgurney@my-deja.com>
Re: How do I open another browser window using Perl? sine2117@my-deja.com
Re: How do I open another browser window using Perl? sine2117@my-deja.com
Re: looking for XML comments (Michel Dalle)
Re: Need some PERL/CGI thinkers please! (Mike Bristow)
Re: NT Apache Perl <saxbourne@yahoo.com>
Re: NT Apache Perl (Andreas Fehr)
ODBC problem feketeroland11@my-deja.com
Re: Perl script as a FTP client <cmd@nospam_altnews.com.au>
Re: Question for Perl gurus (Anno Siegel)
Re: Question for Perl gurus (Malcolm Ray)
Re: regex substitutions from static strings <salvador@my-deja.com>
Re: regexp can be your friend (Eugene van der Pijll)
Telnet problems sine2117@my-deja.com
Re: unus sed leo <archer7@mindspring.com>
Re: Useless error when {} unbalanced <revjack@radix.net>
WRITING A TIMER IN PERL <tmujak@wcom.co.uk>
Re: WRITING A TIMER IN PERL (Andreas Fehr)
Re: WRITING A TIMER IN PERL (Andreas Fehr)
Re: WRITING A TIMER IN PERL <jeffp@crusoe.net>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Aug 1999 13:04:13 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: => only in hash initialization? (WAS: mySQL & Perl -> Something simple)
Message-Id: <7oc24d$e5v$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>[Posted and a courtesy copy mailed.]
>
>In article <19990804204428.54651.qmail@hotmail.com> on Wed, 04 Aug 1999
>16:44:28 EDT, Perl King <perlking@hotmail.com> says...
>> Alex Farber <alex@kawo2.rwth-aachen.de>
>> >Perl King wrote:
>> > > ObPerl: Use the => operator only in hash initialization.
>> >
>> >why?
>>
>> => ist entsprechen-zum Bediener. Es soll nicht als "phantastisches
>> Komma" verwendet werden und kann Fehler verursachen, wenn Sie auf diese
>> Weise verwendet werden:
>>
>> open PW => '/etc/passwd'; # Vorausgehenproblem!
>>
>> An gängige Praxis und verwenden an passen sich => Bediener nur in
>> der Durcheinander-initialisierung.
>>
>> Perl König
>
>That's just one opinion. Saying it in German only makes it less
>accessible.
Ain't no German either. Babelfish?
Though I agree that => tends to be over-used.
Anno
------------------------------
Date: Thu, 05 Aug 1999 10:24:02 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage933848641.6600@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: Thu, 05 Aug 1999 11:44:20 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: A matter of style?
Message-Id: <37a95802.90875707@news.hydro.co.uk>
Mike Hammernik wrote:
>Every user on a portion of my system has a .config file. The file looks
>like this
>
>UserName: 'mhammer';
>HostName: '';
>DBHostName: 'paradox';
>DBName: 'servicedb100';
[snip]
>#!/usr/bin/perl -w
>
> system ("clear");
> print "\n Select from the following: \n\n";
> print " 0 = Switch paradox to active\n";
> print " 1 = Switch singularity to active\n"
>
> chomp ($N = <STDIN>);
>
>opendir(DIR, "/home/";
>while ( defined ($dirname = readdir DIR) )
>next if $dirname =~ /lost\+found/;
>next if $dirname =~ /^\.\.?$/; # skip . and .. directories
>$cnf = "/home/$dirname/.config";
>$rep = "/home/$dirname/.config.new;
>$cnf_bck = "/home/$dirname/.config_bck;
>
>open(FILE, "<$cnf") or die "Cannot open $cnf : $!";
>open(REP, ">$rep") or die "Can't create $rep : $!";
>select(REP);
>while (<FILE>) {
>if ($N == 0) {
>s/singularity/paradox/;
>} if ($N == 1) {
>s/paradox/singularity/;
>}
>print REP $_ or die "Can't write to $rep : #!";
>}
>rename($cnf, $cnf_bck) or die "Can't rename $cnf to $cnf_bck : $!";
>rename($rep, $cnf) or die "Can't rename $rep to $cnf : $!";
>system("chown $dirname:user $cnf");
>}
>close(FILE);
>close(REP);
>closedir(DIR);
For what it's worth I'd have written this:
#!/usr/local/bin/perl -w
use strict;
my @dirnames;
my $dirname;
my $infilename;
my $N;
print "Select from the following:\n\n";
print "\t0 = switch paradox to active\n";
print "\t1 = switch singularity to active\n\n> ";
chomp ( $N = <STDIN> );
$ENV{'HOME'} = "$ENV{'HOME'}/QA/test/u1";
# aqcuire the home directories only
chomp ( @dirnames = `find $ENV{'HOME'}/.. -type d` );
foreach $dirname ( @dirnames ) {
print "$dirname\n";
next if $dirname =~ /lost\+found/;
next if $dirname =~ /^[\.|\.\.]/;
# check file exists
if ( -e "$dirname/.config" ) {
open ( FILE, "$dirname/.config" ) ||
die ( "Could not read input file. $!\n" );
open ( OUT, ">$dirname/.config.new" ) ||
die ( "Could not open temp file. $!\n" );
while ( <FILE> ) {
if ( /^UserName/ ) {
# $1 substitutes for the whatever the
# pattern in the first parentheses set matches
# in this case it substitutes the user's home
# dir name into UserName
my $dir = $dirname;
$dir =~ s/.*\/(.*)/$1/;
# in order to match inverted commas (or quotes)
# the character has to be escaped ( eg. \' or \" )
s/(.*)\'\'/$1\'$dir\'/;
print OUT;
# I'm not sure if the inverted commas in the
# replacement string must be escaped. Try it
# either way to see
} elsif ( /^DBHostName/ && $N == 0 ) {
s/singularity/paradox/;
s/(.*)\'\'/$1\'paradox\'/;
print OUT;
} elsif ( /^DBHostName/ && $N == 1 ) {
s/paradox/singularity/;
s/(.*)\'\'/$1\'singularity\'/;
print OUT;
} else {
print OUT;
}
}
rename ( "$dirname/.config.new", "$dirname/.config" ) ||
die ( "Could not rename temp file. $!\n" );
}
}
and on the test set:
u1/.config
UserName: 'mhammer';
HostName: '';
DBHostName: 'singularity';
DBName: 'servicedb100';
u2/.config
UserName: 'gary';
HostName: '';
DBHostName: 'singularity';
DBName: 'servicedb100';
u3/.config
UserName: '';
HostName: '';
DBHostName: 'singularity';
DBName: 'servicedb100';
the script (with option '0') gave the results:
u1/.config
UserName: 'mhammer';
HostName: '';
DBHostName: 'paradox';
DBName: 'servicedb100';
u2/.config
UserName: 'gary';
HostName: '';
DBHostName: 'paradox';
DBName: 'servicedb100';
u3/.config
UserName: 'u3';
HostName: '';
DBHostName: 'paradox';
DBName: 'servicedb100';
Gary (I was bored - OK?)
--
Gary O'Keefe
gary@onegoodidea.com
You know the score - my current employer has nothing to do with what I post
------------------------------
Date: Thu, 05 Aug 1999 12:33:20 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: A matter of style?
Message-Id: <37a9834a.101957329@news.hydro.co.uk>
Gary O'Keefe wrote:
>Mike Hammernik wrote:
>
>> [ snip Mike's code ]
>
> [ snip my code ]
>
> # in order to match inverted commas (or quotes)
> # the character has to be escaped ( eg. \' or \" )
>
> s/(.*)\'\'/$1\'$dir\'/;
> print OUT;
It is not necessary to use $1 here,
s/\'\'/'$dir'/;
would have done.
> # I'm not sure if the inverted commas in the
> # replacement string must be escaped. Try it
> # either way to see
They're not.
>[ snip more code and testing ]
Gary
--
Gary O'Keefe
gary@onegoodidea.com
You know the score - my current employer has nothing to do with what I post
------------------------------
Date: Thu, 05 Aug 1999 04:34:42 -0800
From: Gerard.zavislak@prudential.com (Gerard Zavislak)
Subject: AIX fork() / exec() waiting for child process
Message-Id: <jzfq3.1621$001.781441@WReNphoon3>
I have a PERL script (parent) which kicks off other PERL scripts (children)
using fork() / exec() on AIX 4.2.1. There is code in the parent PERL script
to trap the signals from the children so no zombies (defunct processes) are
created. The problem occuring is that sometimes the parent process is
waiting for one child to finish before a fork() / exec of another child
process is done (this usually occurs with a long running child process).
The code used to trap the child signal is:
$SIG{ CHLD } = \&REAPER;
sub REAPER
{
$SIG{ CHLD } = \&REAPER;
my( $child ) = 0;
$child = wait;
}
Any ideas on how to trap the child signal without having the parent process
wait for extended periods?
-**** Posted from RemarQ, http://www.remarq.com/?b ****-
Real Discussions for Real People
------------------------------
Date: Thu, 5 Aug 1999 10:01:30 GMT
From: ijg@connect.org.uk (I.J. Garlick)
Subject: Re: Complex data structure
Message-Id: <FFzL6I.1yH@csc.liv.ac.uk>
In article <7obimn$tpb$1@nnrp1.deja.com>,
julmajuha@my-deja.com writes:
> Hi!
> It works OK. However, I would like to do the
> following :
>
> for $i (123, 321, 345, 543) {
> push @Codes{$Comp}, $i;
> }
Why?
$Codes{$Comp} = [123, 321, 345, 543];
does what you want. (don't know about the speed difference but gut feeling
is that this should be faster.)
> Similarly, I want to print the codes using
> foreach, something like this :
>
> foreach $i (@{$Codes{$Comp}}) {
^^ ^
You missed a couple of things.
> print "Code = $i\n";
> }
This also works
map {print "Code = $_\n"} @{$Codes{$Comp}};
but is probably less clear to a begginer. (no doubt a guru will point out
other problems with it.)
(All code tried, works, and cut and pasted)
--
Ian J. Garlick
ijg@csc.liv.ac.uk
Science is facts; just as houses are made of stones, so is science made
of facts; but a pile of stones is not a house and a collection of facts
is not necessarily science.
-- Henri Poincaire
------------------------------
Date: 5 Aug 1999 12:04:20 GMT
From: msk@uni-jena.de (Steffen Koehler)
Subject: format-question
Message-Id: <7obuk4$f5c$1@fsuj19.rz.uni-jena.de>
Hello,
I have a question about the formlines.
My format is
format STDOUT =
"@<<<<<<<<<"
$var
.
If $var=q/Hallo/ the result is "Hallo "
or $var=q/An long text with information/ and the result is "An long te"
But what I need is
"Hallo" and
"An long text with information"
independent from the length of $var.
Thanks in advance
Steffen
------------------------------
Date: Thu, 05 Aug 1999 11:55:15 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: Get Executables path
Message-Id: <slrn7qiusu.fcu.mike@lindt.fat.dotat.at>
On 5 Aug 1999 02:54:05 -0500, Abigail <abigail@delanet.com> wrote:
>So, I did a test.
>
> $ cat /tmp/foo1
> #!/opt/perl/bin/perl -w
> use strict;
> print $0, "\n";
> $
> $ cat /tmp/foo2
> #!/opt/perl/bin/perl -w
> use strict;
> exec {"/tmp/foo1"} "lalala";
> $
> $ /tmp/foo2
> /tmp/foo1
> $
>
>
>I was expecting "lalala", and now I'm confused.
I changed your scripts to put a sleep 10 just after the print in foo1,
so I could examine things with ps. I was expecting to see:
me blah blah lalala -w /tmp/foo1
(which would make me expect to see $0 being /tmp/foo1) but I didn't: I saw
me blah blah /some/path/bin/perl -w /tmp/foo1
On FreeBSD and Solaris, and
me blah blah perl -w /tmp/foo1
on Linux 2.2.
So now I'm confused too. But the relevant bit of the linux kernel
appears to do:
if (its_shebangable()) {
my ($interpreter, $scriptname, @otherargs) = parse_shebang_line();
exec $interpreter, basename $interpreter, @otherargs, $scriptname;
}
(except in C, and doing all the bits I haven't, and assuming my 10 minute
glance didn't miss some subtlties, which is likely ;-)
So it looks like a deliberate decision - they could have easily
given the interpreter a C style argv[0] of the original argv[0]
if they wanted to. I think.
--
Mike Bristow, Geek-At-Large. GK/RT0038
one tequila - two tequila - three tequila - FLOOR !!!
------------------------------
Date: 5 Aug 1999 11:17:34 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Hash
Message-Id: <7obrse$dtl$1@lublin.zrz.tu-berlin.de>
Dheera <dheera@my-deja.com> wrote in comp.lang.perl.misc:
>Hi - have you tried
> my %packet_info = Dumper( $obj );
>(notice the % sign instead of the $)
>Then you would be able to do packet_info{'SEQNUM'} to get its value.
Sorry, but you don't know what you're talking about. The most cursory
glance at perldoc Data::Dumper would have shown you this:
Data::Dumper - stringified perl data structures, suitable
for both printing and eval
No way the result of Dumper can be usefully assigned to a hash.
[more inanity snipped]
Look, the minimum requirement for a reply to a question in this
newsgroup is that you test your suggestions if you aren't absolutely
sure. Wild speculations are unwelcome.
>Hope this helps...
No.
Anno
------------------------------
Date: 5 Aug 1999 11:46:17 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Hash
Message-Id: <7obti9$dvj$1@lublin.zrz.tu-berlin.de>
Robert Saunders <robert@iminet.com> wrote in comp.lang.perl.misc:
>I am new to working with hashes.
>
>I have read all the documentation I can find on hashes, but I just
>don't quiet understand it yet..
>
>When I do a..
>
>my $packet_info = Dumper( $obj );
>
>Below is what it returns in the variable $packet_info.. what would be
>the easiest way to access the variables in SEQNUM.. or SESSIONID..
>
>$VAR1 = bless( {
> 'value' => {
> 'SEQNUM' => bless( {
> 'value' => 5337
> }, 'WDDX::String' ),
> 'SESSIONID' => bless( {
> 'value' => 998
> }, 'WDDX::String'
>),
> }
> }, 'WDDX::Hash' );
Hm... You are apparently using Data::Dumper as a means to tell us
what the structure of $obj is. Not a bad idea. But the question
that follows is less than clear. What do you mean by "the variables
in SEQNUM"? SEQNUM is a key in a nested structure of hashes. It
doesn't contain any variables as your question seems to imply.
Just as an example, this
$y = $obj->{value}->{SEQNUM}->{value};
would set $y to 5337.
The same thing could be written a bit more succinctly as:
$y = $obj->{value}{SEQNUM}{value};
Replacing "SEQNUM" with "SESSIONID" would access the number 998 in
your structure.
More generally, I think you're not so much struggling with hashes
but with references (which happen to be to hashes in this case).
It might be a good idea to slow down and tackle plain hashes first,
then references in general, and then apply what you have learned
to the structure above.
On still another hand, it looks like you haven't built that
structure in code of your own. It looks like an object out
of some package you are using. If so, it shouldn't be necessary,
nor indeed advisable, to analyze the objects you get. If the
package (which is really a class) is well written, there will
be functions (really methods) that give you access to all parts
you are supposed to have access to. That's the point of having
objects.
Anno
------------------------------
Date: Thu, 05 Aug 1999 11:58:59 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: How do I open another browser window using Perl?
Message-Id: <7obu9v$4vn$1@nnrp1.deja.com>
In article <7obcgb$iq5$1@news.gstis.net>,
"DC" <church@NOSPAMspinn.net> wrote:
> I want to display a URL in another browser window and then be able to
switch
> back to my original browser window where my Perl/CGI script is
running.
The easyest way to do it is to print a bit of javascript to your html
page - Have a look at http://www.irt.org/script/26.htm for details.
More info is available from comp.lang.javascript
HTH
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 12:22:54 GMT
From: sine2117@my-deja.com
Subject: Re: How do I open another browser window using Perl?
Message-Id: <7obvml$66c$1@nnrp1.deja.com>
In article <7obu9v$4vn$1@nnrp1.deja.com>,
Jeremy Gurney <c4jgurney@my-deja.com> wrote:
> In article <7obcgb$iq5$1@news.gstis.net>,
> "DC" <church@NOSPAMspinn.net> wrote:
> > I want to display a URL in another browser window and then be able
to
> switch
> > back to my original browser window where my Perl/CGI script is
> running.
>
if your perl code print this text it will open a new window:
<script language=javascript>
var stuff;
var windowwidth=640,windowheight=400;
stuff="width="+windowwidth+" height="+windowheight;
new_window = null;
new_window = window.open("http://www.adress.com", "Window",
stuff);
</script>
You just have to adjust som values in the code so it fits you.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 12:27:45 GMT
From: sine2117@my-deja.com
Subject: Re: How do I open another browser window using Perl?
Message-Id: <7obvvm$69i$1@nnrp1.deja.com>
In article <7obcgb$iq5$1@news.gstis.net>,
"DC" <church@NOSPAMspinn.net> wrote:
> I want to display a URL in another browser window and then be able to
switch
> back to my original browser window where my Perl/CGI script is
running. Is
> it a simple print " line of code that ends up being HTML code after
all?
>
> Thanks.
>
> dan :)
>
Let your perl code print this:
> <script language=javascript>
var stuff;
var windowwidth=640,windowheight=400;
stuff="width="+windowwidth+" height="+windowheight;
new_window = null;
new_window = window.open("http://www.adress.com", "Window",
stuff);
</script>
And a nice window will appear, just adjust windowwidth, windowheight,
and the adress so it fits you.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 12:19:53 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: looking for XML comments
Message-Id: <7obvlo$d7a$1@news.mch.sbs.de>
In article <7oaoac$od8@dfw-ixnews6.ix.netcom.com>, ebohlman@netcom.com (Eric Bohlman) wrote:
>David Cassell (cassell@mail.cor.epa.gov) wrote:
[snip]
>: Can we at least apply to certain posters?
>
>Job postings are off topic here.
But, what's the use of reading this newsgroup then, if we can't read
messages that might apply to our questions/problems ? :-)
Michel.
------------------------------
Date: Thu, 05 Aug 1999 12:20:58 GMT
From: mike@fat.dotat.at (Mike Bristow)
Subject: Re: Need some PERL/CGI thinkers please!
Message-Id: <slrn7qj0da.fcu.mike@lindt.fat.dotat.at>
On Thu, 5 Aug 1999 00:29:13 -0500,
Kevin Alexander <kalexa2@_NOSPAM_mindspring.com> wrote:
>
>I'm not that unfamiliar with perl or CGI, but I recently moved to a new host
>from another -- and it takes me time to adjust.
>
>Below is a perl program "puttran.cgi" I wrote called by the line
> <!--#include virtual="/cgi-bin/puttran.cgi"-->
>in a .shtml page.
>
>Originally it was supposed to add something into a form based on the
>QUERY_STRING passed to it.
This has nothing to do with perl. It has everything to do with the way
the web server has been set up. Try the following, in this order:
a) ask the sysadmin of the webserver. He's the one who configured
it, so he knows what he configured it to do.
b) ask in comp.infosystems.www.servers.mac, .misc, ,ms-windows,
or .unix
--
Mike Bristow, Geek-At-Large. GK/RT0038
one tequila - two tequila - three tequila - FLOOR !!!
------------------------------
Date: Thu, 5 Aug 1999 11:06:17 +0100
From: "rezn8" <saxbourne@yahoo.com>
Subject: Re: NT Apache Perl
Message-Id: <7obnm3$esr$1@pegasus.csx.cam.ac.uk>
Andreas Fehr <backwards.saerdna@srm.hc> wrote in message
news:37a95e3d.16223928@news.uniplus.ch...
> On Thu, 5 Aug 1999 10:23:52 +0100, "rezn8" <saxbourne@yahoo.com>
> wrote:
>
> >Yes it does
>
> Yes it does what?
> Where does this answer belongs to!!!
>
> Please, change the way you write messages in this group.
>
>
> >>
> >> >No such file or directory: couldn't spawn child process:
> >> >e:/cgi-bin/news/news.pl
> >> >
> >> >> >More information about this error may be available in the server
error
> >> >log.
> >> >>
> >> >> What did you find there?
> >> >>
> >>
> >> Does e:/cgi-bin/news/news.pl exist?
> >>
>
> Strange, I thought I read somewhere that Apache has changed this,
> but I have tested it on my server and it is still there...
>
> So set a correct #! and you will be fine.
What would be a correct #! if the Perl.exe is in
e:\usr\bin\win32-x86\perl.exe?
>
> Andreas
------------------------------
Date: Thu, 05 Aug 1999 11:04:39 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: NT Apache Perl
Message-Id: <37a96e4b.20333978@news.uniplus.ch>
On Thu, 5 Aug 1999 11:06:17 +0100, "rezn8" <saxbourne@yahoo.com>
wrote:
>
>What would be a correct #! if the Perl.exe is in
>e:\usr\bin\win32-x86\perl.exe?
Your quoting gets better, but still not as good as it might be.
Try your delete button.
As to your questions, did you ever check any of the FAQs?
Try perlwin32faq.html and perlwin32faq6.html
Silly me, I didn't ask before....
Andreas
------------------------------
Date: Thu, 05 Aug 1999 10:52:36 GMT
From: feketeroland11@my-deja.com
Subject: ODBC problem
Message-Id: <7obqdi$2j4$1@nnrp1.deja.com>
Hello!
My problem:
How would it be possible to reach a database with more cgi thorough
ODBC at the same time, in that way i use just one ODBC connection. It
would be really important, because my access to the ODBC database
concern one user.
I would like to solve, that when the users check in from different
places thorough CGI to the IIS they would be able to modify the given
database.
Thanks for the time,
Roland
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 20:51:14 +1000
From: Craig <cmd@nospam_altnews.com.au>
Subject: Re: Perl script as a FTP client
Message-Id: <37A96CA2.169033D4@nospam_altnews.com.au>
I am not quite sure how to use it.
I there a script set up for this ?
Thnax.......
Jeff Lovell wrote:
> Craig <cmd@nospam_altnews.com.au> wrote:
> > I found a Perl script a while ago which could be used as a FTP client to
> > do things such as make dirs, delete & upload etc....
> > Does anyone know where I could find this script?
>
> http://www.cpan.org
>
> look for the Net::FTP module.
------------------------------
Date: 5 Aug 1999 10:18:51 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Question for Perl gurus
Message-Id: <7oboeb$dpk$1@lublin.zrz.tu-berlin.de>
Tom Christiansen <tchrist@mox.perl.com> wrote in comp.lang.perl.misc:
>And your subject line super-sucks, amiguito. I'm adding "guru" to
>my killfile.
Yes. Among the vacuous subjects those like "Simple question", "Newbie
in need" or indeed "Question for Perl gurus" grate in a special way
that isn't easy to pin down. It must have to do with the inane and
undirected flattery they convey. Another part is, they are really
saying "C'm on, answer this, it'll cost you nothing if you're any
good".
Of course, the real question then turns out to be badly posed and in
need of much reading between the lines, so that an answer takes an
inordinate amount of time, even if the technical issues involved
are indeed trivial.
Anno
------------------------------
Date: 5 Aug 1999 10:58:30 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Question for Perl gurus
Message-Id: <slrn7qirim.70l.M.Ray@carlova.ulcc.ac.uk>
On 5 Aug 1999 10:18:51 -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
wrote:
>Tom Christiansen <tchrist@mox.perl.com> wrote in comp.lang.perl.misc:
>
>>And your subject line super-sucks, amiguito. I'm adding "guru" to
>>my killfile.
>
>Yes. Among the vacuous subjects those like "Simple question", "Newbie
>in need" or indeed "Question for Perl gurus" grate in a special way
>that isn't easy to pin down. It must have to do with the inane and
>undirected flattery they convey. Another part is, they are really
>saying "C'm on, answer this, it'll cost you nothing if you're any
>good".
To me, misuse of 'guru' in this way grates for the following reasons:
1. The subtext is often "I suspect I really should know the answer to
this, but by pretending that it's beyond everyone but gurus I absolve
myself from any blame". That's dishonest.
2. It devalues the term. I suppose everyone will have their own idea
of what constitutes Perl gurudom, but I'd suggest that a genuine Perl
guru probably has the following attributes:
Intimate knowledge of Perl internals, possibly gained by
hacking on the source
Can write JAPH one-liners without breaking sweat
Can write three modules using XS before breakfast
Has a bunch of modules on CPAN
Can answer almost any Perl question without consulting the
documentation
Can answer almost any "what will this do?" question without
running the code, however gnarly
It does *not* mean "anyone who has read perlre", which often seems to
be the sense in which newbies use the term.
3. Most of us aren't Perl gurus and probably never will be. This does
not prevent us from being competent programmers. When someone asks a
question aimed at gurus which, in fact, any competent Perl programmer
can answer, this suggests that, if they're sincere, they regard
competence as an almost impossible goal. Thankfully, they're often
wrong and will later look back on this attitude with embarrassment,
but it's not a helpful mindset to have while learning.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: Thu, 05 Aug 1999 11:44:39 GMT
From: Salva <salvador@my-deja.com>
Subject: Re: regex substitutions from static strings
Message-Id: <7obtf4$4h4$1@nnrp1.deja.com>
In article <7obkmf$j07$1@supernews.com>,
"Matt Willsher" <matt@red.net> wrote:
> Hi all.
> I have a config file that contains a set of substitions as follows:
>
> john => joe
> ^james => jim
>
> etc.
>
> These are then split at the \s+=>\s+ and each part is used in a
substitution
> s/$part[0]/$part[1]/.
> This works fine for most cases, but not for more complex substitions
of the
> type:
>
> (\d{1,3})dog(s) => $1cat$2
>
> The result of this is that the regex on the left get matched and
directly
> subsituted as '$1cat$2'. Not ideal :/.
>
> Is there any way around this behaviour?
try this:
s/$part[0]/"\"$part[1]"\"/ee
it will evaluate the substitution string twice so:
eval eval "\"$part[1]"\" ==> eval "$1cat$2" ==> "something about cats"
- Salva.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 5 Aug 99 12:13:49 GMT
From: pijll@phys.uu.nl (Eugene van der Pijll)
Subject: Re: regexp can be your friend
Message-Id: <pijll.933855229@ruunat.phys.uu.nl>
In <37ad5693.13007722@news.skynet.be> bart.lateur@skynet.be (Bart Lateur)
writes:
>Abigail wrote:
>>For overlapping, I fail to come up with a single RE
>How about:
> $_ = 'barfoofoofoobar';
> $pattern = 'foofoo';
> /(?=$pattern).+?$pattern/;
> print "$`\n$&\n$'\n";
>That doesn't replace, but it's a single regex.
Ah, then you should also be able to do:
$_ = 'barfoofoofoobar';
$pattern = 'foofoo';
s/(?=.+?$pattern)$pattern/replacement/s;
print;
This matches the first occurrence of the pattern, not the last.
Eugene
--
\
Eugene van der Pijll : pijll@phys.uu.nl
--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--
------------------------------
Date: Thu, 05 Aug 1999 11:57:28 GMT
From: sine2117@my-deja.com
Subject: Telnet problems
Message-Id: <7obu74$4v9$1@nnrp1.deja.com>
Hello all. I have a very annoying problem, i'm behind a firewall and
port 23 is closed. Actually the only port who is open i think is port
80. So i can't telnet to the server that i'm running my perl-scripts
on.. Is there any web based telnet clinet somewhere that i can use ?
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 08:55:59 -0400
From: Chris Goodwin <archer7@mindspring.com>
Subject: Re: unus sed leo
Message-Id: <37A989DF.2425A3CB@mindspring.com>
Tom Christiansen wrote:
>
[snippage]
> Innumerable stories are recounted of tiger teams of programming gods
> who, in a few days of Herculean labor, recreate in blinding clarity
> and dramatic improvemnt the work of scores of drones who'd strugled
> over something for months and months. Rumor has it that at the Labs
> someone once decided that the optimal way to get nearly any software
> project done in the least time, the least cost, and the highest quality
> (all by several orders of magnitude) was to lock away Ken and a couple
> of his pals into a hacking room for a long weekend of work.
This could be apocryphal but....
We're all aware of (whose?) Law, which states that any project expands to
fill the available time. Dick Clark (yes, *that* Dick Clark) apparently has
one he goes by which states that any project also contracts to fill the
available time. I've seen it in action; I've been given projects that I
know would only take three days, but if I've got two weeks to do them there
are always interruptions, things that come up, and so on, the feeling is
that I don't need to focus as hard. On the other hand, if you have two days
to do it, you'll really focus. People will see you hunched over with a
maniacal gleam in your eye and turn the other direction rather than
bothering you with something trivial (or they'll get their heads bit off).
You'll do whatever it takes to get it done in that day. Mr. Clark has been
known to deliberately give himself short deadlines in order to save work.
--
Making the world safe for anocracy! http://www.mindspring.com/~archer7
L. Neil Smith Supporter http://members.xoom.com/smith4prez
Sign up for E-gold: http://www.mindspring.com/~archer7/e-gold.html
------------------------------
Date: 5 Aug 1999 12:09:14 GMT
From: revjack <revjack@radix.net>
Subject: Re: Useless error when {} unbalanced
Message-Id: <7obuta$hgr$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Alan Curry explains it all:
:In article <7o9mka$8r7$2@brokaw.wa.com>,
:Jerome O'Neil <jeromeo@atrieva.com> wrote:
:>
:>When you start a new block, always put the closing bracket in before
:>you do anything else.
:I've been wondering if I'm the only one who does that.
Ditto here. It's a survival mechanism that evolved from being constantly
interrupted all day. I also type:
print qq{};
or whatever, then fill it in. Same for here-docs.
------------------------------
Date: Thu, 5 Aug 1999 12:10:03 +0100
From: "Mujakporue, Trey" <tmujak@wcom.co.uk>
To: "'comp.lang.perl.misc@list.deja.com'" <comp.lang.perl.misc@list.deja.com>
Subject: WRITING A TIMER IN PERL
Message-Id: <11020643E71FD311ACAA0008C7C563F3AF2245@gblon1c3ex1.wcom.co.uk>
Can any one Please give me a few pointers as to writing a timer i perl.
what i would like to do is something along the lines of this
Pseudo Code :
set timer to count down to zero (count must be in seconds)
while (timer != 0 ){
do some really weird stuff;
}
Any pointers??
-----Original Message-----
From: Dan Zetterstrom [mailto:methabol@hem.passagen.se]
Sent: 04 August 1999 11:14
To: comp.lang.perl.misc@list.deja.com
Subject: Newsgroup suggestion! was: Re: Perl CGI vs VB ASP
Message from the Deja.com forum:
comp.lang.perl.misc
Your subscription is set to individual email delivery
On 3 Aug 1999 21:49:19 -0500, abigail@delanet.com (Abigail) wrote:
>David Cassell (cassell@mail.cor.epa.gov) wrote on MMCLXIII September
>
>-- Now what was your Perl question? :-)
>
>
>No, no, no. The subject started with 'Re:'. So, he was posting an answer.
Now I got it! Maybe we should start comp.lang.perl.jeopardy instead of
the other groups that have been suggested. Then Tom C can move his FAQ
answers there and the newbies can reply with their questions, and it
will even _come_in_the_right_order_!
//DZ
--
Come the end, the only thing remaining
was the darkness in his soul.
Facing his fate with serenity
never to awake from the digital daydream.
_____________________________________________________________
Deja.com: Share what you know. Learn what you don't.
http://www.deja.com/
* To modify or remove your subscription, go to
http://www.deja.com/edit_sub.xp?group=comp.lang.perl.misc
* Read this thread at
http://www.deja.com/thread/%3C37ba0abf.116984474%40news.algonet.se%3E
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 05 Aug 1999 12:03:31 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: WRITING A TIMER IN PERL
Message-Id: <37a97cd6.24056391@news.uniplus.ch>
On Thu, 5 Aug 1999 12:10:03 +0100, "Mujakporue, Trey"
<tmujak@wcom.co.uk> wrote:
>Pseudo Code :
>set timer to count down to zero (count must be in seconds)
>while (timer != 0 ){
> do some really weird stuff;
> }
>
>Any pointers??
Timer has something to do with time....
One way would be (pseudo code):
Get current time (in seconds)
Add (e.g.) 3 seconds
Wait until the current time is larger? than the calculated one.
>
>-----Original Message-----
>From: Dan Zetterstrom [mailto:methabol@hem.passagen.se]
snip
What was that??
Andreas
------------------------------
Date: Thu, 05 Aug 1999 12:06:10 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: WRITING A TIMER IN PERL
Message-Id: <37a97de6.24328722@news.uniplus.ch>
On Thu, 05 Aug 1999 12:03:31 GMT, backwards.saerdna@srm.hc (Andreas
Fehr) wrote:
>Wait until the current time is larger? than the calculated one.
^^^^^^^
So what's the size of time?
Andreas
------------------------------
Date: Thu, 5 Aug 1999 08:50:48 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: WRITING A TIMER IN PERL
Message-Id: <Pine.GSO.4.10.9908050845440.27740-100000@crusoe.crusoe.net>
[posted & mailed]
The smarter way to implement at timer is to use Perl's alarm() function,
an eval { } block, and $SIG{ALRM}.
$SIG{ALARM} = sub { die "--alarm--\n" };
eval {
alarm(5); # ABOUT 5 seconds
while (1){
# do some funky stuff
}
}
if ($@){
if ($@ =~ /--alarm--/){ warn "timed out!\n" }
else { die $@ }
}
--
jeff pinyan japhy@pobox.com
japhy's little hole in the (fire) wall: http://www.pobox.com/~japhy
perl stuff japhy+perl@pobox.com
japhy's perl supposit^Wrepository: http://www.pobox.com/~japhy/perl
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 380
*************************************