[7838] in Perl-Users-Digest
Perl-Users Digest, Issue: 1463 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 12 17:08:01 1997
Date: Fri, 12 Dec 97 14:00:27 -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 Fri, 12 Dec 1997 Volume: 8 Number: 1463
Today's topics:
Re: a simple question <bowlin@sirius.com>
Apparent Infinite Loop When Redirecting Output (Kevin M Simonson)
Re: Chunking up a large input file <bowlin@sirius.com>
Re: Chunking up a large input file <rootbeer@teleport.com>
Re: eval / variable scope problem <rootbeer@teleport.com>
Re: failed to close pipe into sendmail <rootbeer@teleport.com>
Re: HELP IN "SIMPLE" FOREACH PROBLEM <brossard@bch.umontreal.ca>
Re: HELP IN "SIMPLE" FOREACH PROBLEM <rootbeer@teleport.com>
Re: Help with special caracters <rootbeer@teleport.com>
New to Perl. How complicated? <dmill@bellsouth.net>
new to perl/ window nt 4.0 <jharvill@epix.net>
Re: Older versions of swatch <rootbeer@teleport.com>
Re: Older versions of swatch (Nobody, Really)
Re: Part of a line <rootbeer@teleport.com>
Re: Perl for windows 95 (Brian DeRosa)
perl multiple redirect (www) <shawn@wwgv.com>
perl puzzler <tuinstra@ti.com>
Re: perl puzzler <talkasab@opal.tufts.edu>
Re: pgp encrypion via perl script (brian d foy)
Re: Pie chart with GD.pm <c4sshir@srv.pacbell.com>
pod2html <bruno_pagis@aur.alcatel.com>
possible type at C:\Perl\lib\Win32\ODBC.pm <henry@DotRose.com>
Re: possible type at C:\Perl\lib\Win32\ODBC.pm <reibert@mystech.com>
Re: possible typO at C:\Perl\lib\Win32\ODBC.pm <henry@DotRose.com>
Re: Question about the =~ operator (John Stanley)
Restricting CGI Programs to Perl. djr@newcoast.com
Re: Shoving an array into a glob? or fixing IO::ScalarA <rootbeer@teleport.com>
Suidperl <keefner@kinetic.com>
Re: SybPerl vs. OraPerl (John D Groenveld)
Re: uninitialized value messages when using -w directiv <rootbeer@teleport.com>
Which language pays most 17457 -- C++ vs. Java? <mixmaster@remail.obscura.com>
Re: Which language pays most 17457 -- C++ vs. Java? (Miguel Carrasquer Vidal)
Re: Which language pays most 17457 -- C++ vs. Java? (Ken Lee)
Re: Which language pays most 17457 -- C++ vs. Java? tholen@ifa.hawaii.edu
Re: Which language pays most 17457 -- C++ vs. Java? <john@tridium.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Dec 1997 11:40:15 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: Petur Henry Petersen <ppeterse@lab.nig.ac.jp>
Subject: Re: a simple question
Message-Id: <3491931F.ED980A77@sirius.com>
Petur Henry Petersen wrote:
>
> if I have @arry which contain 10 numbers and i do a pattern searc for
> one of these numbers how can I get the position of that number in the
> array?
my @nums = qw( 1234 2222 321 44555);
my $i = 0;
my %hash;
foreach (@nums) {
$hash{$_} = $i++;
}
my $searchstr = join('|', @nums);
$_ = "words 2222 words";
m/[^\d]($searchstr)[^\d]/o and print "index: $hash{$1}\n";
The exact search expression depends on your application.
------------------------------
Date: 12 Dec 1997 21:30:59 GMT
From: simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson)
Subject: Apparent Infinite Loop When Redirecting Output
Message-Id: <66saej$8us@sf18.dseg.ti.com>
Keywords: redirect output
I'm writing a "perl" script that creates and uses a significant number
of auxiliary files. I would like to design it in such a way that if the
files stay around from one execution of the script to the next, the new
files don't overwrite the old.
I decided one way to ensure that this would happen would be to make
sure that for any one particular execution of the script, all the files
would need to have the same suffix. So the first thing I wanted my "perl"
script to do is find a unique suffix to use for all the auxiliary files it
would need to create. (For this article I'll assume that the unique suf-
fixes would all be of the form ".x<number>" where <number> is some natural
number.
Two solutions leaped immediately to my mind. I could iterate over a
series of unique suffixes, and for each one do:
@Files = glob ("*.x$Number");
and then check the size of "@Files". But this will clearly eat up a lot of
memory.
I noticed that if I try the Unix command:
ls *.x0 |& grep " not found" | wc -l
then if any files with the ".x0" suffix exist this will display zero;
whereas if none exist this will display some nonzero value (one in all
cases I've tried). So I thought that I could put a line of "perl" code
that said:
$NotFounds = `ls *.x$Number |& grep " not found" | wc -l`;
and check the value of "$NotFounds". This seemed like a much more
straightforward (and less memory intensive) way to solve the problem.
However, when I put the line above in my "perl" script and executed
it, the prompt never came back. I've isolated the problem in the script
I've appended below. For some reason when "perl" executes the "ls" it goes
into some kind of inifinite loop. Does anybody know why this is happening?
If anybody would like to e-mail me a response, my address is
"smnsn@skopen.dseg.ti.com". Thanks in advance.
By the way, it happens whether a file exists that matches "*.x0" or
not.
---Kevin Simonson
#############################################################################
sh^Nag/Source} cat Bug
#!/usr/local/bin/perl
print "Right before \"ls\".\n";
$NotFounds = `ls *.x0 |& grep " not found"`;
print " Past \"ls\".\n";
sh^Nag/Source} date; Bug
Fri Dec 12 15:21:13 CST 1997
Right before "ls".
*.x0 not found
^C
sh^Nag/Source} date
Fri Dec 12 15:27:43 CST 1997
sh^Nag/Source}
-------------------------------------------------------------------------
Reverence To send me mail, remove "_nospam" and
the eternal. all the vowels from my login name.
------------------------------
Date: Fri, 12 Dec 1997 10:49:05 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: Daniel Mills - Software Engineer Alexandria <dmills@riag.com>
Subject: Re: Chunking up a large input file
Message-Id: <34918721.83F5CE7A@sirius.com>
> ....and she said, don't look at me that way</quote><quote>His reply ...
> ^
> read ends here
> Is there a simple way to make the read smart so that it won't break up
> any tags or do I need to devise a completely different approach?
I have found that the most efficient way to parse HTML-ish files is:
$\ = ','; # chuck file at start-tag
while ( <FILE> ) {
my ($tag, $att, $term) = m/^(\w+)(\s*(?:"[^"]*"|'[^']*'|[^>"'])*)(>?)/;
if ( $term ne '>') ...
...
}
$\ = "\n"; # restore normal behavior
The check on the $term character is only needed if you allow embedded '<'s
in your tags. This is very fast. But it might require some rewrite of
your code.
HTH - Jim Bowlin
------------------------------
Date: Fri, 12 Dec 1997 12:28:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Daniel Mills - Software Engineer Alexandria <dmills@riag.com>
Subject: Re: Chunking up a large input file
Message-Id: <Pine.GSO.3.96.971212122417.29438J-100000@user2.teleport.com>
On Fri, 12 Dec 1997, Daniel Mills - Software Engineer Alexandria wrote:
> When the input file becomes excessively large (approx. > 10Mb), the
> program bombs and gives an "Out of memory" message. As far as I can
> tell this is happening because of the way I'm using the input stream
> which is as a single string.
>
> e.g.
> open(FILEIN,"text.sgml")
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> undef $/;
> while(<FILEIN>){
Yes, that'll run you out of memory. You're slurping the entire file into
$_ at once!
> The out of memory problem can be solved if I replace the while with:
> while(read FILEIN,$buffer,BUFSIZE)
>
> The problem with this approach is if the read stops in the middle of an
> SGML tag, I've got problems.
Naw. Here's one way around that. Whenever you go to parse the next token,
make sure that there's more than, say, 8K in the buffer. If not, read
another 8K (unless, of course, you've reached eof).
Of course, you could also use a module to parse SGMLs. :-)
Hope this helps!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 12:37:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bruno Pagis <bruno_pagis@aur.alcatel.com>
Subject: Re: eval / variable scope problem
Message-Id: <Pine.GSO.3.96.971212123441.29438L-100000@user2.teleport.com>
On Fri, 12 Dec 1997, Bruno Pagis wrote:
> 14 eval "\$$elem=\$$index";
I think you meant to write that line like this.
eval "\$$elem = $index";
... or maybe this.
eval "\$$elem = \$index";
But you probably should re-code your algorithm to avoid this kind of eval.
Hope this helps!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 13:14:01 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ian Kallen <spidaman@well.com>
Subject: Re: failed to close pipe into sendmail
Message-Id: <Pine.GSO.3.96.971212130820.29438T-100000@user2.teleport.com>
On 12 Dec 1997, Ian Kallen wrote:
> local $SIG{PIPE} =
> sub { warn "VERY BAD THINGS: $!\n"; next };
I don't think that $! is documented to give anything special within a
signal. Also, the 'next' there is probably a bad idea, since signals may
come through at any time. Probably you should simply die on that signal.
> close(QUEUE) or die "REALLY BAD STUFF: $! == $?\n";
> Now, where I close the filehandle to sendmail it's dying; I get
> REALLY BAD STUFF: No child processes == -1
So, that means that your program (on QUEUE) has finished and been reaped
already. Did you perhaps wait for your own forked process? That could have
reaped it. Did you install a $SIG{CHLD} handler which reaped it?
Hope this helps!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 14:07:44 -0500
From: Nicolas Brossard <brossard@bch.umontreal.ca>
Subject: Re: HELP IN "SIMPLE" FOREACH PROBLEM
Message-Id: <34918B80.167EB0E7@bch.umontreal.ca>
Gil Vidals wrote:
>
> The following few lines of code has me stumped. I'm new at PERL and
> can't figure out why the foreach listed below read twice through the
> hash???? It seems as though it is reading past the eof? The errors
> generated are at the bottom of this message.
>
[snip]
>
> $y = 1;
> foreach $key (%HTML) {
> print "$key HAS A VALUE of $HTML{$key} and y is $y\n";
> $y++;
> }
>
You should write the above loop like this:
$y = 1;
foreach $key (keys %HTML) {
print "$key HAS A VALUE of $HTML{$key} and y is $y\n";
$y++;
}
Nick
------------------------------
Date: Fri, 12 Dec 1997 13:02:29 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gil Vidals <vidals@etica-entertainment.com>
Subject: Re: HELP IN "SIMPLE" FOREACH PROBLEM
Message-Id: <Pine.GSO.3.96.971212130135.29438Q-100000@user2.teleport.com>
On Fri, 12 Dec 1997, Gil Vidals wrote:
> Subject: HELP IN "SIMPLE" FOREACH PROBLEM
Please don't shout. :-)
> foreach $key (%HTML) {
You probably meant this.
foreach $key (keys %HTML) {
Hope this helps!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 13:06:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Adel BEN HAJ YEDDER <benhaj@eleves.enpc.fr>
Subject: Re: Help with special caracters
Message-Id: <Pine.GSO.3.96.971212130421.29438S-100000@user2.teleport.com>
On Fri, 12 Dec 1997, Adel BEN HAJ YEDDER wrote:
> I'am using a perl program to get informations
> from a form in web page. In the form people can enter
> special caracters (for example ~ when entering an URL
> adress). How can I do to get all the caracters
> (inculding the ~ for example) ?
Use a module like CGI.pm to read and decode the form variables. Here's an
example program you can try: Set your form to send some special characters
to it, and see what it does. It will even give you its own source, if you
wish. Hope this helps!
http://www.teleport.com/cgi-bin/custom/rootbeer/form-vars
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 19:37:47 GMT
From: David Miller <dmill@bellsouth.net>
Subject: New to Perl. How complicated?
Message-Id: <34919260.B75DA96B@bellsouth.net>
Hello All,
I am new (never before used) to Perl. I was directed to the use of this
language to accomplish a task of creating an internet email from a
Sybase database to send invoices to misc customers via their internet
email address(Sybase System 11 on AIX). I will actually be using
Sybperl to accomplish this but, I wanted to find out how difficult this
would be to accomplish for a complete beginer in Perl such as myself.
I can accomplish this task pretty simpily using our Lotus Notes and MAPI
function calls from my PowerBuilder application on the client, but my PM
would like to do it from the server side. If someone could clue me in
or tell me of any similar tasks accomplished I would greatly appreciate
it. Or just tell me I am crazy so I can tell my boss.
I saw some exaples of code and it doesn't look all that complicated but
looks can be deceiving. I code 4GLs, a bit of C(been a long time) and
proficient in SQL so I am not an idiot to code.
Please send responces to Sender and Group so that I may get any feedback
as fast as possible.
Looking for Help,
David Miller
dmill@bellsouth.net
------------------------------
Date: Fri, 12 Dec 1997 15:19:56 -0500
From: Jerry hARVILL <jharvill@epix.net>
Subject: new to perl/ window nt 4.0
Message-Id: <34919C6C.638E93A9@epix.net>
I'm trying to install perl 5.0 onto windows nt 4.0 which we use for our
internet server. Any clues on how to make is operationable? It seems
like I installed it correctly but how do I check. I've tried running a
perl script search engine and it gives me the message 501
------------------------------
Date: Fri, 12 Dec 1997 12:06:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Nobody, Really" <salvation@triple.homicide.org>
Subject: Re: Older versions of swatch
Message-Id: <Pine.GSO.3.96.971212120605.29438G-100000@user2.teleport.com>
On 12 Dec 1997, Nobody, Really wrote:
> I've only got an older version of perl
The source for the latest Perl is available on CPAN. It compiles without
problems on your system. :-)
http://www.perl.com/CPAN/
Hope this helps!
--
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/
Ask me about Perl trainings!
------------------------------
Date: 12 Dec 1997 21:31:34 GMT
From: salvation@triple.homicide.org (Nobody, Really)
Subject: Re: Older versions of swatch
Message-Id: <66safm$5e3@eve.enteract.com>
Only problem is there isn't a c compiler on there I can use.
Tom Phoenix <rootbeer@teleport.com> wrote:
> On 12 Dec 1997, Nobody, Really wrote:
> > I've only got an older version of perl
> The source for the latest Perl is available on CPAN. It compiles without
> problems on your system. :-)
> http://www.perl.com/CPAN/
> Hope this helps!
> --
> 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/
> Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 13:04:06 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: rdeleonx@hotmail.com
Subject: Re: Part of a line
Message-Id: <Pine.GSO.3.96.971212130308.29438R-100000@user2.teleport.com>
On Fri, 12 Dec 1997 rdeleonx@hotmail.com wrote:
> What I need to do is read everything between, and including, "Archivo:"
> and the next "<br>" and store it in a scalar.
Sounds like you should use a regular expression, probably along with one
of the match variables like $1. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 12 Dec 1997 19:42:23 GMT
From: derosbr@cig.mot.com (Brian DeRosa)
Subject: Re: Perl for windows 95
Message-Id: <66s42v$pgr$1@trotsky.cig.mot.com>
In article <66rqk1$eke$1@mdnews.btv.ibm.com>, dbwhite@btv.vnet.ibm.com (David B. White) writes:
> In article <348FA295.37CA0091@fuse.net>,
> Acid Bastard <acid@fuse.net> writes:
> > This is what it does the program box comes up and I type in my commands
> > but nothing happens.
>
> perl does the same thing on AIX until it sees a "Ctrl-D", which tells
> it that you've finished entering your program and that now it is time
> to get processing. I don't know if the Win95 keycode is the same, but
> it's worth a try....
>
> --
> David B. White
Actually, for Win95 (as well as DOS), I believe the terminator is "Ctrl-Z"
Hope that helps.
Brian
--
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Brian De Rosa OFFICE PHONE: +1-847-632-3803
Software Engineer (Motorola) OFFICE FAX: +1-847-435-9636
Arlington Heights, IL E-MAIL: derosbr@cig.mot.com
IL27-3205
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"We accept arguments as a drunken man leans against a lamppost...
for support, not illumination."
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
------------------------------
Date: Fri, 12 Dec 1997 14:28:55 -0600
From: Shawn Tolivar <shawn@wwgv.com>
Subject: perl multiple redirect (www)
Message-Id: <34919E87.59CCFAC1@wwgv.com>
I have a need to redirect one address with possible multiple name/value
pairs attatched, such as
ex.. http://www.www.com/search.asp?selection=Florida&map=states or
ex..
http://www.www.com/search.asp?selection=Florida&map=states&selection1=Missouri&map1=states
etc......
I have the variables already created and they work, my only problem is
that the scripts running the search is a vbscript, and I am using a perl
script to redirect variables to the vbscript. I can manually type in teh
selection and map variables and the search works. I just need a way of
setting up a simple perl redirect script that will split name/value
pairs and print out to (Location:) what ever was redirected. Thank you
Shawn
------------------------------
Date: Fri, 12 Dec 1997 13:42:29 -0600
From: Max Luther Tuinstra <tuinstra@ti.com>
Subject: perl puzzler
Message-Id: <349193A5.58A26270@ti.com>
Why does $var have the value undef rather than "tarzan" in the print statement
below? I understand that the "my" declaration in the "if (0)" condition is the
cause. It follows that for the purposes of scoping the "my $var" in the
"if-elsif" statement, all the blocks are considered to be part of the same
block, but what is the language theory behind this, since it would seem that
each condition should be a separate block?
Regards,
Max
#-----------------------------------------------------------------------------
#!/usr/local/bin/perl -w
$var = 'tarzan';
if (0)
{
my $var = 'jane'; # if my is used here, $var is undefed
}
elsif (1)
{
print "\$var = $var\n";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% Max Luther Tuinstra \|/ ____ \|/ Some of life's most exciting moments %
% Gate Array Place & Route @~/ ,. \~@ are spent near the middle of the %
% tuinstra@ti.com /_( \_ / )_\ food chain rather than on the top. %
% (972) 480-1326 \__U_/ -- anthropologist Richard Nelson %
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 12 Dec 1997 15:16:45 -0500
From: "Tarik Alkasab" <talkasab@opal.tufts.edu>
Subject: Re: perl puzzler
Message-Id: <66s677$ld1$1@news3.tufts.edu>
I ran your program, and the result you describe is not the one I got.
Rather, when I ran this program, it printed "$var = tarzan", as you would
expect.
Could you describe your installation?
--
Terry
Max Luther Tuinstra wrote in message <349193A5.58A26270@ti.com>...
>Why does $var have the value undef rather than "tarzan" in the print
statement
>below? I understand that the "my" declaration in the "if (0)" condition is
the
>cause. It follows that for the purposes of scoping the "my $var" in the
>"if-elsif" statement, all the blocks are considered to be part of the same
>block, but what is the language theory behind this, since it would seem
that
>each condition should be a separate block?
>
>Regards,
>Max
>
>#--------------------------------------------------------------------------
---
>#!/usr/local/bin/perl -w
>
>$var = 'tarzan';
>
>if (0)
> {
> my $var = 'jane'; # if my is used here, $var is undefed
> }
>elsif (1)
> {
> print "\$var = $var\n";
> }
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
>% Max Luther Tuinstra \|/ ____ \|/ Some of life's most exciting
moments %
>% Gate Array Place & Route @~/ ,. \~@ are spent near the middle of the
%
>% tuinstra@ti.com /_( \_ / )_\ food chain rather than on the top.
%
>% (972) 480-1326 \__U_/ -- anthropologist Richard
Nelson %
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
------------------------------
Date: Fri, 12 Dec 1997 14:49:37 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: pgp encrypion via perl script
Message-Id: <comdog-ya02408000R1212971449370001@news.panix.com>
In article <34917ff8.17495498@news.scescape.net>, rgay@palmetto.net wrote:
>The following code works fine via command line, however when executed
>via a user's browser will produce a server error.
># encrypt sensitive data and place it in mail message
>
>open (AFILE, "/var/www/secure/temp/data");
>print AFILE "sensitive stuff to be encrypted\n";
>close (AFILE);
i recommend not doing it this way. if you want the data to be secure,
you can't temporarily store it unencrypted on disk. it would be VERY
easy for someone to write a script to periodically collect the contents
of your temporary file. after that, you could use as large a key as you
wanted and it still wouldn't help.
and remember, if your CGI script process can write to it, mine probably
can too...
instead, consider using IPC::Open3 and writing directly to standard input
of the pgp program. `/path/to/pgp -feat` will read from standard input
rather than a file. your data doesn't have to touch disk (although we're
not considering paging, which is a different story).
perhaps i can get permission to post some of our proprietary PGP module
stuff (not that it's that great) ... or you can see the snippet i posted
earlier:
Subject: Re: perl and pgp
From: comdog@computerdog.com (brian d foy)
Date: 1997/10/29
Message-ID: <comdog-ya02408000R2910970316500001@news.panix.com>
Newsgroups: comp.lang.perl.misc
>open (PGP, "|$pgpprog -fea \"$pgpuserid\"
your snippet didn't show what was in $pgpprog. CGI scripts might
not know where to find the pgp binaries unless you give them a
full path. pgp also expects some environment variables to be
set (PGPPATH, for instance). these things are different from your
command line environment.
and, since you are passing all sorts of data to the shell, i hope that
you are using taint checking and sanitizing your data :)
>system("cat /dev/null > /var/www/secure/temp/data");
why not unlink()? you'd have to be a lot more careful about overwriting
the bits of the temporary file otherwise (simply truncating it is not
necessarily sufficient). of course, not using a file obviates this
concern.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 12 Dec 1997 12:36:09 -0800
From: Chandra Shirashyad <c4sshir@srv.pacbell.com>
Subject: Re: Pie chart with GD.pm
Message-Id: <3491A039.7BDD@srv.pacbell.com>
Thanks to everyone who replied. I got my chart. (I don't know
trignometry at all)
Chandra
------------------------------
Date: Fri, 12 Dec 1997 16:07:44 -0500
From: Bruno Pagis <bruno_pagis@aur.alcatel.com>
Subject: pod2html
Message-Id: <3491A7A0.A7438796@aur.alcatel.com>
Despite my many searches on the WEB, I didn't find
an interesting answer to those questions:
What is the latest version of pod2html ?
Where can I get it ?
Thanks. BRUNO (running perl5.003 w/ pod2html 1.15).
------------------------------
Date: Fri, 12 Dec 1997 14:43:56 -0500
From: Henry Hartley <henry@DotRose.com>
Subject: possible type at C:\Perl\lib\Win32\ODBC.pm
Message-Id: <349193FC.CA2A7217@DotRose.com>
Although my script runs, having -w on (which I do), produces the
following messages:
Name "Win32::ODBC::CacheConnection" used only once: possible type at
C:\Perl\lib\Win32/ODBC.pm line 30.
Name "ODBCPackage::Version" used only once: possible type at
C:\Perl\lib\Win32/ODBC.pm line 28.
Name "Win32::ODBC::CacheConnection" used only once: possible type at
C:\Perl\lib\Win32/ODBC.pm line 30.
Name "main::ODBC" used only once: possible type at
C:\Perl\lib\Win32/ODBC.pm line 29.
Now, I suspect there aren't really typos in ODBC.pm but I'm curious
about these warnings. I don't like to ignore messages since they are
usually there for a reason. What would cause this?
Henry
------------------------------
Date: Fri, 12 Dec 1997 14:13:27 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: possible type at C:\Perl\lib\Win32\ODBC.pm
Message-Id: <3491A8F7.1EED78F4@mystech.com>
Henry Hartley wrote:
> Although my script runs, having -w on (which I do), produces the
> following messages:
>
> Name "Win32::ODBC::CacheConnection" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 30.
> Name "ODBCPackage::Version" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 28.
> Name "Win32::ODBC::CacheConnection" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 30.
> Name "main::ODBC" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 29.
>
> Now, I suspect there aren't really typos in ODBC.pm but I'm curious
> about these warnings. I don't like to ignore messages since they are
> usually there for a reason. What would cause this?
>
> Henry
At the risk of sounding obvious, these messages mean exactly what they say!
For example, if you set a variable with
$variable = "wow";
but then never use $variable it is "used only once". Since you never use
$variable, Perl questions why you even set it. In your case, the variables
are in one of the standard packages, so don't sweat it - presumably the
package author has some reason for doing this (maybe future expansion). In
any case, it's unlikely this is an actual error so don't loose any sleep
over it!
Mark Reibert
-----------------------------
Mark S. Reibert, Ph.D.
Mystech Associates, Inc.
3233 East Brookwood Court
Phoenix, Arizona 85044
Tel: (602) 732-3752
Fax: (602) 706-5120
E-mail: reibert@mystech.com
-----------------------------
------------------------------
Date: Fri, 12 Dec 1997 16:07:53 -0500
From: Henry Hartley <henry@DotRose.com>
Subject: Re: possible typO at C:\Perl\lib\Win32\ODBC.pm
Message-Id: <3491A7A8.1EE700C4@DotRose.com>
So as I copied them down, I introduced a typo in the error messages on
the word TYPO! Sorry.
Henry
Henry Hartley wrote:
> Although my script runs, having -w on (which I do), produces the
> following messages:
>
> Name "Win32::ODBC::CacheConnection" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 30.
> Name "ODBCPackage::Version" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 28.
> Name "Win32::ODBC::CacheConnection" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 30.
> Name "main::ODBC" used only once: possible type at
> C:\Perl\lib\Win32/ODBC.pm line 29.
>
> Now, I suspect there aren't really typos in ODBC.pm but I'm curious
> about these warnings. I don't like to ignore messages since they are
> usually there for a reason. What would cause this?
>
> Henry
------------------------------
Date: 12 Dec 1997 19:26:07 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Question about the =~ operator
Message-Id: <66s34f$njp@news.orst.edu>
In article <osjndigerbcwrae.pminews@user-38lcp47.dialup.mindspring.com>,
Ben Coleman <bcoleman@mindspring.com> wrote:
>On 6 Dec 1997 01:37:45 GMT, John Stanley wrote:
>
>>Do the people who own the domain
>>za.com know you are creating addresses within their domain for them?
>
>Given that za.com appears to belong to a domain speculator, do we
>really care?
Exactly what harm has the domain owner done to you that makes you think
it's ok to do whatever you want with his domain name?
------------------------------
Date: Fri, 12 Dec 1997 14:01:28 -0600
From: djr@newcoast.com
Subject: Restricting CGI Programs to Perl.
Message-Id: <881956713.1442709506@dejanews.com>
Hello,
1. Is their an easy way to have a web server restrict CGI programs to
Perl in an UNIX environment (Solaris 2.6 running SWS 1.0)? 2. Is
there a way to restrict Perl to what it can spawn, such as only
sendmail, etc? Any information on how to accomplish this is
greatly appreciated.
Thanks
- Dan
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 12 Dec 1997 12:14:06 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: schwern@rt1.net
Subject: Re: Shoving an array into a glob? or fixing IO::ScalarArray
Message-Id: <Pine.GSO.3.96.971212120839.29438H-100000@user2.teleport.com>
On Thu, 11 Dec 1997 schwern@rt1.net wrote:
> I recently found it necessary to use the data on an array as a filehandle
I don't understand this need. How can the data on (in?) an array be in any
way "necessary" to be used as a filehandle? Maybe you mean that you need a
filehandle for each of several arrays, or you need an array of
filehandles. Could that be right?
> (a module routine only accepted IO::Handle type filehandles and I had
> data which I had piped and processed into an array that I wanted to pass
> into it.)
Are you saying that you had data which you wanted to print on a
filehandle?
> Again, I need something where you can do, more or less, this:
>
> $ah = IO::Array->new(\@array);
> $ah->print; # Prints the first element of @array.
To print the first element of @array, use $array[0] (or shift) as an
argument to print.
> $foo = <$ah>; # Places the second element of @array onto $foo.
To access the second element of @array, use $array[1] (or shift again).
> binmode $ah; # Effectively does nothing, but produces no error.
I'm not sure what you want there.
Good luck!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 14:56:22 -0600
From: "Craig A. Keefner" <keefner@kinetic.com>
Subject: Suidperl
Message-Id: <3491A4F6.6F8377C8@kinetic.com>
I am investigating using some code to do
an online credit auth and it is normally configured
to run as a certain userid (and that userid only).
The code I'm using has a perl interface.
I think suidperl could be used to execute the
program but I haven't found any doc on using
suidperl.
Also, is there a better/best way of doing this sort
of thing?
I am running perl 5.003 for Solaris with the suidperl
security patch.
Any help appreciated
Craig
------------------------------
Date: 12 Dec 1997 16:11:56 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: SybPerl vs. OraPerl
Message-Id: <66s9as$co$1@tholian.cse.psu.edu>
In article <34903577.B9DB98ED@mail.txt.net>,
Kenneth Chesak <ken.chesak@mail.txt.net> wrote:
>I going to be converting an application from HP Unix, SybPerl and Sybase
>11 to NT 4.0 Server running Oracle 7.3. Does OraPerl for NT exist? If
>so where can I get a copy?
You'll need to upgrade to Perl5 and the DBI/DBD::Oracle modules. DBD::Oracle
includes an Oraperl.pm module which emulates oraperl, the Perl4 extension.
John
groenvel@cse.psu.edu
------------------------------
Date: Fri, 12 Dec 1997 12:22:00 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dean Burnham <deanb@cons.prg.home.net>
Subject: Re: uninitialized value messages when using -w directive and namespace
Message-Id: <Pine.GSO.3.96.971212121818.29438I-100000@user2.teleport.com>
On 12 Dec 1997, Dean Burnham wrote:
> I am getting this error when I run the code below.
>
> Use of uninitialized value at /home/deanb/ns-home/cgi/test line 28 (#1)
> (W) An undefined value was used as if it were already defined. It was
> interpreted as a "" or a 0, but maybe it was a mistake. To suppress this
> warning assign an initial value to your variables.
That seems clear enough...
[code snipped]
> I would like to continue using the -w directive, but it will not
> allow importing the "Q" namespace and referencing the variables in
> this new namespace.
That's not true. (Maybe you should re-read the diagnostic message. :-)
> Are there any compiler tricks which can be
> done to avoid getting the:
> "Use of uninitialized value at line 26, <> chunk 1".
> or
> "Use of uninitialized value at line 28, <> chunk 1".
Do you mean, besides the one mentioned in the diagnostic message quoted
above? :-)
> Bottom line -- importing the namespace "Q" gives me a bunch of
> problems.
You could also use the alternate methods of getting data without importing
the namespace "Q". Those are described in the docs of CGI.pm.
Good luck!
--
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/
Ask me about Perl trainings!
------------------------------
Date: Fri, 12 Dec 1997 11:31:58 -0800 (PST)
From: Mix <mixmaster@remail.obscura.com>
Subject: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <199712121931.LAA25389@sirius.infonex.com>
Please accept my apologies for the anonymous way of posting. I will
graduate from a college very soon with a Computer Science degree under
my belt and I need a career advice from seasoned professionals.
Unfortunately, my college taught languages that were "scientifically"
correct but useless practically. FORTRAN is dead and has started to stink
because of its poor and incomprehensible grammar, and its emphasis on
poor programming style. It was good for the punch card epoch but not
for the client-server world.
Eiffel is a good language for people who are just starting to learn
programming, but is not a good choice for non-novices. ADA has always
been the DOD's pet language which has never been accepted outside the
military-industrial complex. Smalltalk hardly deserves a mention.
As a sad result of all that, the jobs for these languages are almost
nonexistent and the salaries are not that great. I will have to accept
that I need to forget them in order to make decent money.
That leaves me with the only alternative -- C++ or Java. Both languages
have been hugely successful DESPITE their design flaws. I am ready to
accept the necessity to use these languages if that's where the job market
is headed. Both languages have excellent implementations for both Windows
and Unix platforms.
The question is, which language will pay top 17457 in the long run? Java is
still in its infancy but seems to have a great potential. C++ is a mature
albeit cumbersome language and is probably poised to become a legacy
language later. The jobs will be there in the long run, although the
market will likely never be as good as now. What do you think about it?
------------------------------
Date: Fri, 12 Dec 1997 19:56:14 GMT
From: mcv@wxs.nl (Miguel Carrasquer Vidal)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <349793cb.33600861@news.wxs.nl>
On Fri, 12 Dec 1997 11:31:58 -0800 (PST), Mix
<mixmaster@remail.obscura.com> wrote:
>Unfortunately, my college taught languages that were "scientifically"
>correct but useless practically.
Which is, I suppose, why this is cross-posted to comp.edu...
>FORTRAN is dead and has started to stink
>because of its poor and incomprehensible grammar, and its emphasis on
>poor programming style. It was good for the punch card epoch but not
>for the client-server world.
...and comp.lang.fortran...
>Eiffel is a good language for people who are just starting to learn
>programming, but is not a good choice for non-novices.
...and comp.lang.eiffel...
>ADA has always been the DOD's pet language which has never been accepted
>outside the military-industrial complex.
...and comp.lang.ada...
>Smalltalk hardly deserves a mention.
...but comp.lang.smalltalk deserves a crosspost...
>As a sad result of all that, the jobs for these languages are almost
>nonexistent and the salaries are not that great. I will have to accept
>that I need to forget them in order to make decent money.
>
>That leaves me with the only alternative -- C++ or Java. Both languages
>have been hugely successful DESPITE their design flaws.
...comp.lang.c++, comp.lang.java.programmer...
You forgot to antagonize the folks at comp.lang.c, comp.lang.perl.misc
[unless you meant to imply that C and perl deserve even less of a
mention than Smalltalk.. How profound!], misc.jobs.misc, and, last
but not least, nyc.food.
Don't come back until you've thought of something real nasty to say
about NYC food.
Regards,
==
Miguel Carrasquer Vidal ~ ~
Amsterdam _____________ ~ ~
mcv@wxs.nl |_____________|||
========================== Ce .sig n'est pas une .cig
------------------------------
Date: 12 Dec 1997 20:58:23 GMT
From: kenton@rahul.net- (Ken Lee)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <66s8hf$739$2@murrow.corp.sgi.com>
In article <199712121931.LAA25389@sirius.infonex.com>, Mix
<mixmaster@remail.obscura.com> writes:
|> The question is, which language will pay top 17457 in the long run? Java is
|> still in its infancy but seems to have a great potential. C++ is a mature
|> albeit cumbersome language and is probably poised to become a legacy
|> language later. The jobs will be there in the long run, although the
|> market will likely never be as good as now. What do you think about it?
Unless you're a compiler expert, knowledge of programming languages
is not going to get your top dollar. Most employers want people
who know how to use programming languages to solve real problems.
For example, someone who knows how to use C++ to write TCP/IP interfaces
(or GUIs or databases or whatever) is probably going to get better offers
than someone who just knows C++.
--
Ken Lee, kenton@rahul.net, http://www.rahul.net/kenton/
------------------------------
Date: 12 Dec 1997 21:16:34 GMT
From: tholen@ifa.hawaii.edu
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <66s9ji$d4p@news.Hawaii.Edu>
Mix writes:
> Please accept my apologies for the anonymous way of posting.
I can understand why, considering the flame war you are apparently
trying to start.
> FORTRAN is dead
Hardly. Fortran 90 was a major update to the language, and Fortran 95
is a minor update. Compilers abound. Activity in this newsgroup
remains healthy.
> and has started to stink
Hardly.
> because of its poor and incomprehensible grammar,
Perhaps incomprehensible to you.
[text moved from previous post]
> I will graduate from a college very soon with a Computer Science
> degree under my belt
How did you manage that, if something as easy as Fortran was
incomprehensible to you?
------------------------------
Date: Fri, 12 Dec 1997 16:34:57 -0500
From: "John W. Sublett" <john@tridium.com>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <66satf$afr@sjx-ixn8.ix.netcom.com>
I think you should get yourself a shiny new spatula and call
McDonalds, they probably pay more than Burger King.
Mix wrote in message <199712121931.LAA25389@sirius.infonex.com>...
>Please accept my apologies for the anonymous way of posting. I will
>graduate from a college very soon with a Computer Science degree under
>my belt and I need a career advice from seasoned professionals.
>The jobs will be there in the long run, although the
>market will likely never be as good as now. What do you think about it?
>
>
------------------------------
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 1463
**************************************