[6994] in Perl-Users-Digest
Perl-Users Digest, Issue: 618 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 16 18:08:23 1997
Date: Mon, 16 Jun 97 15:01:53 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 16 Jun 1997 Volume: 8 Number: 618
Today's topics:
libwww-perl, how-to-do-this, please help! ()
mac2iso.pl? mac2html.pl? <schmeil@pixelpark.com>
Re: Magical Auto-increment operator <robp@electriciti.com>
Re: Magical Auto-increment operator <rootbeer@teleport.com>
Re: Mailing in Perl <sibsib@hotmail.com>
Re: Modifying a file (Tad McClellan)
Moving from perl 5.003 to 5.003_05 <tboon@vnet.ibm.com>
Re: MS SQL database connector for HTML??? <boei@trifox.com>
Multiple cookies <mark@sierra-inc.com>
no output from a second perl program called? <joshua@uic.edu>
Re: numrows in Oraperl (Kjetil Skotheim)
Re: numrows in Oraperl (Alligator Descartes)
open fork and stdout (Jean-Damien Durand)
Re: Opening Files <jan@virtualf.com>
Re: Opening Files <jan@virtualf.com>
Perl & Visual Interdev <rmarcotte@ou.edu>
Re: Perl 5.004 binaries for Windows 95 (Paul Moore)
Perl Compiler for NT ? <lwilson@creo.com>
perl compiler problem <maxi@chim1.unifi.it>
Re: Perl Database (Which is better) (dkoch)
Re: Perl for Win32 and sockets programming --- is it po (Chris Nandor)
Re: Perl interpreter for Windows 3.1 or MS-DOS 6.xx? <Harald.Joerg@mch.sni.de>
Re: perl joke of the day ? (Steffen Beyer)
perl script to add/delete/modify/view CSV record throug gallo@gsi.fr
Re: Perl to awk translator <mkruse@shamu.netexpress.net>
PerlScript & ASP Session Objects <mcknight@blarg.net>
Re: PLEASE HELP: Problems with using perl to generate H <perlprogrammer@hotmail.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Jun 1997 09:51:38 GMT
From: kenliew@mouse.pacific.net.sg ()
Subject: libwww-perl, how-to-do-this, please help!
Message-Id: <5ntpja$3n9$1@newton.pacific.net.sg>
Hi,
can someone some me how to do the following?
using libwww-perl to HTTP POST a cgi (and the cgi will return a form), and then parse
the response "form" and uses the form input data to build another html page and print
it out.
Below is what I have figure out so far...
-----------------------------------------
...
@arr=('Some_var',$in{'Some_var'},'Another_var',$in{'Another_var'});
$content=esc(\@arr);
$headers=new HTTP::Headers
'Content-Type' => 'application/x-www-form-urlencoded',
'MIME-Version' => '1.0',
'Date' => HTTP::Date::time2str(time),
'Content-length' => length($content),
'Accept' => 'text/html',
'Accept' => 'text/plain';
$url = new URI::URL('http://my_machine/Get_Page_from_original_site');
$request = new HTTP::Request('POST', $url, $headers, $content);
$response = $ua->request($request);
...
$server_response = $response->as_string;
...
Now, things that I am not sure how to do...
-------------------------------------------
1. When I call $us->request($request) My cgi immediately display the html
return by http://my_machine/Get_Page_from_original_sit ... which I do not
want. HOW DO I STOP LWP FROM PRINTING THIS OUTPUT HTML?
2. Instead of printing out the original html response, I wanted to parse
this $response->as_string and get all the INPUT data variables, and
place it in another customized html file which uses this data. What I
mean here is, instead of showing a form html page with populated data
and submit button, I wanted to print out their values in table with
no modification option (no submit, no form). How can I do that?
thanks and appreciate. if possible, can reply mevia email? thanks again.
my email is kenliew@pacific.net.sg thanks!
regards,
Ken
--
---- ~(o)~(o)~ ----
Kenneth Liew - Systems Engineer
Pacific Internet Pte. Ltd.
---- ----
------------------------------
Date: Fri, 13 Jun 1997 15:03:16 +0200
From: Martin Bernd Schmeil <schmeil@pixelpark.com>
Subject: mac2iso.pl? mac2html.pl?
Message-Id: <33A14513.9843D784@pixelpark.com>
After searching for a Mac-character set to ISO 8859-1 or HTML converter
in the perl
FAQs, the perl archive, Alta Vista and Deja Vu without success I need
your help. I can't believe that I'm the first one who needs stuff like
this. So please let me know where I can find these code snippets. (BTW -
I did find the scripts - at least the names - on a french site, but were
not allowed to ftp / d/l them).
Thanx a lot! - tB!
PS - If these srcipts don't exist (public available) I would programm
them myself. I'd need some infos on Mac-character codings (I heard
something about multiple code
characters). Thanx for any help!
------------------------------
Date: Thu, 12 Jun 1997 18:55:01 -0700
From: Rob Perelman <robp@electriciti.com>
Subject: Re: Magical Auto-increment operator
Message-Id: <Pine.SUN.3.91.970612184459.5376B-100000@circuit>
On Thu, 12 Jun 1997, Tom Phoenix wrote:
> Oh, let's not forget that it might start with a negative sign. I think
> you'd want to put "-10" in category two, so that it wouldn't increment to
> "-11"! :-) And I think you'll need to allow for some other characters in
> front, such as whitespace or a plus sign. Those should be in category two
> as well. How about ".25", which I think should become 1.25?
Right...I thought about that after I wrote the message and modified my
code to allow for that. But we're still not totally in sync...
> 1. If the argument has already been used as a number,
> or if the first character is in [\d\-\s+.] , or
> if no character is in [A-Za-z0-9], then
> increment it as a number.
My regex was a little different. It was /^\s*[-+]?\s*\.?\d/ for it to be
incremented as a number. This way the digit is necessary in the string.
This regex would allow for something like '..a' to be incremented to
'..b' and not 1, which I prefer. If you're looking for simplicity as far
as the Perl code goes, I suppose I could agree on yours if you add the
plus sign, but I greatly prefer mine as it would allow for the case
listed above as well as ' a' to ' b' and '---a---' to '---b---', etc.
Also, I don't see a reason for the second half concerning the
auto-increment. I don't want '#' to increment to 1, I want it to
increment to '0#', personally. I can't think of a practical use for it,
but it seems more useful than 1.
> 2. Otherwise, use magical autoincrementing.
Yes, exactly! :)
> > This would allow '.' to get autoincremented to '..' instead of 1, '..e1'
> > to '..e2', 'cs2#09' to 'cs2#10', 'a1z9' to 'a2a0' and 'cats 12' to 'cats
> > 13'.
> Here's my idea of what I _think_ you want for a simple rule. (Not that I
> call this simple. :-)
Again, close but not exactly what I had in mind...
> a. "Digits" come from one of the sequences [0-9], [a-z], [A-Z], and
> spacers are all other characters.
>
> b. Spacers are left unchanged in a magical autoincrement.
>
> c. Beginning with the last character, Perl tries to increment one "digit"
> within its range. If it succeeds, it's done.
>
> d. If a "digit" would go out of range, Perl sets it to the start of its
> range ('0', 'a', or 'A') and tries again with the character to the left.
>
> e. If Perl runs out of digits to increment, Perl will presume a
> "suppressed leading zero" was in front of the string, so it will prepend a
> '1' to the string and be done.
Everything is good except d & e. In d, it should be specified that if if
the next character to the left is a spacer, it will move left until it
finds a digit. Further, my implementation did not always prepend a '1'
to the string; it would take into consideration the leftmost digit and
use that to extend the string. Therefore, if after changing the leftmost
digit from a 'z' to an 'a', it would prepend an 'a'. The same would hold
for each of the ranges. So 'zz' would become 'aaa', 'ZZ' would become
'AAA', and '9a' would become '10a'. Again, this is not the major point I
want to change ('cs2#07' -> 'cs2#08' is my ultimate goal), but I think
this way is more benefitial.
> Are we getting close to having the same idea? If so, the next step is to
> see whose code would break... :-)
Everyone's, I hope. :)
--------------------------------------------------------------------------
Rob Perelman robp@eciti.com http://www.eciti.com/robp/
San Diego Rocks sdrocks@eciti.com http://www.eciti.com/sdrocks/
Alphabet Records alphabet@punketc.com http://www.punketc.com/alphabet/
--------------------------------------------------------------------------
------------------------------
Date: Sat, 14 Jun 1997 07:56:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rob Perelman <robp@electriciti.com>
Subject: Re: Magical Auto-increment operator
Message-Id: <Pine.GSO.3.96.970614073419.4940M-100000@kelly.teleport.com>
On Thu, 12 Jun 1997, Rob Perelman wrote:
> > 1. If the argument has already been used as a number,
> > or if the first character is in [\d\-\s+.] , or
> > if no character is in [A-Za-z0-9], then
> > increment it as a number.
>
> My regex was a little different. It was /^\s*[-+]?\s*\.?\d/ for it to be
> incremented as a number. This way the digit is necessary in the string.
Well, I wrote the rule that way both for simplicity and to speed things
up. It's pretty fast for non-magical incrementing, because we can go
directly to the speedy numeric increment after examining the first
character of the string. If you want to add other numeric cases after
checking the first character, that would have little impact, though.
> Also, I don't see a reason for the second half concerning the
> auto-increment. I don't want '#' to increment to 1, I want it to
> increment to '0#', personally. I can't think of a practical use for it,
> but it seems more useful than 1.
Well, if there's no practical use for it, it belongs in Java instead of
Perl. :-) Seriously, I don't see any reason to allow that. (And wouldn't
that mean that "\n" would increment to "1\n"? I'm sure that would break
something.)
> my implementation did not always prepend a '1' to the string; it would
> take into consideration the leftmost digit and use that to extend the
> string. Therefore, if after changing the leftmost digit from a 'z' to
> an 'a', it would prepend an 'a'. The same would hold for each of the
> ranges. So 'zz' would become 'aaa', 'ZZ' would become 'AAA', and '9a'
> would become '10a'.
My implementation idea had a bug: We can't prepend a '1', since the next
iteration would see that as a numeric value! So prepending either 'a' or
'A' at overflow sounds much more reasonable now.
So, could you write up the new rule as it would have to appear in the
documentation? I'd like to see something concise and unambiguous which
illuminates the exact behavior and the contrast with the current behavior.
Also, can you show in what way the world will be better off with this
implemented in the Perl core rather than (say) in a module? (The module
would almost certainly require different calling syntax, of course, but it
would be much less likely to break anything.)
You may yet convince me that this is a worthwhile change. :-)
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 12 Jun 1997 21:12:38 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: Mailing in Perl
Message-Id: <33A09E86.61CFA63D@hotmail.com>
Arthur Merar wrote:
> I am trying to write a Perl program that will send e-mail. All I get is
> a dialog box that says 'Document contains no data'.
>
> Am I missing something?
This looks like a CGI question, so you might get better answers in
comp.infosystems.www.authoring.cgi
However, as a first guess, do you have
print "Content-type: text/html\n\n";
in your program?
Scott
--
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net
------------------------------
Date: Thu, 12 Jun 1997 20:00:51 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Modifying a file
Message-Id: <346qn5.be1.ln@localhost>
Brett Borger (bxb121@psu.edu) wrote:
: I wrote before, I'm the one using the bastardized version of 4.?? Perl for
: Novell....Can someone please tell me if there is an easier way to modify
: the contents of a file than the way I am doing?
: I am replacing the occurance of a date within a text file with a new date.
: My current method is to read in the file, do a s// on each line, write
: the modified strings to a new file, unlink the old one, then rename the
: new one to the old one.
That is the usual way. You have seen the Perl FAQ dealing with this,
right?
---------------------
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?
---------------------
: Is there a way I can modify the file itself without having to do this
: copy?
Yes, but only if your dates are of equal size.
You seek() to the start of the date and overwrite the correct
number of bytes.
Also see the -i switch in the perlvar man page. At least you can have
perl do the file copying for you...
: I'd appreciate it if you could respond to me in private mail, but since I
: have used up my newbie freebie, I will be reading this group for the next
: few days.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Fri, 13 Jun 1997 16:38:42 +0200
From: Thomas Boon <tboon@vnet.ibm.com>
Subject: Moving from perl 5.003 to 5.003_05
Message-Id: <33A15B71.EE030C10@vnet.ibm.com>
I have the following problem going from perl 5.003 to 5.003_05:
My script, which was doing fine, suddenly crashed and came up with the
message:
Can't locate object method "format_name" via package "IO::Handle" at
/ewhome/e4accept/util/ewreport line 104, <DATA_FILE> chunk 1.
Can it be that the function format_name has changed?
(The two versions are installed on different machines, so a may be a
configuration problem)
Thanks,
Thomas
------------------------------
Date: Fri, 13 Jun 1997 18:22:04 -0700
From: Bob Eisner <boei@trifox.com>
To: Clem Dye <clem@bastet.dircon.co.uk>
Subject: Re: MS SQL database connector for HTML???
Message-Id: <33A1F23C.25BD@trifox.com>
Hi Clem,
Trifox has a product, VORTEXperl. It talks to multiple RDBMS.
It uses Perl Sockets so there is no need to re-build the Perl
runtime.
VORTEXPerl provides a simple interface for Perl applications to
access all leading relational and legacy databases via the
VORTEX database access and performance boosters, like
VORTEXaccelerator, the industry-leading high performance
transaction process monitor. With VORTEXPerl you can quickly
access DBMS information from CGI applications and spend your
time making your application great without bothering with DBMS
details.
Please see http://www.trifox.com/j/vortex/vtxperl.html for details.
Regards,
Bob Eisner
408.369.2392
Clem Dye wrote:
>
> I wonder if the collective wisdom of the newsgroup readers could possibly
> steer me in the right direction?
>
> I'm looking for a database 'connector' (if that's the correct term) which
> will allow me to connect to and execute queries in/from a Microsoft SQL
> database (SQL 6.5) from within a perl script embedded in an HTML/web page.
> I've found useful-looking bits for SyBase, Oracle etc. databases but so far,
> am having no real luck with MS SQL tools.
>
> I'm attempting to keep things as 'standard' as possible and would rather not
> therefore use another Microsoft product such as VisualInterdev/VBScript etc.
> at this time. I'm aware that a Win32::ODBC module exists for Windows 95/NT,
> but as I understand it, this requires that the system running Perl has ODBC
> drivers loaded. This is fine for a Microsoft shop, but what about
> cross-platform connections say from a Unix system? Ideally, I want to keep
> everything server-based.
>
> As a thought, will the Win32::ODBC module run fine on a server back-end
> only, or am I getting confused here?
>
> Does anyone have any ideas, or am I going to have to resolve myself to learn
> and use yet another Microsoft product?
>
> Direct mail replies are most welcome if this post is considered
> 'inappropriate' for the group.
>
> Regards
>
> Clem Dye
> clem@bastet.dircon.co.uk
------------------------------
Date: Fri, 13 Jun 1997 17:27:52 -0400
From: mark <mark@sierra-inc.com>
Subject: Multiple cookies
Message-Id: <33A1BB58.33A1@sierra-inc.com>
I'm having trouble setting more than one cookie at a time in a script.
My code so far is:
print "Content-type: text/html\n";
print "$my_lunch{'a'}\n";
print "$my_lunch{'b'}\n";
print "$my_lunch{'c'}\n";
print "$my_lunch{'d'}\n";
print "Set-cookie: xxx=XXX; expires=Thursday, 01-Jan98 12:00:00 GMT\n";
print "Set-cookie: yyy=YYY; expires=Thursday, 01-Jan98 12:00:00 GMT\n";
print "\n";
print "Some HTML stuff...";
No matter what iterations of the set-cookie lines I try, only the last
one is ever written (all of the entries in the %my_lunch hash are
correct). Why is this happening? Also, even when I set my cookies with
already expired expiry dates, it dosen't have the effect of deleting the
cookie. Is there a reason for this? Is there any other way to delete
cookies?
Thanks. Please send email in response.
Mark
------------------------------
Date: Fri, 13 Jun 1997 00:43:01 -0500
From: Joshua Frigerio <joshua@uic.edu>
Subject: no output from a second perl program called?
Message-Id: <33A0DDE5.E50@uic.edu>
I'm just a beginner, so sorry if this is simple, but I've been searching
the faqs for a 1/2 hour and can't find the answer.
Why is it that when my perl program calls another perl program, it
doesn't show the standard output from the second program? What can one
do to see it?
E.g.,
The first program called hello is this:
#!/usr/bin/perl
`hello2`;
the second one, called 'hello2' is this:
#!/usr/bin/perl
print "wow \n";
When I run 'hello', shouldn't I see "wow" ?
thanks.
------------------------------
Date: 13 Jun 1997 14:22:45 GMT
From: kjetil.skotheim@usit.uio.no (Kjetil Skotheim)
Subject: Re: numrows in Oraperl
Message-Id: <5nrl3l$plt$1@ratatosk.uio.no>
In article <33A0CC0E.E7231EFB@csu.edu.au>, mwhite@csu.edu.au says...
>
>Is there a function in Oraperl to return the number of rows that a query
>will return as numrows does in msql?
>ora_fetch in a scalar context returns the number of fields, which I know
>anyway.
>
>Matthew
No, you have to use a query select count(*) from ....
to do that.
------------------------------
Date: 13 Jun 1997 10:46:35 -0700
From: descarte@hermetica.com (Alligator Descartes)
Subject: Re: numrows in Oraperl
Message-Id: <5ns11r$84b@nerfherder.hermetica.com>
In article <33A0CC0E.E7231EFB@csu.edu.au>,
Matthew White <mwhite@csu.edu.au> wrote:
>Is there a function in Oraperl to return the number of rows that a query
>will return as numrows does in msql?
You can't tell the numbers of rows that Oracle will return until you've
fetched them all. mSQL is slightly unusual in that respect.
>Matthew
A.
--
Alligator Descartes |
descarte@hermetica.com | "The reverse side also has a reverse side"
http://www.hermetica.com | -- Zen saying
------------------------------
Date: Fri, 13 Jun 1997 07:01:59 -0600
From: Jean-Damien.Durand@cern.ch (Jean-Damien Durand)
To: Jean-Damien.Durand@cern.ch
Subject: open fork and stdout
Message-Id: <866200563.23276@dejanews.com>
Hello all,
Just to report something that puzzle me, hoping someone here
can explain where's is my fault:
In a cgi script, I'm forking gunzip giving it a compressed postscript
file in its stdin:
./..
print "Content-type: application/postscript\n\n" ;
open(GUNZIP,"|-") or exec $gzip,"-d","-c","-" ;
while (<MYSTDIN>) {
print GUNZIP $_ ;
}
Now: If I close GUNZIP the result will be send to stdout (is it here I'm
buggy ?), Thus I was doing:
close(GUNZIP) ;
exit ;
This worked well on many compressed .ps.gz files, but on some appeared
a strange character making ghostview and al. to fail. The faulty
character was \377 character (when I looked at in with emacs).
I've decided to redirect gunzip stdout and print again...:
open(GETSTDOUT,"<STDOUT") ;
close(GUNZIP) ;
while (<GETSTDOUT>) {
print $_ ;
}
Glurg... bad coding ? But well it worked: no \377 character anymore...
So, whatever is doing gunzip, the questions seem to have to be perl ones:
- Did I wrote something badly in the first example ?
- Why second example does not have the same output than the first ?
- Would it be correct to use open2 (if yes : is it a security hole in
cgi... I'm afraid yes), instead of my (perhaps) spaghetti code ?
Thanks a lot,
Cheers, Jean-Damien.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 13 Jun 1997 12:50:07 GMT
From: "Yanco" <jan@virtualf.com>
Subject: Re: Opening Files
Message-Id: <01bc7839$9a53bf60$166083c1@london22>
I may need some pointers on the unwritten newsgroup protocol.
I seem to have answered the question, that somebody else had already
answered.
I do apologize, I didn't see the + beside the original posting.
EXCUSE: Today is first time using newsgroups, and it was my first reply.
Arthur Merar <amerar@unsu.com> wrote in article <33997840.63B3@unsu.com>...
> If I open a file for output, OPEN(FILE,">filename"), and the file
> already exists, will Perl overwrite the file that is there?
>
> Arthur
> amerar@unsu.com
> http://www.unsu.com
>
------------------------------
Date: 13 Jun 1997 12:07:05 GMT
From: "Yanco" <jan@virtualf.com>
Subject: Re: Opening Files
Message-Id: <01bc7833$971f08f0$166083c1@london22>
I may be corrected on this since I have only started Perl, but if you want
to append to a file
append= >>
overwrite= >
Why not write a sub that writes a text string, then change the string and
check the file. (Using a text editor to check the contents.)
open (FILEHANDLER, ">test.txt";
print "this is a string";
close (FILEHANDLER):
open (FILEHANDLER, ">test.txt";
print "this is a total different string and did it change the contents";
close (FILEHANDLER):
Arthur Merar <amerar@unsu.com> wrote in article <33997840.63B3@unsu.com>...
> If I open a file for output, OPEN(FILE,">filename"), and the file
> already exists, will Perl overwrite the file that is there?
>
> Arthur
> amerar@unsu.com
> http://www.unsu.com
>
------------------------------
Date: Fri, 13 Jun 1997 07:38:09 -0500
From: Robin Marcotte <rmarcotte@ou.edu>
Subject: Perl & Visual Interdev
Message-Id: <33A13F31.6CA5@ou.edu>
I've written several dynamic html pages using Perl and the Win32:ODBC
library to access my MS SQL Server.
I'm now wanting to re-write these pages as .asp pages using Visual
Interdev. Apparently, Visual Interdev can allow Perl as a scripting
language, but I'm unsure as to what I need to do to get Visual Interdev
to allow Perl scripting. It looks like I may need to make a registry
entry to accomplish this.
The reason why I'm re-writing my dynamic html pages as .asp pages is so
that I can reset the registry entry that I had to make to allow a new
console to run for each user accessing my pages. I'm uncertain as to
how much memory is required for each new console, but I know that I am
going to have A LOT of traffic on these particular pages (intranet app).
Anyone have any experience with writing Perl scripts with Visual
Interdev?
------------------------------
Date: Mon, 16 Jun 1997 21:00:07 GMT
From: gustav@morpheus.demon.co.uk (Paul Moore)
Subject: Re: Perl 5.004 binaries for Windows 95
Message-Id: <33a5a903.592406@news.demon.co.uk>
On Sun, 15 Jun 1997 12:28:48 +0100, Wm <wm_n00@tarrcity.demon.co.uk>
wrote:
>Fri, 13 Jun 1997 20:04:19 <33a19228.113599@news.demon.co.uk>
>Paul Moore <gustav@morpheus.demon.co.uk> posted...
>
><snip>
>
>>I simply don't have the time at the moment to get this right.
>>Especially as I don't begin to understand what's going on in the
>>make/MakeMaker complexities of a perl build...
>>
>>Is anybody able to offer a pre-built distribution for Windows 95? It's
>>the only way I'm likely to get this working...
>
>Try http://www.ActiveWare.com/ its actually for Win32 (NT and Win95).
>With the documentation that comes with it you will also find details
>about the Win32 mailing lists.
>
>--
>Wm ... did you know? My spell checker wants tarrcity to be atrocity.
But it's not 5.004. They're not as bad as Hip were, but they're still
lagging behind. This is especially frustrating as 5.004 compiles for
Win32 out of the box (but only if the box is NT)...
Paul
------------------------------------------------------------------------
Paul Moore gustav@morpheus.demon.co.uk
I asked my mother for a mind of my own, but she said no
------------------------------------------------------------------------
... DisneyLand: A people trap operated by a mouse.
------------------------------
Date: 13 Jun 97 15:26:05 GMT
From: "Lane Wilson" <lwilson@creo.com>
Subject: Perl Compiler for NT ?
Message-Id: <01bc780f$646eb230$d305a8c0@lwilson>
IS there a Perl Compiler for Windows NT 4.0 ?
Thanks for any replies ...
Lane Wilson
------------------------------
Date: Fri, 13 Jun 1997 15:57:01 +0100
From: Massimo Fontanelli <maxi@chim1.unifi.it>
Subject: perl compiler problem
Message-Id: <33A15FBD.2E56@chim1.unifi.it>
I cannot compile the following code, and I cannot understand why...
Is it possible that I'm committing a silly mistake, I'm not a
real programmer
Can someone help me?
#!/usr/bin/perl
use POSIX;
$dirtest='/tmp';
$dir = POSIX::opendir( $dirtest );
@files = grep(/./,(POSIX::readdir( $dir )));
POSIX::closedir( $dir );
print "\n@files\n";
Thanks in advance
\___Maxi
------------------------------
Date: 13 Jun 1997 19:37:24 -0400
From: dkoch@katie.vnet.net (dkoch)
Subject: Re: Perl Database (Which is better)
Message-Id: <5nsljk$r13@katie.vnet.net>
In article <339BCC77.5215@mci2000.com>,
Howard Yen <howard.yen@mci2000.com> wrote:
>I need to develop a site that will have hundreds of thousands
>of users. Currently the site is done using Perl.
>
>Which of these 3 is the best way to go, in terms of speed,
>expandability and using the least memory.
>
>1. Msql
>2. DB_File
>3. Sprite
>
>hy
Also check out MySQL, http://www.tcx.se
------------------------------
Date: Fri, 13 Jun 1997 09:33:35 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl for Win32 and sockets programming --- is it possible?
Message-Id: <pudge-ya02408000R1306970933350001@news.idt.net>
In article <01bc7749$5b821160$e525a8c0@cube444a>, "Richard"
<richard@inxpress.net> wrote:
#Is it possible to use Perl for Win32 and windows sockets api to write perl
#base TCP/IP scripts?
I don't know about windows APIs; I know that Perl for Win32 has the
basically same sockets capabilities as UNIX Perl. Under Mac, UNIX, or
Win32 Perl you can use the same TCP/IP scripts (unless you want to fork,
which doesn't work on the Mac).
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'08 24 09 0B CE 73 CA 10 1F F7 7F 13 81 80 B6 B6'])
------------------------------
Date: Fri, 13 Jun 1997 14:37:36 +0000
From: Harald Joerg <Harald.Joerg@mch.sni.de>
To: Goh Yong Kwang <s6606555@mercury.np.ac.sg>
Subject: Re: Perl interpreter for Windows 3.1 or MS-DOS 6.xx?
Message-Id: <33A15B30.7E11@mch.sni.de>
Goh Yong Kwang wrote:
> I would like to write Perl scripts on my PC which is running on Win3.1
> and MS-DOS but I can't find a Perl interpreter for Win3.1 or MS-DOS on the
> Internet. Is there any Perl interpreter for WIn3.1 or MSDOS 6.xx? If so,
> where can I download them?
The recipe for Win3.1: <URL:http://www.cs.ruu.nl/~piet/perlwin3.html>
The URL for download:
ftp://$your_CPAN_directory/ports/os2/ilyaz/5.00305/
Yes, it's an OS/2 port. Nevertheless it runs on Win3.1.
--
Oook,
--haj--
------------------------------
Date: 13 Jun 1997 06:07:17 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: perl joke of the day ?
Message-Id: <5nqo2l$hbi$2@en1.engelschall.com>
Stuart Cooper <stuartc@ind.tansu.com.au> wrote:
> The best joke perl I've found so far is this
> (some names changed to protect the guilty)
> if ( (system("cmd")/256) != 0) {
> print "Cmd failed\n";
> exit 1;
> }
> It isn't that funny with the superfluous "!= 0" but the added
> useless "/256" makes it a minor classic.
I would have used
> if ( (system("cmd") >> 8) != 0) {
> print "Cmd failed\n";
> exit 1;
> }
instead; and it's not as superfluous as you think since the return code
is actually placed into the upper 8 (or 16) bits of the return value
of "system", whereas the lower 8 bits are encoded with something else
I can't remember right now.
Of course one can argue about the useless "!= 0" here; sometimes (like
here) I consider it useful to make things clearer to the reader; and
I suppose Perl optimizes it away anyway.
Yours,
--
Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
>> Unsolicited commercial email goes directly to /dev/null <<
------------------------------
Date: Fri, 13 Jun 1997 19:46:34 -0600
From: gallo@gsi.fr
Subject: perl script to add/delete/modify/view CSV record through web forms
Message-Id: <866236246.20211@dejanews.com>
I'm looking for a perl script that add/delete/modify/view records on CSV
flat file through web forms.
Any idea?
======================
Jean-Luc Gallo
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 14 Jun 1997 01:14:42 GMT
From: Matt Kruse <mkruse@shamu.netexpress.net>
Subject: Re: Perl to awk translator
Message-Id: <5nsra2$70j@news1-alterdial.uu.net>
Randal Schwartz <merlyn@stonehenge.com> wrote:
: >>>>> "Martin" == Martin Rvth <martin.roeth@mail.heyde.de> writes:
: Martin> I'm looking for an easy method to translate perl scripts to awk.
: Can we ask, why you need such a translator?
I don't need one, but I'll give an example of an issue that came up
recently:
Person A: "I have some cool perl scripts to do exactly what you need."
Person B: "Yeah, but i need to distribute this to a solaris machine that
does not have perl installed, and installing it is not an
option, for various reasons."
Person A: "Well, these perl scripts dont do anything awk can't do, and
nawk is on solaris, so we can just convert them and they'll
run with no problems."
Person B: "..."
There you go :)
the number of people who would find a p2a translator useful, though, is
small and i dont think anyone would think it was worth their time to
write one.
--
Matt Kruse
mkruse@netexpress.net
http://mkruse.netexpress.net/ http://www.mkstats.com/
---------------------------------------------------------------------------
------------------------------
Date: Mon, 16 Jun 1997 14:44:40 -0700
From: "Jason McKnight" <mcknight@blarg.net>
Subject: PerlScript & ASP Session Objects
Message-Id: <5o4cci$7ld$1@orion.starwave.com>
Has anyone figured out how to access ASP Session objects (cookies, session
variables, etc) in PerlScript? I have figured out how to read most of them,
but the correct syntax to set them is eluding me. That fact that
documentation on this stuff is totally non-existent doesn't help matters
either.
------------------------------
Date: Sat, 14 Jun 1997 01:06:59 -0700
From: perl guy <perlprogrammer@hotmail.com>
Subject: Re: PLEASE HELP: Problems with using perl to generate HTML.
Message-Id: <33A25123.382E@hotmail.com>
Temporary Account wrote:
>
> Hi.
>
> I have written a perl script to generate my home page. The script is
> supposed to open a DBM file, read/update my "hits" counter, and then
> generate the HTML page using the information from above. I am having a
> strange problem--when I run the script from the command line, it works
> fine. The dbm file is updated properly, and the output that comes up on
> my screen is correct. It has a Content-type header with a blank line
> after it, and then my html document.
>
> The problem is, when I call the script through a browser (netscape), it
> seems to be totally ignoring any commands that aren't "print"
> statements. If I don't put the "print" statements right at the top
> (which I can't, since I need to process some info first), the browser
> spits up this message:
>
> "Internal Server Error
>
> The server encountered an internal error or misconfiguration and was
> unable to complete your request."
>
> If I move the print statements to the front, and put the processing
> commands at the end of the script, then the browser reads the HTML file
> properly and displays the page--HOWEVER, the other commands do not get
> executed at all. The DBM file is not opened or modified at all. (I've
> checked the time stamp). If I run the SAME script from the command
> line, it updates the DBM just fine.
>
> If I split the script by putting some print statements at the top,
> followed by the processing commands, followed by the rest of the print
> statements, the browser reads the first print statements, and once it
> reaches the end of them, it immediately kills the execution of the
> script. Neither the processing commands NOR the remaining print
> statements are executed.
>
> I have even toyed briefly with the $| variable, which is supposed to
> control print buffering, but whether it is set to 1 or 0 I get the same
> results.
>
> If anyone has any idea how to solve this problem or what might be
> causing it, I would really appreciate a response, preferably by e-mail
> since I don't always have time to check the newsgroups. I'm growing a
> bit desparate.
>
> I will include the meat of the script below.
>
> Thanks in advance for your time and help.
>
> Chris Price (cgprice@austin.ibm.com, c.price@mail.utexas.edu)
>
> ***********BEGIN PASTE**********
>
> #!/usr/local/bin/perl
>
> $number_of_digits = 6;
>
> #OPEN THE ACCESS COUNTER FILE AND INCREMENT THE COUNTER
>
> while (-f "counter.lock")
> {
> select(undef,undef,undef, 0.1);
> }
> open(LOCKFILE, '>counter.lock') || die("Can't open counter.lock: $!\n");
> dbmopen(%COUNTERS, '/PATH/counterfile', 0777);
> if (!(defined($COUNTERS{'index'})))
> {
> $COUNTERS{'index'} = 0;
> }
>
> $COUNTERS{'index'}++;
>
> $count=$COUNTERS{'index'};
>
> dbmclose (%COUNTERS);
> close(LOCKFILE);
> unlink('counter.lock');
>
> $formatted_count=sprintf("%0${number_of_digits}d",$count);
>
> #THE FOLLOWING LOOP JUST CREATES A STRING TO EXECUTE AT THE SHELL
> # WHICH WILL BE USED TO CREATE A GIF OF THE COUNTER
> $make_img_comm = "/PATH/makeImage ";
>
> for ($i = 0; $i < $number_of_digits; $i++)
> {
> $make_img_comm .= substr($formatted_count, $i, 1);
> $make_img_comm .= " ";
> }
>
> #THE FOLLOWING COMMAND WILL CALL A PROGRAM THAT USES THE GD
> #GRAPHICS LIBRARY TO GENERATE AN IMAGE ON-THE-FLY
> `$make_img_comm`;
>
> open(DEBUG, '>>debug.index');
> printf DEBUG "The counter is: $formatted_count\n\n";
> close(DEBUG);
>
> $|=0;
>
> print "Content-type: text/html\n\n";
> print << "EOP";
> <HTML>
> #BODY REMOVED FOR THE SAKE OF BREVITY
> </HTML>
Hi.. just curious.. did you forget to include the end "EOP" at the
bottom of your script sample?.
print "Content-type: text/html\n\n";
print << "EOP";
<HTML>
#BODY REMOVED FOR THE SAKE OF BREVITY
</HTML>
EOP
Please inform me.. that would cause an error.. if not, I assume not,
then I can give you a better opinion of what to do.. but right there,
you have an error..
------------------------------
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 618
*************************************