[8512] in Perl-Users-Digest
Perl-Users Digest, Issue: 2129 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 18 19:07:44 1998
Date: Wed, 18 Mar 98 16:00:40 -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 Wed, 18 Mar 1998 Volume: 8 Number: 2129
Today's topics:
Re: ? Any Perl scripts already written to print out all <chasecreek.systemhouse@usa.net>
A Couple Questions Mikhail_82@yahoo.com
Re: A Couple Questions (I R A Aggie)
Re: cgi FORMMAIL and images <chasecreek.systemhouse@usa.net>
CGI returns image, closes connection, keeps going? <anthony@outshine.com>
Changing the user name of an NT account with perl <pschmitz@no.spam.stormtech.com>
Re: compiling perl <matt@corp.airmedia.com>
Re: compiling perl <chasecreek.systemhouse@usa.net>
Re: compiling perl <tchrist@mox.perl.com>
Re: compiling perl <tchrist@mox.perl.com>
cpio in a perl script? <keford@ingr.com>
Re: Dynamically checking for existing functions schwern@starmedia.net
Easy but important PERL question (J.D. Beary)
Re: Easy but important PERL question (I R A Aggie)
Estimating connection speed? <ccarr@websocket.com>
Extract columns from a line (Ed Avis)
Re: Extract columns from a line <ajohnson@gpu.srv.ualberta.ca>
Re: Fastest way to grep through a file? (Bennett Todd)
Re: help with trace needed <chasecreek.systemhouse@usa.net>
How to emulate perl scripts with MSIE 4.0 and NT ? <hello@hello.com>
Re: How to populate a 2D array from a file. (Kevin Reid)
Re: How to populate a 2D array from a file. (Bennett Todd)
HYPERBASE CGI vs SQL <MAHLIN@prodigy.net>
Networking Problem ? Perl or Red Hat ? <michaely@alphanet.net.au>
Networking Problem ? Perl or Red Hat ? michaely@alphanet.net.au
NPH script problem on IIS <perlguy@inlink.com>
Re: Oraperl -> DBI/DBD ? (John D Groenveld)
Re: Oraperl and CGI - Does it work? (John D Groenveld)
PERL on win95 <wim.soetens@planetinternet.be>
Re: Perl with form?? <chasecreek.systemhouse@usa.net>
Problems with Stalker Lab mail.exe for NT (J.D. Beary)
Re: Qui sera assez fort pour repondre a ca ?? (in Engli <boys@aspentech.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Mar 1998 22:58:45 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: ? Any Perl scripts already written to print out all of the field names on a form?
Message-Id: <3510504C.2854E4F2@usa.net>
As I have previous stated via a private mail -
It's either CGI.pm or write your own Browser,
but hey, why reinvent the wheel :-)
C'Ya,
Sneex :-)
Peter Perchansky wrote:
> Greetings:
>
> Sneex wrote in message <350FEF36.E983034@usa.net>...
> >Yes - It's called CGI.pm. Under the CGI.pm module it's called dump();
> >
> >An example of which was posted here a day or two ago.
> >Try search DejaNews for CGI.pm
>
> I don't think that's the answer.
>
> Given a HTML page... print out all of the field names, not the values... and
> it should not take submitting the form in order to get the field names.
>
> --
> ===========================================================
> Peter Perchansky, Computer Consultant & Microsoft FrontPage MVP
> Dynamic Net, Inc. DBA PMP Computer Solutions
> Providing Dynamic Databases, Design, & Electronic Commerce Solutions
> FrontPage Web Hosting at http://www.pmpcs.com/services/fpwebhosting.htm
> FrontPage Support http://www.pmpcs.com/support/frontpage.htm
------------------------------
Date: Wed, 18 Mar 1998 16:31:11 -0500
From: Mikhail_82@yahoo.com
Subject: A Couple Questions
Message-Id: <35103D1E.4C424CE6@yahoo.com>
What good will Perl do me if I learn it and what's it for? Is it even
worth all the time and energy to learn this language? Some people told
me its worth it, and others told me its not. Any opinions? An email
reponse is preferred. Thanks!
Mik
------------------------------
Date: Wed, 18 Mar 1998 17:50:44 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: A Couple Questions
Message-Id: <fl_aggie-1803981750440001@aggie.coaps.fsu.edu>
In article <35103D1E.4C424CE6@yahoo.com>, Mikhail_82@yahoo.com wrote:
+ What good will Perl do me if I learn it and what's it for?
What do you want to use it for?
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Wed, 18 Mar 1998 23:14:09 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: cgi FORMMAIL and images
Message-Id: <351053EA.90DA3662@usa.net>
No, but you should be able to upload it to the server and
have it sent via sendmail as an attachment :-)
HTH,
Sneex :-)
Dale Sutcliffe wrote:
> Anyone know of a formmail cgi (or similar) that can accept and send
> images (jpegs) from an applet?
------------------------------
Date: 18 Mar 1998 22:02:21 GMT
From: Anthony Boyd <anthony@outshine.com>
Subject: CGI returns image, closes connection, keeps going?
Message-Id: <6epg9d$gp2$1@news.ncal.verio.com>
The cgi group has been empty for the past couple days, so perhaps someone
can help me here. I have a Perl script which should return data, close
connection, and keep going with additional processing. It's not working:
#!/usr/local/bin/perl -w
# RETURN THE IMAGE.
print "Content-type: image/gif\n\n";
open(IMAGE, "/image.gif");
print <IMAGE>;
close(IMAGE);
close(STDOUT);
sleep 10;
What I find is that the connection doesn't close when I close STDOUT. It
waits for the 10 seconds before closing the connection. Is there any way
to return something immediately, and then do more stuff after the user has
what they need? Even a reference to a man page or page in the Camel book
would help, as I don't even know what I should be looking for.
-Tony
------------------------------
Date: Wed, 18 Mar 1998 15:36:36 -0800
From: "P. Schmitz" <pschmitz@no.spam.stormtech.com>
Subject: Changing the user name of an NT account with perl
Message-Id: <35105A83.7C8FBE85@no.spam.stormtech.com>
Hi everyone:
I am automating the task of creating account on a Windows NT domain
using perl. I would like to have the Full Name field of those account
filled in with the actual name of the person. The Win32::NetAdmin module
uses the userid, and doesn't seem to have a way of specifying what the
full name should be.
Is there a way to change the full name of an account, either while
creating it or afterwards?
Is there another perl module with more complete support for these kinds
of tasks?
Thanks,
Pepijn
------------------------------
Date: Wed, 18 Mar 1998 15:57:51 -0500
From: Matthew MacGibbon <matt@corp.airmedia.com>
To: "Brian J.S. Miller" <brian@rickjames.sapien.net>
Subject: Re: compiling perl
Message-Id: <3510354F.475E@corp.airmedia.com>
Brian J.S. Miller (by way of Matt MacGibbon ) wrote:
>
> Matthew MacGibbon wrote:
> >
> > I remember a while back someone had come up with something that allowed
> > you to create an executable from a perl script. Does anyone know
> > anything about that? (or a perl 2 c converter?)
>
> call me crazy...but can't you just start the script with:
> #!/path/to/perl
>
> and the chmod +x the script?
> brian
Im not sure if i presented myself correctly. The goal is to create an
executable (i think there was a perl compiler) so that the program made
wouldnt run as an interpreted perl script, but a standalone executable.
Your way is how it runs currently, of course, but that means perl is run
to interpret each time the script is called. If a pure exectable can be
created this can be run more effeciently.
So Im not looking for information on how to run perl scripts (im quite
adept with that), Im looking for information on how to COMPILE perl.
------------------------------
Date: Wed, 18 Mar 1998 23:12:05 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: compiling perl
Message-Id: <3510536D.7E46D2C5@usa.net>
Unfortunately, the complier just helps make the Perl load faster.
It is still interpreted... So, like was preiously mentioned, there is
a Perl compiler, but is only make P code, not a true executable.
HTH,
Sneex :-)
Matthew MacGibbon wrote:
> Im not sure if i presented myself correctly. The goal is to create an
> executable (i think there was a perl compiler) so that the program made
> wouldnt run as an interpreted perl script, but a standalone executable.
> Your way is how it runs currently, of course, but that means perl is run
> to interpret each time the script is called. If a pure exectable can be
> created this can be run more effeciently.
>
> So Im not looking for information on how to run perl scripts (im quite
> adept with that), Im looking for information on how to COMPILE perl.
------------------------------
Date: 18 Mar 1998 21:12:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: compiling perl
Message-Id: <6epdcp$pbn$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Matthew MacGibbon <matt@corp.airmedia.com> writes:
:So Im not looking for information on how to run perl scripts (im quite
:adept with that), Im looking for information on how to COMPILE perl.
(What is this "Im" thing?)
I've said this before. I'll said it again:
The native-code perl2cc compiler does *not* make your program
smaller in size,
faster in run-time
more portable,
more maintainable,
more secure,
nor
more robust.
On rare occasion, the speed helps a wee bit, but nothing like fixing a bad
algorithm or serverizing your model. If it's CGI we're talking, you're
entirely barking up the wrong tree. And if you're into code-hiding,
I just don't care to talk to you. :-(
And what is this doing in the modules group? Followups corrected.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
I'm a programmer: I don't buy software, I write it.
--Tom Christiansen
------------------------------
Date: 18 Mar 1998 23:14:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: compiling perl
Message-Id: <6epkgh$4j1$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, sneaker@earthling.net writes:
:Unfortunately, the complier just helps make the Perl load faster.
:It is still interpreted... So, like was preiously mentioned, there is
:a Perl compiler, but is only make P code, not a true executable.
He's bad enough for asking, but you're rather worse for having
given a false answer.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
/* Force them to make up their mind on "@foo". */
--Larry Wall, from toke.c in the v5.0 perl distribution
------------------------------
Date: Wed, 18 Mar 1998 15:09:25 -0600
From: "Keith Ford" <keford@ingr.com>
Subject: cpio in a perl script?
Message-Id: <01bd52b3$8863afe0$35d38781@magic.b10.ingr.com>
I am trying to get the following perl script to execute properly when
invoked through a web server. The two UNIX platforms I have tested on
fail. No error message in the log files. The final "Done" is not printed.
The cpio file is opened but ends up with 0 size. It works when run by
hand, but not when invoked through HTTPD.
#!/usr/bin/perl
$ENV{'HOME'} = '/tmp';
$ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
$ENV{'SHELL'} = '/bin/ksh';
print "Content-type: text/html\n\n";
print "<pre>\n";
open(NEWPRODFILE,"| cpio -o -O test.cpio") || die ("open NEWPRODFILE\n");
print NEWPRODFILE "test.pl\n";
close(NEWPRODFILE);
print "Done!\n";
exit(0);
--
-- Keith Ford, Micro Magic, 205-971-9711
-- http://www.magicbbs.com
------------------------------
Date: Wed, 18 Mar 1998 17:28:01 -0600
From: schwern@starmedia.net
To: egon@tasmanet.com
Subject: Re: Dynamically checking for existing functions
Message-Id: <6epl61$2qq$1@nnrp1.dejanews.com>
Just for completenesses sake, I thought I'd mention the UNIVERSAL::can method.
if( $object->can('print') ) { # object has a print method }
If you're into the OO thing.
In article <350EDF9B.1A0107F5@tasmanet.com>,
Cole Tuininga <egon@tasmanet.com> wrote:
> Is there a way in perl to check for the existence of a function? I know
> about autoloading, but as far as I can tell, there's no way for
> autoloading to check that without actually making the call to the
> function (which I want to avoid). Any thoughts? Thanks in advance...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 18 Mar 1998 21:31:47 GMT
From: JDB@animalwelfare.com (J.D. Beary)
Subject: Easy but important PERL question
Message-Id: <35103d02.10915064@news.erols.com>
hello,
I have a simple redirection script that sends a user to another page,
after they select that page from a pulldown menu.
I can not get it to work with frames however. The script parses the
input and then prints out:
print "Location: $url\n\n";
this makes the script redirect the user to another page within the
current frame. I need the script to redirect to a frame called
"body". How can this be done...
TIA,
J.D. Beary
JDB@animalwelfare.com
------------------------------
Date: Wed, 18 Mar 1998 17:49:48 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Easy but important PERL question
Message-Id: <fl_aggie-1803981749480001@aggie.coaps.fsu.edu>
In article <35103d02.10915064@news.erols.com>, JDB@animalwelfare.com wrote:
+ this makes the script redirect the user to another page within the
+ current frame. I need the script to redirect to a frame called
+ "body". How can this be done...
With CGI.pm:
use CGI;
$query = new CGI;
print $query->redirect(-target=>'_body',-uri=>'http://somewhere.else/');
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: Wed, 18 Mar 1998 15:30:38 -0600
From: Clinton Carr <ccarr@websocket.com>
Subject: Estimating connection speed?
Message-Id: <35103CFE.EB380921@websocket.com>
Is there a simple way a Perl script can estimate the line connection
speed? 14.4, 28.8, etc..
Thanks
------------------------------
Date: Wed, 18 Mar 1998 21:37:22 GMT
From: epa@datcon.co.uk (Ed Avis)
Subject: Extract columns from a line
Message-Id: <350fd736.71744012@news-direct>
I can split a line at spaces using "split". But this doesn't tell me
the points at which the split occurred.
I'd like to be able to take an input file looking like this:
a b c defg
n o pqr
and get output like this:
(first line)
0:a
2:b
5:c
9:defg
(second line)
1:n
3:o
6:pqr
In other words, print the columns plus the places they started at.
I could do this with a lot of substrs and comparing characters with
space, but that would be slow. Is there an elegant way to do this,
perhaps "popping" characters off the front of each line?
TIA,
--
Ed Avis
------------------------------
Date: Wed, 18 Mar 1998 16:30:32 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Extract columns from a line
Message-Id: <35104B08.6C4FB9ED@gpu.srv.ualberta.ca>
Ed Avis wrote:
!
! I can split a line at spaces using "split". But this doesn't
! tell me the points at which the split occurred.
!
! I'd like to be able to take an input file looking like this:
!
! a b c defg
! n o pqr
!
! and get output like this:
!
! (first line)
!
! 0:a
! 2:b
! 5:c
! 9:defg
!
! (second line)
!
! 1:n
! 3:o
! 6:pqr
!
! In other words, print the columns plus the places they started at.
!
! I could do this with a lot of substrs and comparing characters
! with space, but that would be slow. Is there an elegant way to
! do this, perhaps "popping" characters off the front of each line?
elegant? I don't know. but one possible way:
#!/usr/bin/perl -w
while(<DATA>) {
print "(line $.):\n";
print pos()-length($1),":$1\n" while /(\S+)/g;
}
__DATA__
a b c defg
n o pqr
hope it helps
regards
andrew
------------------------------
Date: Wed, 18 Mar 1998 21:30:38 GMT
From: bet@network.rahul.net (Bennett Todd)
Subject: Re: Fastest way to grep through a file?
Message-Id: <slrn6h0fll.5p8.bet@ritz.mordor.net>
For something as small as 20K, I'd guess the fastest approach would be a file
suck --- sluurp the whole thing in as a single string, without parsing it into
lines. And at least on my system (P133, 40MB RAM, Red Hat 5.0, Perl 5.004-2)
it is indeed so; searching the first 20K chopped off /etc/termcap (contains
40 matches):
bash$ ./bar -n 1000
Benchmark: timing 1000 iterations of suck, while...
suck: 5 secs ( 3.52 usr 0.87 sys = 4.39 cpu)
while: 23 secs (22.60 usr 0.73 sys = 23.33 cpu)
Now this is clearly only going to win when the file is tiny. Get into somewhat
larger files and an invocation of the system grep(1) will win --- especially
if it's a GNU grep:-). Same system, 16 copies of /etc/termcap adding up to
6,955,664 bytes containing 4640 matches:
bash$ ./bar
Benchmark: timing 10 iterations of grep, suck...
grep: 2 secs ( 0.01 usr 0.03 sys + 1.82 cusr 0.38 csys = 2.24 cpu)
suck: 9 secs ( 7.59 usr 2.33 sys = 9.92 cpu)
Here's my benchmark code; I ran it with "-n 1 -d" to make sure it was getting
the right counts (and tweaked the regexp in the suck code when it found two
places that the short sample data had two instances of the word in a line).
The first run had the 'while' and 'suck' versions, while the second had 'suck'
and 'grep' (in both cases the omitted versions were taking longer than I
wanted to wait:-):
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
use Getopt::Std;
use vars qw($opt_d $opt_n);
$opt_d = 0;
$opt_n = 10;
my($syntax) = "syntax: $0 [-d] [-n count]\n";
getopts('dn:') or die $syntax;
die $syntax if @ARGV;
open FP, "<foo";
timethese($opt_n, {
'while' => sub {
seek FP,0,0;
my($count) = 0;
while (<FP>) {
$count++ if /terminal/;
}
print "while: $count\n" if $opt_d;
},
'suck' => sub {
seek FP,0,0;
my($irs) = $/; undef $/;
$_ = <FP>;
$/ = $irs;
my($count) = 0;
$count++ while /terminal[^\n]*\n/gs;
print "suck: $count\n" if $opt_d;
},
'grep' => sub {
my($count) = `grep -c terminal foo`;
chomp $count;
print "grep: $count\n" if $opt_d;
},
});
-Bennett
------------------------------
Date: Wed, 18 Mar 1998 23:17:41 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: help with trace needed
Message-Id: <351054BC.FFFF75C@usa.net>
If you are on Unix and really want to get into security issues
with management and users, research 'tcpdump'...
You will be able to watch a particular machine.
You must be root for this to work.
HTH,
Sneex
Mikhail Galbmillion wrote:
> Hello,
> I just started to use Perl recently and haveno idea
> where to start with the following problem:
>
> I need to trace a user(user machine) who tries to add some
> entry to the specific database table. The data is entered on
> web page and is inserted to database using Oraperl.
> I just need to keep track of users who use this web page.
>
> Appreciate your help.
> Thank you,
> Mikhail Galbmillion
> galbmill@21st-century-comm.com
------------------------------
Date: Thu, 19 Mar 1998 00:25:30 +0100
From: "Hello" <hello@hello.com>
Subject: How to emulate perl scripts with MSIE 4.0 and NT ?
Message-Id: <351057f1.0@news1.ibm.net>
Can I emulate perl script with NT 4.0 and MSIE 4.0 (or another web browser)
?
Before uploading my script on an Unix computer, I should like to test it on
NT 4.0
Is it possible with FrontPage 98 beta 2 ?
Is it possible with another software ?
Where can I download it ?
Thanks.
------------------------------
Date: Wed, 18 Mar 1998 16:08:05 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: How to populate a 2D array from a file.
Message-Id: <1d639fs.1s2xvgf10u0bksN@slip166-72-108-185.ny.us.ibm.net>
Bennett Todd <bet@network.rahul.net> wrote:
> Better still, just enclose the results of split in an anonomous array:
>
> while (<TABLE>) {
> push @tab, [ split /,/ ];
> }
<hand slapping against forehead>
I missed that.
But wouldn't it be faster to use unshift?
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Wed, 18 Mar 1998 22:10:59 GMT
From: bet@network.rahul.net (Bennett Todd)
Subject: Re: How to populate a 2D array from a file.
Message-Id: <slrn6h0i1d.5v3.bet@ritz.mordor.net>
>But wouldn't it be faster to use unshift?
I sure hope not! Perl uses arrays, as far as I know (as opposed to linked
lists), and keeps explicit track of their length; hence push should be
quicker. Lessee:
bash$ ./foo 100
Benchmark: timing 100 iterations of push, unshift...
push: 3 secs ( 2.48 usr 0.00 sys = 2.48 cpu)
unshift: 6 secs ( 5.89 usr 0.00 sys = 5.89 cpu)
for the code:
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
timethese(@ARGV?shift:1, {
'unshift' => sub {
my(@a) = ();
for (my $i = 0; $i < 1000; $i++) {
unshift @a, $i;
}
},
'push' => sub {
my(@a) = ();
for (my $i = 0; $i < 1000; $i++) {
push @a, $i;
}
},
});
-Bennett
------------------------------
Date: Wed, 18 Mar 1998 16:28:12 -0500
From: "vladimir mahlin" <MAHLIN@prodigy.net>
Subject: HYPERBASE CGI vs SQL
Message-Id: <6epe9i$h0m$1@newssvr03-int.news.prodigy.com>
Hi Guys,
I'd like to introduce you last technology
available on the market :
HYPERBASE
this is brand new database standard with CGI Perl5
implementation of basic SQL commands which performed on HTML formatted
database
for details info go http://vnet.usww.com:2001/calc.htm
VNET Software
http://vnet.usww.com
Vladimir Mahlin
mailto:mahlin@prodigy.com
------------------------------
Date: Thu, 19 Mar 1998 10:11:46 +1000
From: Michael Yeung <michaely@alphanet.net.au>
Subject: Networking Problem ? Perl or Red Hat ?
Message-Id: <351062C1.69FA62CE@alphanet.net.au>
Sorry for disturbing you !
One our our Client/Server applications was written on Perl 5.003 and
were running on RHS (Red Hat Linux Server)4.1 and 4.2 happily.
On updating one our servers to RHS 5.0 the Server part of the system
refused to answer to any client calls. Event to a client on the same
m/c; but the client on the RHS 5.0 can calls to Servers on RHS 4.1 and
4.2 without problems.
Could this be a Perl problem or RHS problem (ie. new security on opening
IP ports?).
The modules that I am using is the SOcket, FileHandle ! So is there any
difference of these two modules between version 5.003 and version
5.004_01 ?
Your kind advise and relay of this to appropiate personal is very much
apprecaited!!
<Please reply me in this email address : michaely@alphanet.net.au>
best regards,
--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\ Michael Yeung
/ Alpha Network Shop
\ Tel:(02)94133886
/ Mobile : 0411-233-597
\ Fax:(02)94133617
/ mailto:michaely@alphanet.net.au
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
------------------------------
Date: Wed, 18 Mar 1998 17:23:59 -0600
From: michaely@alphanet.net.au
Subject: Networking Problem ? Perl or Red Hat ?
Message-Id: <6epkv3$2gr$1@nnrp1.dejanews.com>
Sorry for disturbing you !
One our our Client/Server applications was written on Perl 5.003 and
were running on RHS (Red Hat Linux Server)4.1 and 4.2 happily.
On updating one our servers to RHS 5.0 the Server part of the system
refused to answer to any client calls. Event to a client on the same
m/c; but the client on the RHS 5.0 can calls to Servers on RHS 4.1 and
4.2 without problems.
Could this be a Perl problem or RHS problem (ie. new security on opening
IP ports?).
The modules that I am using is the SOcket, FileHandle ! So is there any
difference of these two modules between version 5.003 and version
5.004_01 ?
Your kind advise and relay of this to appropiate personal is very much
apprecaited!!
<Please reply me in this email address : michaely@alphanet.net.au>
best regards,
michael
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 18 Mar 1998 14:05:07 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: NPH script problem on IIS
Message-Id: <350FD493.DF315FEF@inlink.com>
Hi,
I am trying to get a script to send output to the users browser without
buffering it.
I have tried the following but it always buffers the output until the
script is done...
1) Used the CGI.pm (:nph) and CGI->nph(1) calls.
2) Flushed buffer after every write with $|=1
3) Named file nph-filename.cgi (Uses Perl.exe)
- Note: When I do this, my browser opens a window so "Save As" or
"Open" the file. If I Open it, the output is sent to Notepad.
4) Tried using PerlIS (Get socket error)
All I want to do is process data in a while loop, and each time through
the loop, let the user know what has happened so far.
"SHOULD" be a simple task.
Thanks in advance,
Brent Michalski
------------------------------
Date: 16 Mar 1998 12:28:09 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oraperl -> DBI/DBD ?
Message-Id: <6ejnf9$4jq$1@tholian.cse.psu.edu>
In article <6e93vh$s1h$1@nntp1.ba.best.com>,
David Fetter <dfetter@shell4.ba.best.com> wrote:
>Is there somewhere a FAQ on how to migrate legacy oraperl code to the
>DBI/DBD scheme?
Fetch DBI, DBD::Oracle. Read the respective README's. Install. Run
perldoc Oraperl. Most oraperl2.4 code will run correctly under
the Oraperl.pm compatability module. You may have some gotchas, especially
from perl4 to perl5.004_04, but most of my code ran out of the box.
Happy perl'ng!
John
groenveld@acm.org
------------------------------
Date: 16 Mar 1998 12:34:48 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oraperl and CGI - Does it work?
Message-Id: <6ejnro$4lq$1@tholian.cse.psu.edu>
Stuck with Oracle 6.0.x? Hence you're stuck with oraperl2.4, hence you're
stuck with perl4. :(
I'm sure you could make this work, but I wouldn't waste your time. Perhaps
your DBA has a test/migration installation of Oracle7 somewhere? Install
perl5 on that machine and make liberal use of the DBI and CGI modules.
John
groenveld@acm.org
------------------------------
Date: Wed, 18 Mar 1998 23:17:38 +0100
From: "Hoegy" <wim.soetens@planetinternet.be>
Subject: PERL on win95
Message-Id: <6ephhi$ooe$1@news3.Belgium.EU.net>
how can I execute a local PERl script with HTML-code.
I can run my PERL-script from DOS, but it doesn't work from my HTML code.
My form doesn't send the data-string to the perl script.
my form looks like this:
<form action="guestbk.pl" method="post">
Naam: <BR><input type=file size=40 name="name"><br>
E-mail: <BR><input type=text size=40 name="e_mail"><br>
<INPUT Type=submit Value="Post">
<INPUT Type=reset Value="Cancel">
If I run it on the web-server, it works fine
------------------------------
Date: Wed, 18 Mar 1998 23:36:57 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Perl with form??
Message-Id: <35105941.21184E7B@usa.net>
Sorry to giggle, but could you be a little more vague?
Perl doesn't add any more form 'entities' to the HTML specs.
This section is for all first timers, etc, --
So, having that said, research CGI.pm and look into a good HTML guide;
once you have seen those two, you will want to get a few books - I
recommend a Red One - Perl 5 by Example first, then Sed & Awk, next
Web Client programming, then if your still kickin' - Learning Perl,
Programming Perl, and
last but not the least - Mastering Regular Expressions :-)
--- Not a complete list by any means, but in a readable sequence which
should help :-)
But research CGI.pm and look into a good HTML guide;
once you have seen those two, you will want to get a few books...
HTH,
Sneex :-)
Buckwood wrote:
> Hi!
> Can anyone help me!! I need some help with how to recive a form with a
> perl script, and I dont know how many form entities there are??
>
> Anders
------------------------------
Date: Wed, 18 Mar 1998 22:02:28 GMT
From: JDB@animalwelfare.com (J.D. Beary)
Subject: Problems with Stalker Lab mail.exe for NT
Message-Id: <35104400.12705054@news.erols.com>
hello,
i am trying to send email from a script in NT 4.0 with IIS 4.0 that
sends postcards.
I am trying to use mail from Stalker Labs... I got the mail program
working but I can not get it to run in the Perl script.
I think the problem is with my PERL syntax as I am quite a newbie @
perl.
This mail program works from the command line afterwhich it lets you
enter the body of the message and it is sent with a ^Z
In the command line, it is required that you enter the recipient of
the email, as I have done here.
Here is the snippet of code that I am having problems with:
$mailprog = 'D:\\InetPub\\mailroot\\mail.exe';
open(MAIL, "|$mailprog -s $CardSubject $in{'ReceiveEMail'}") || die
"Can't open $mailprog!\n";
print MAIL "To: $in{'ReceiveEMail'}\n";
print MAIL "From: $SiteEMail\n";
print MAIL "Subject: $CardSubject\n\n";
print MAIL "Hello! You've been sent a digital postcard from
$in{'SenderName'}!\n";
print MAIL "To retrieve your full color postcard at no charge, simply
connect to $SiteName at the URL below\n";
print MAIL "and it will be promptly delievered to your web
browser!\n\n";
print MAIL " Postcard URL: $PostcardURL?$RandNum+$Time\n\n";
print MAIL "Enjoy your digital postcard! And feel free to send
someone else one!\n\n";
print MAIL "Sincerely,\n\n";
print MAIL "$SiteName\n";
print MAIL "^Z";
close(MAIL);
-------end of Snippet ----
TIA,
J.D. Beary
JDB@animalwelfare.com
------------------------------
Date: Wed, 18 Mar 1998 21:53:52 +0000
From: Ian Boys <boys@aspentech.com>
Subject: Re: Qui sera assez fort pour repondre a ca ?? (in English)
Message-Id: <35104270.2F1C@aspentech.com>
I will answer in English, since you would not want to try reading my
French :-)
It sounds like you want to have a table with two columns, like this,
Fruit Colour
----- ------
apple green
banana yellow
orange orange
plum purple
tomato red
and you want to index it directly on both fruit and colour. In other
words you want to use either the first column or the second column
as a key. So I think a direct solution is to store the table, and then
build an index for each column, like this:
#!/usr/local/bin/perl -w
# some test data
@fruit = qw/apple orange banana plum tomato/;
@colour = qw/green orange yellow purple red/;
# generate the indexes (allowing that @fruit may have 100,000 entries)
for ($i = 0; $i < @fruit; $i++) {
$fruit_index{$fruit[$i]} = $i;
$colour_index{$colour[$i]} = $i;
}
# print out each index to confirm contents
foreach (sort keys %fruit_index) {
print "$_ $fruit_index{$_}\n";
}
print "\n";
foreach (sort keys %colour_index) {
print "$_ $colour_index{$_}\n";
}
print "\n";
# examples of use
$somefruit = "banana";
$somecolour = "purple";
print "A $somefruit is $colour[$fruit_index{$somefruit}].\n";
print "The $somecolour fruit is the $fruit[$colour_index{$somecolour}].\n";
__END__
This will print out:
A banana is yellow.
The purple fruit is the plum.
Clearly another approach is to make two hashes which are the inverse
of each other, as other people have pointed out. You would have to
test to find out which approach uses least memory.
But truly, if the amount of memory used is that much of a problem, then
you should consider installing more memory, or using a different
computer, or writing in some language like C rather than Perl.
I do not think Perl has the data structure you are looking for (a double
self-referencial hash in which keys double as values and values double
as keys). But you might be able to program this yourself using low
level hash library functions and a low level language like C.
Ian
------------------------------
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 2129
**************************************