[12346] in Perl-Users-Digest
Perl-Users Digest, Issue: 5946 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 10 12:07:22 1999
Date: Thu, 10 Jun 99 09:00:24 -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 Thu, 10 Jun 1999 Volume: 8 Number: 5946
Today's topics:
Re: "System" function delays output (Mark-Jason Dominus)
Acess databse access from unix with perl? (BXTC)
Backticks waits for all processes to complete mclaren_aml@my-deja.com
Re: CGI script from win32 -> IE4.0 <eyounes@aol.com>
Re: CGI script from win32 -> IE4.0 <"tapplega--just remove this--"@utk.edu>
DBI & ODBC <rdasilv@home.com>
Re: Definition of words in Perl and POSIX (Tad McClellan)
Re: Difference of two variables (Larry Rosler)
Re: Difference of two variables (Larry Rosler)
Re: Easy /bin/sh but Perl not <aqumsieh@matrox.com>
Examples, sources and tutorials (Thomas Weholt)
Re: filehandles in Win95 <"tapplega--just remove this--"@utk.edu>
Re: fork for DNS lookup - help <gellyfish@gellyfish.com>
Re: Got it! <aqumsieh@matrox.com>
Re: how to connect oracle 8 thru perl on NT (John D Groenveld)
Re: indexing into a hash <jim@sismicro.com>
Re: indexing into a hash (Mark-Jason Dominus)
Re: indexing into a hash (Mark-Jason Dominus)
Integer conversion problem <wasquith@usgs.gov>
Re: Intersection of SEVERAL ( eg. 5 -> ) lists (Thomas Weholt)
Is there a module like URI::Escape for HTML text? (Mitchell Morris)
Re: Is there a module like URI::Escape for HTML text? <garethr@cre.canon.co.uk>
Net::SSLeay post requests and authenticating proxy <ed@pcr8.pcr.com>
Re: perlcc compiling problems (Ideare)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Jun 1999 15:27:32 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: "System" function delays output
Message-Id: <7jolgr$k17$1@monet.op.net>
In article <375F2DFD.E3772DB0@shurflo.com>,
Thomas/Shurflo <thomas@shurflo.com> wrote:
>I'm using the system function to collect data from files. I'd like to
>display dynamic data after each file is processed, but for some reason
>the "system" function delays STDOUT until the script is completed.
>Anyone have any ideas why?
The system function doesn't do that; it's a feature of the program
that you are running. it looks to see if it is writing to a terminal
or to a file; if it's writing to a file, it saves up its output and
writes it all at once for efficiency.
If that program is something that you wrote, see
http://www.plover.com/~mjd/perl/FAQs/Buffering.html
for suggestions; it discusses exactly this problem. If the program
you are running with `system' is not one that you can change, you are
out of luck.
------------------------------
Date: Thu, 10 Jun 1999 15:49:03 GMT
From: "(BXTC)" <bxtc@forfree.at>
Subject: Acess databse access from unix with perl?
Message-Id: <3760E8BA.B8F11B7A@forfree.at>
OK, here is my situation...I am fairly new with Perl AND databases...And
on top of that I have to deal with 2 platforms! My boss wants to make a
database of products, and also of clients, and he wants these made in
Access(windows). But that part isn't really my job, what he wants me to
do is incorporate the database(really just the products database) into
our website, which is run on a unix box. I looked at CPAN and found
modules for sybase and mysql, but nothing for Access. Is there any EASY
way I can use the Access DB in unix and for a web site? It alright if
the answer isn't perl(although I hope/think it is). It will be a fairly
easy table to mess with (Product ID, descriptions, names, prices, and
thats about it), and I just need a way to run searches etc. to pull up
what the users want. I would appriciate ANY comments and or help!
--
No great Genius has ever existed without some touch of madness.
Aristotle
(BXTC) ICQ# 23289202
------------------------------
Date: Thu, 10 Jun 1999 13:50:52 GMT
From: mclaren_aml@my-deja.com
Subject: Backticks waits for all processes to complete
Message-Id: <7jofro$icj$1@nnrp1.deja.com>
As part of the integration between two 3rd party applications, we need
to intercept triggers generated by one application, process these, and
apply appropriate updates to the second. These triggers are generated
as standalone scripts, so there is no means of maintaining context such
as a connection channel for the second application.
Because reestablishing the connection to the second application is so
expensive, we have a small Perl based client/server application between
these. When the client is executed, it determines if there is already a
server running, and if not, forks a copy of itself to become the
server. The server then establishes the connection to the second
application, and waits for the client to tell it what to do.
The client requests operations from the server, and when it is
complete, disconnects and exits. The server meanwhile stays active to
service any future client requests. Typically we have a timeout on
this, so after some period of inactivity it quietly expires. We support
clients both via a callable interface, and a standalone application.
This works 100% in most cases. Where it has problems is if the
standalone application is invoked via backticks in Perl, AND the client
needs to start the server.
eg. $output = `<client> <client command>`;
In this case, the command will not complete until the server expires
(in our case this is typically 15 minutes). If the same thing is
executed via a system command, it works fine in any event (except that
the user cannot now collect the output). It also works fine if the
backticks are used, and the server is already running.
It appears that when backticks are used, Perl is keeping track of every
process triggered as a result of this command, and waiting until all
complete before returning. I assume this is to ensure it can collect
all the output. How can we prevent this - is it enough for the server
to exec itself to break the parent connection?
Thanks for any help or clarification.
Andrew
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 10 Jun 1999 17:20:42 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: CGI script from win32 -> IE4.0
Message-Id: <7jol5v$oa1@news.vtcom.fr>
>Notes:
>1) the script:
>print "Content-type: text/html/n/n";
^^^^^ try \n\n, it may
works
Eric
------------------------------
Date: Thu, 10 Jun 1999 11:34:31 -0400
From: Toby <"tapplega--just remove this--"@utk.edu>
Subject: Re: CGI script from win32 -> IE4.0
Message-Id: <375FDB07.4C741D10@utk.edu>
>1) the script:
>print "Content-type: text/html/n/n";
>print "hello web surfer!";
that's fine.
>2) I can run this script from the [dos] command line ok
Good you should always do that.
>3) The errors I get in IE4.0 depend on the settings in PWS (personal web
>server). My errors have included: "HTTP/1.1 500 Server Error", "404...",
>and "no read access". These different messages occur when I have various
>settings in PWS for read/execute/script access for either the wwwroot, or
>for cgi-bin directories. When I open up all of the permissions, is when I
>get the problem I've described at the top of the e-mail (runs, but doesn't
>return data to web browser).
You need to associate your file extension in the registry. I did this and it
seemd to work: added under HKEY_CLASSES_ROOT -> '.pl'
Then added a key that with a name of 'Perl' and a string like so:
c:\perl\bin\perl.exe %s %s
ActiveState's build should perform similar magic for you on install.
>4) I tried adding the #!..., but it appears to behave in the same manner if
>I have that line or I don't (I'm assuming my path is set already).
the shebang doesn't (normally) mean a thing on Win
>5) Is there a setting in IE4.0 that would affect this?
no
>6) Do I need another file association in the registry?
see above.
>7) Note, I've just gotten started with this and have just loaded perl
5.17.(sic)
then the association already exists assuming you are talking about ActiveState
Toby
duh wrote:
> Hello, I'm stuck on getting started with perl. My basic problem is that
> when I try to open a perl script from IE4.0, IE4.0 gives me a dialog box
> asking me to either save the file, or to open it locally. When I open it
> locally, it runs the perl script, but doesn't output the results to the
> browser. How do I get the CGI script to output the data to a browser.
>
> Notes:
> 1) the script:
> print "Content-type: text/html/n/n";
> print "hello web surfer!";
> 2) I can run this script from the [dos] command line ok
> 3) The errors I get in IE4.0 depend on the settings in PWS (personal web
> server). My errors have included: "HTTP/1.1 500 Server Error", "404...",
> and "no read access". These different messages occur when I have various
> settings in PWS for read/execute/script access for either the wwwroot, or
> for cgi-bin directories. When I open up all of the permissions, is when I
> get the problem I've described at the top of the e-mail (runs, but doesn't
> return data to web browser).
> 4) I tried adding the #!..., but it appears to behave in the same manner if
> I have that line or I don't (I'm assuming my path is set already).
> 5) Is there a setting in IE4.0 that would affect this?
> 6) Do I need another file association in the registry?
> 7) Note, I've just gotten started with this and have just loaded perl 5.17.
------------------------------
Date: Thu, 10 Jun 1999 15:49:50 GMT
From: "Rick Dasilva" <rdasilv@home.com>
Subject: DBI & ODBC
Message-Id: <y8R73.12756$WL.169006@news2.rdc1.on.home.com>
Hello,
I have written a simple perl script to access a .dbf file through ODBC. The
script works perfectly on my local machine but when I try it on a NT 3.51
server running website 1.0, I get the following message:
Cannot connect to server: [Microsoft][ODBC dBase Driver] Could not find
installable ISAM. (SQL-S1000)(DBD: db_login/SQLConnect err=-1)
This leads me to believe that the dbi can not connect to the database. The
database does exists and it was defined under the System DSN of the ODBC
Manager. What I am wondering is wherther or not there is something funny
with the ODBC manager or microsoft .dbf (version 4.0) driver under NT.
Any help would be greatly appreciated.
Thanks,
Rick.
------------------------------
Date: Thu, 10 Jun 1999 05:56:27 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Definition of words in Perl and POSIX
Message-Id: <b42oj7.b95.ln@magna.metronet.com>
Mark Goodaire (6jmg@post.queensu.ca) wrote:
: The script that I'm writing requires me to match against patterns that are
: ALMOST the same as the default word in PERL, \w, equivalent to the character
: set [A-Za-z0-9_]. What I need is a slightly modified definition of \w, so
: that \w will match characters in the set [A-Za-z0-9_-] for instance. Does
: anyone know how I can do this?
[\w-] ==> [A-Za-z0-9_-]
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 10 Jun 1999 08:30:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Difference of two variables
Message-Id: <MPG.11c979e3d6b69799989bab@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7jo9i0$g10$1@nnrp1.deja.com> on Thu, 10 Jun 1999 12:03:16
GMT, ladlad@my-deja.com <ladlad@my-deja.com> says...
> I have a variable
> $all="cherry, apple, plum, pear";
>
> and this variable
> $takeout="pear,cherry";
>
> and I would like to get the difference of these two strings
> that is
>
> $remain="apple, plum";
This *seems* like a FAQ. `perldoc -q difference` would have led you to
perlfaq4: "How do I compute the difference of two arrays? How do I
compute the intersection of two arrays?"
But that would have given you a different answer from the one you
wanted, because the 'difference' in the FAQ is the 'symmetric
difference' -- elements in one or the other set but not both. What you
are asking for is the 'set difference' -- elements in one set but not in
the other. [Tom and Gnat: Didn't this problem surface the last time
this FAQ was posted here?]
But the first sentence in the FAQ would be useful anyway: "Use a hash."
#!/usr/local/bin/perl -w
use strict;
my $all = "cherry, apple, plum, pear";
my $takeout = "pear,cherry";
my %takeout;
@takeout{split /,\s*/ => $takeout} = ();
my $remain = join ', ' => grep !exists $takeout{$_} =>
split /,\s*/ => $all;
print "$remain\n";
__END__
Output:
apple, plum
This preserves the order of the elements in the original string
(including duplicates), which the code in the FAQ doesn't.
[Tom and Gnat: Would order-preserving set difference be a useful
addition to the FAQ? I don't have my Cookbook at hand to see if it's in
there. "4.8. Computing Union, Intersection, or Difference of Unique
Lists" might have it.]
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 10 Jun 1999 08:44:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Difference of two variables
Message-Id: <MPG.11c97d294d782e2e989bac@nntp.hpl.hp.com>
In article <tatnj7.ep4.ln@magna.metronet.com> on Thu, 10 Jun 1999
04:34:37 -0400, Tad McClellan <tadmc@metronet.com> says...
...
> my $all='cherry, apple, plum, pear';
>
> my $takeout='pear,cherry';
> $takeout =~ tr/,/|/; # convert to a regex
>
> my $remain = join ', ', grep ! /\b$takeout\b/, split /, /, $all;
O(M * N), while the hash solution I posted would be O(M + N). Not that
it matters at all with so few items. But how about a few hundred or
more?
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 10 Jun 1999 09:49:55 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Easy /bin/sh but Perl not
Message-Id: <x3yemjkqi65.fsf@tigre.matrox.com>
"MDM" <michaeldmooreNOSPAM@hotmail.com> writes:
> Ok Im quite new to Perl and I am trying to convert this simple UNIX script
> for use in Win32. Now the input for 'string' is quite easy in Perl but I do
> not have a clue on how to do in Perl what 'grep' does in UNIX. To walk the
> directory tree one level under /JOBS and when the file 'description' is
> found grep for $string ?
You are making a big step toward your freedom. The next logical thing
for you to do is to have a look at the Perl Power Tools (tm). Check
them out at:
language.perl.com/ppt/
and enjoy your newly found freedom.
Ala
------------------------------
Date: Wed, 09 Jun 1999 22:38:48 GMT
From: u970130@studbo.hit.no (Thomas Weholt)
Subject: Examples, sources and tutorials
Message-Id: <375eecb3.9842252@news1.c2i.net>
Hi,
Is there a site on the net with lots of simple scripts, examples of
whole programs etc.?
------------------------------
Date: Thu, 10 Jun 1999 11:02:10 -0400
From: Toby <"tapplega--just remove this--"@utk.edu>
Subject: Re: filehandles in Win95
Message-Id: <375FD371.8839D147@utk.edu>
You could use the File::Slurp module under Win32. Get it via PPM if you
are using the ActiveState crap. It dumbs down the process considerably and
it is, IMHO, cheating. I agree with everyone else: read the docs. They are
not (nearly?) as smartass.
T.
Steven & Christine Borgfeld wrote:
> I'm learning perl to run CGI scripts on a unix server, but I'm running
> practice programs on Win95. I'm reading "Learning Perl" which is unix
> based. I'm having trouble writing to an output file (under Win95).
> This is the code:
>
> open (OUT,"output") || die;
> print OUT "table #",$i,"\n";
>
> I'm getting the message:
> Filehandle main::OUT opened only for input at circle.bat line 39.
>
> Any suggestions or links in the right direction are appreciated.
>
> Thanks
> Christine
------------------------------
Date: 10 Jun 1999 15:59:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: fork for DNS lookup - help
Message-Id: <375fd2df@newsread3.dircon.co.uk>
kayec <delete.the.nospam.kayec@gov.ns.ca> wrote:
> Question for you.....
>
> When your script does the lookups it sometimes returns 3-4....10 different
> names for one IP. Now i realize this isn't a problem as it does actually
> happen, but is their an easy way to modify the script to only give me one.
> I don't care about the rest.
>
But which one ?
> Otherwise i could write another script to go though and delete duplicates
> but that would be slow and defeat the benefit of your fast (and very
> through) DNS lookup.
>
>
You can change the line that says :
$rr->print;
To:
$rr->print unless $rr->type eq "CNAME";
(or something like that :)
/J\
--
"How much fun can a girl have with a rabbit?" - Channel 4 Continuity
Announcer
------------------------------
Date: Thu, 10 Jun 1999 10:33:00 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Got it!
Message-Id: <x3ybteoqg6c.fsf@tigre.matrox.com>
"Terry Mealy" <spike1965@worldnet.att.net> writes:
> The actual problem was with the third conditional -
> if($city_data{$contract.$cities[$#flight]} ...
>
> It had an undef that I finally found after break apart the nesting. I
> wonder why I was getting the warning at the first conditional, though? Does
The reason, I believe without looking at the source code, is that the
the if() statement and its whole body are considered as one
statement. If Perl finds an error/warning in any place in a statement,
it will report the line where the statement begins. In your case, this
line is the line containing the fist conditional.
> perl evaluate all of the conditions in nested conditional, whether they are
> true or false?
I am not sure what you mean here, but I guess the answer is NO :)
Consider the following:
sub true {
print "TRUE\n";
return 1;
}
sub false {
print "FALSE\n";
return 0;
}
if (true() && false()) {
print "1\n";
}
if (true() || false()) {
print "2\n";
}
This outputs:
TRUE
FALSE
TRUE
2
In the first if() conditional, after evaluating true(), it was
necessary to evaluate false() since its value will affect the
conditional (due to the &&). In the second if() statement, it was not
necessary to evaluate the false(), since its value is useless (due to
the ||).
Does this answer your question?
Of course, in the case of nested conditionals (which might be what you
are actually asking for), Perl will not evaluate the body of any if()
statement whose conditional tests false. Obvious, I think.
HTH,
Ala
------------------------------
Date: 10 Jun 1999 11:54:17 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: how to connect oracle 8 thru perl on NT
Message-Id: <7jon39$f7i$1@grolsch.cse.psu.edu>
In article <7jnhbh$8ie$1@nnrp1.deja.com>,
CHETAN <chetan_gautam@hotmail.com> wrote:
>use DBI;
>
>$drh = DBI->install_driver('Oracle');
>if( !defined $drh ){
> die "cannot load driver:$!\n" ;
>}
>
>$dbh = $drh->connect( '', 'scott', 'tiger');
>die unless $dbh;
>
use DBI;
my $dbh = DBI->connect('dbi:Oracle:MySQLNetAliasDefinedInTNSNAMESORA',
'scott', 'tiger') or die $DBI::errstr;
John
groenveld@acm.org
------------------------------
Date: Thu, 10 Jun 1999 09:04:32 -0600
From: Jim Keefer <jim@sismicro.com>
Subject: Re: indexing into a hash
Message-Id: <375FD3FF.47CC8BC2@sismicro.com>
I can make a reference to a hash element, but can I get the element's hash
_key_ back from this reference, or only the value?
Jim
--
_________________________________________________________________________
Jim Keefer SIS Microelectronics, Inc., An ASPEC Technology Co. |
jim@sismicro.com 1831 Lefthand Circle Suite E Longmont, CO 80501 |
303.776.1667x272 http://www.sismicro.com FAX: 303.776.5947 |
------------------------------
Date: Thu, 10 Jun 1999 15:40:01 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: indexing into a hash
Message-Id: <7jom59$k5u$1@monet.op.net>
In article <375EDA53.2FD8C1C7@sismicro.com>,
Jim Keefer <jim@sismicro.com> wrote:
>Since perl implements a hash as two parallel arrays,
It does not.
> is there a way I can index into a hash?
1. Look in the perlref manual page for `pseudo-hash'.
2. Try the Tie::IxHash module.
------------------------------
Date: Thu, 10 Jun 1999 15:49:28 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: indexing into a hash
Message-Id: <7jomnh$k9t$1@monet.op.net>
In article <375FD3FF.47CC8BC2@sismicro.com>,
Jim Keefer <jim@sismicro.com> wrote:
>I can make a reference to a hash element, but can I get the element's hash
>_key_ back from this reference, or only the value?
You can't get the key back. Hash entries are not directly addressible
in Perl.
This isn't C, where you have an array of integers and the interest are
actually stored contiguously in memory. Perl scalar values are big
fat structures of varying sizes, called SVs. When you put them in an
array, they are not stored contiguously; instead, *pointers* to the
SVs are stored contiguously. When you get a reference to an `array
element', you get a reference to the SV, and there's no way for Perl
to follow the pointer backwards to the array; conceivably the same SV
might be present in many arrays. Similarly, hashes.
------------------------------
Date: Thu, 10 Jun 1999 15:32:20 GMT
From: "William H. Asquith" <wasquith@usgs.gov>
Subject: Integer conversion problem
Message-Id: <375FDA84.44D01C7F@usgs.gov>
Please someone help with the following C<int()> problem! I absolutely
know that there is a stupid reason for int(-1) in the first case
returning 0 and int(-1) in the second returning -1 but I am totally
stumped.
#!/usr/bin/perl5 -w
my ($min, $max) = (0.1, 78.4);
print "Min and Max are $min and $max\n";
my ($logmin, $logmax) = (log10($min), log10($max));
print "Log10 values are $logmin and $logmax\n";
my ($intmin, $intmax) = ( int($logmin), int($logmax) );
print "Log10 cycles are $intmin to $intmax\n";
print " but smaller cycle should be ".int(-1)." and not 0\n";
sub log10 { return undef if($_[0] <= 0);
log($_[0])/log(10); };
Min and Max are 0.1 and 78.4
Log10 values are -1 and 1.89431606268444
Log10 cycles are 0 to 1
but smaller cycle should be -1 and not 0
Using 5.005_02 on Irix 6.4
------------------------------
Date: Wed, 09 Jun 1999 22:27:39 GMT
From: u970130@studbo.hit.no (Thomas Weholt)
Subject: Re: Intersection of SEVERAL ( eg. 5 -> ) lists
Message-Id: <375ee8c9.8840542@news1.c2i.net>
Hi,
I am not making this into a flame-war or something, BUT I did say I
wanted to create an intersection list from several others, not two,
but three or more. The FAQ, the Perl cookbook etc. show how to create
an intersection using two lists. I got at least 3, most often 10-11
lists of items. The code doesn`t have to be "dynamic", for example the
code can just be
@1 = (1,43,543,75,);
.
.
.
@10 = (432,43,53,632);
etc.
# code to make the intersection of the lists
if (defined(@1))
{
# compute a intersection list
}
# do same with all the lists, @2, @3 etc.
if (defined(@10))
{
# compute a intersection list based on the list created before
}
@intersection = # the intersection of the lists above.
My problem is that I don`t know how to build this so that the number
of lists can vary.
Is this clearer?
Thanks for your help.
On 10 Jun 1999 07:30:48 -0700, merlyn@stonehenge.com (Randal L.
Schwartz) wrote:
>>>>>> "Thomas" == Thomas Weholt <u970130@studbo.hit.no> writes:
>
>Thomas> Perhaps I didn`t make it clear that I need to compute the intersection
>Thomas> of more than 4-5 lists, often 10-12. And this varies.
>
>Perhaps you didn't make it clear why the solutions from the FAQ won't
>work for you then.
>
>Thomas> It is part of a "complex" search-engine.
>
>At some point, you should punt and use a real database then.
>
>Thomas> Thanks for trying though.
>
>Well, it wouldn't be "trying" if we could get enough info to actually
>help you. :)
>
>print "Just another Perl hacker,"
>
>--
>Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
>Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
>Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
>Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
>Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 10 Jun 1999 15:32:26 GMT
From: mgm@unpkhswm04.bscc.bls.com (Mitchell Morris)
Subject: Is there a module like URI::Escape for HTML text?
Message-Id: <slrn7lvmkb.3fq.mgm@unpkhswm04.bscc.bls.com>
I have a need to generate a web page from arbitrary user input. I wandered
through CGI and URI::Escape looking for a way to safely cook the text
fragments into something that will appear correctly in the user's browser. I
failed to find anything, or to recognize it if I did find it. For example, if
the arbitrary text included an ampersand, I would like the output to replace
it with '&', and so forth. I could iteratively define a list of these
transformations, but if someone else has already packaged it up, I'd rather
use that instead.
Before I start trying to hack up my own search-n-replace bit, is there
already one of these written?
+Mitchell
--
Mitchell Morris
It had to be a linguistics professor who said that it's man's ability to use
language that makes him the dominant species on the planet. That may be. But
I think there's one other thing that separates us from animals. We aren't
afraid of vacuum cleaners.
-- Jeff Stilson
------------------------------
Date: Thu, 10 Jun 1999 15:53:57 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
To: mitchell_morris@bscc.bls.com
Subject: Re: Is there a module like URI::Escape for HTML text?
Message-Id: <sihfog2gru.fsf@cre.canon.co.uk>
Mitchell Morris <mgm@unpkhswm04.bscc.bls.com> wrote:
> I have a need to generate a web page from arbitrary user input. I
> wandered through CGI and URI::Escape looking for a way to safely cook
> the text fragments into something that will appear correctly in the
> user's browser.
If you need only to translate characters like & into entity references,
use HTML::Entities (distributed with LWP).
For other markup, try HTML::FromText.
--
Gareth Rees
------------------------------
Date: Thu, 10 Jun 1999 11:14:22 -0400
From: Ed Eddington <ed@pcr8.pcr.com>
Subject: Net::SSLeay post requests and authenticating proxy
Message-Id: <375FD64E.422721FA@pcr8.pcr.com>
I need to relay browser requests from an intranet proxy server over the
internet using SSL. I was thinking of using Net::SSLeay and
Openssl-0.9.1c to make the HTTPS request and send stdout back to the end
user.
The requests may be POST requests. Does Net::SSLeay handle the post
method? Can it send basic authentication user/pass with the request?
Can anyone give me suggestions at accomplishing this goal (or the main
goal of authenticating the proxy requests transparent to the end user.
See below for the LONGER post describing the situation.) Thanks!
Ed Eddington
(Please reply directly if possible!)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Ed Eddington wrote:
>
> HTTP requests are coming into a proxy machine on an intranet. These
> requests need to be redirected over the internet to another server
> using SSL. The requests also have to be authenticated by the internet
> server using a username/password unique to the proxy server (NOT
> entered by end users). So, the original requests need to have the
> username and password added at the proxy server and then made over
> SSL.
>
> I was thinking of writing a Perl CGI script to use Net::SSLeay that
> would be executed by the first request and make the HTTPS request
> to the internet server, using basic authentication, and pass the
> response back on stdout. Would this be practical?
>
> I would also be interested in other ideas of redirecting the requests
> and authenticating the proxy server. The basic requirement is
> authenticating the proxy server and using SSL - and being transparent to
> end users.
>
> The proxy server is Microsoft IIS on NT. The internet server is
> Stronghold (Apache).
>
> Is there an Active-X control to do this easily? What about any built-in
> functionality on IIS? Could Apache do this easier?
>
> Would there a similar way to use digital certificates to authenticate
> a proxy server when transparently redirecting the request?
>
> Any thoughts are appreciated.
>
> Ed
------------------------------
Date: Thu, 10 Jun 1999 17:20:56 +0200
From: "Antonio Gulli (Ideare)" <gulli@ideare.com>
To: vishalb@my-deja.com
Subject: Re: perlcc compiling problems
Message-Id: <375FD7D8.88E53BEE@ideare.com>
Hello, thank you so much for your quickly reply. I can
avoid using SearchServer. I can use DBD::Fulcrum
and DBI, instead. Hoping that they are XSUB-perlcc
complaint. But i need to use Socket ... what about ?
vishalb@my-deja.com wrote:
> In article <375D22C5.4C985DF7@ideare.com>,
> Antonio Gulli <gulli@ideare.com> wrote:
> > Hello, i-m not a perlcc guru so hope someone could help me
> > to understand the meaning of these error messages ... And to
> > compile.
> >
> > Thank you !
> >
> > [gulli@egadi]..uname -a
> > SunOS egadi 5.6 Generic_105181-05 sun4m sparc SUNW,SPARCstation-20
> >
> > gcc -v
> > Reading specs from
> > /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.8.0/specs
> > gcc version 2.8.0
> >
> > Before .c code generation
> > 1) What substconf stands for .. ? where can i find references to the
> > meaning?
>
> Donot worry about it, just some diagnostic info being dumped out.
>
> > 2) SearchServer is a module which uses XSUB .. Socket ? What is the
> > problem ?
> >
> perlcc doesnot handle XSUB's that require runtime intialiazation
> very well ( unless the module cooperates which most modules donot).
> How to handle it is still being debated.
> So your script is unlikely to be compilable even with the latest
> versions of perlcc ( though this might change in the near future)
> If you are willing to change the Xsub modules to be compiler
> friendly, I might be able to help you do it.
>
> Regarding gcc internal error. You might get away by disabling
> -O in ccoptimise in Config.pm. gcc finds it difficult enough
> to digest perl compiler code, asking for optimization is asking
> too much.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5946
**************************************