[17323] in Perl-Users-Digest
Perl-Users Digest, Issue: 4745 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 27 18:05:56 2000
Date: Fri, 27 Oct 2000 15:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972684312-v9-i4745@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 27 Oct 2000 Volume: 9 Number: 4745
Today's topics:
*** Please help: Howto call a Perlscript within a Javas <whofer@dplanet.ch>
Re: [Q] Newbie question <tim@ipac.caltech.edu>
Re: ActivePerl under Windoze 98 schnurmann@my-deja.com
apache webserver adn active perl question ?? <avm.nospam@home.nl>
Re: BerkeleyDB install problem (Garry Williams)
Re: Big zip files handling <mischief@velma.motion.net>
Re: Bitreverse an integer <sb@muccpu1.muc.sdm.de>
Re: Detecting socket closure (more symptoms) <fulko@wecan.com>
Re: Detecting socket closure <uri@sysarch.com>
func (a) func !a! func ~a~ func a .... more? <brondsem@my-deja.com>
Re: func (a) func !a! func ~a~ func a .... more? (Tad McClellan)
Re: func (a) func !a! func ~a~ func a .... more? <brondsem@my-deja.com>
Re: Function File::Recurse <randy@theoryx5.uwinnipeg.ca>
Help breaking up long HTML lines <pomeranz@runner.ucdavis.edu>
Re: Help breaking up long HTML lines <pomeranz@runner.ucdavis.edu>
Help with system call <gena@mailcity.com>
Re: Help with system call (Clay Irving)
Re: How can i find my ip? <ralf@kloth.net>
Re: How can i find my ip? <nathangoing@yahoo.com>
How to protect perl program from pirates? <antonov@lib.bmstu.ru>
Re: How to protect perl program from pirates? <mischief@velma.motion.net>
HTTPS request behaving differently kras_gadjokov@yahoo.com
Re: in an eval, redirect STDOUT to a variable <brondsem@my-deja.com>
Re: Is there a better way to get "the element before $x <tim@ipac.caltech.edu>
Re: Matching and removing multiline block in perl 1-lin <ddunham@redwood.taos.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 27 Oct 2000 22:30:23 +0100
From: Werner Hofer <whofer@dplanet.ch>
Subject: *** Please help: Howto call a Perlscript within a Javascript ? ***
Message-Id: <39F9F3EF.84185C47@dplanet.ch>
Hi
i would like to call a Perlscript running on a web server within a
Javasript.The Javasript
is a part of an xy.shtml File. The Web Server is an Apache Server.
The reason is following: I would like to measure the time for witch a
user stays on a
webpage. The onLoad function starts the timer and whenn the user will
leave the webpage
the onUnload function ( exactly the javascript function witch is
associated with onUnload ! )
stops the timer. And now a perl script should called within this
javascript function with this
calculated time as parameter !!!! The perlscript then will write this
time in a database. The perscript sends no return to the webpage. I
tried with Server Site Include without success !
What is wrong ? Or is this impossible ?
When i can not use this mechanism, is it then possible to use an Event
Handler which
intercept the event of leaving a webpage ? If yes , ho to do that ?
The only thing witch i want is to measure the time, call a perscript and
insert this time
into a database (Mysql ).
I tried with the following source code ( The Perlscript was never
executed ! When i
called the Perlscript directly in the URL of the Browser, then the
Perlscript was executed
and inserted a value into the database. This means the perlscript is ok,
only the call within
a javascript does not work !
Please can aybody help ? Thanks a lot in advance .
Werner
I tried with the following, reduced Html / Javascript Code ( extension :
.shtml )
<html>
<head>
<script language="Javascript">
var ti=12;
function measure_time () {
document.write("<!--#exec cgi='cgi-bin/test.pl?time=ti' -->");
}
</script>
</head>
<body onUnload="measure_time()">
<a href="index.htm"> go to another page </a>
</body>
</html>
------------------------------
Date: Fri, 27 Oct 2000 13:24:24 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: [Q] Newbie question
Message-Id: <39F9E478.896F7A1C@ipac.caltech.edu>
> > bh wrote:
> > >
> > > Hi, I am new to perl, and I am interested in writing a program that
> > > will let me create a table (or database or what have you) from several
> > > password files (UNIX /etc/passwd) and:
> > > 1) verify all logins and UIDs are the same in all files (if they exist)
You want to check that the same UID is used on all servers. What action do you
want to take if that isn't so? I assume below it's a fatal error.
> > > 2) determine a UID in a given range (say 1000-9999) that is not in use
> > > in any of the files.
bh wrote:
> Here is a snippet of code. Please don't laugh too hard. This doesn't
> work, but it should give you an idea of what I'm trying to accomplish.
Well, it would be more helpful to those of us trying to help you if you posted
working code with sample data, but I'll go with what we've got. Start with:
use strict;
use warnings;
my (%login,%uid,$nerr);
>
> foreach my $server (@HOSTS) {
> open((PASSWD),"/tmp/passwd.$server") || die "Cannot open passwd files: $!";
Why the extra parens around PASSWD? AFAICT they do no harm, but they're
unnecessary. It's useful to put the file name in the error message:
... || die "Cannot open passwd file /tmp/passwd.$server: $!";
> while (<PASSWD>) {
> ($login, $uid) =(split /:/)[0,2];
> $uid{$login} = $uid;
> }
I think you can help yourself here by keeping more information as you step
through the password files and do some checking as you go. I think I might write
the loop above this way (untested):
while(<PASSWD>) {
my ($login, $uid) = (split /:/)[0,2];
if ($login{$uid} && $login{$uid}{login} ne $login) {
warn "UID $uid $login on $server in use on $login{$uid}{srvr}.\n" ;
++$nerr;
}
if ($uid{$login} && $uid{$login}{uid} != $uid) {
warn "Login ID on $server in use on $uid{$login}{srvr}.\n" ;
++$nerr;
}
$login{$uid} = {login=>$login,srvr=>$server};
$uid{$login} = {uid=>$uid,srvr=>$server};
}
die "Terminating due to $nerr errors.\n" if $nerr;
The server info is kept to make the error messages useful. The loop continues
even after errors are found to give you enough info to cut down on the number of
times you have to iterate in resolving the problems.
To solve problem 2, you do something like this after the loop above has
completed without errors:
print("next available UID is $_.\n"), last for grep ! $login{$_}, 1000..9999;
> foreach $href{$_}(each (\%uid)) {
> foreach %hreg(each (\%uid)) {
> if (%href eq %hreg || %href = %hreg) {
> %key_count=%href;
> }
> }
> }
In addition to being completely unnecessary, this makes no sense. It certainly
only bares a superficial resemblance Perl. I think you should review the
perlfunc write-up on 'each' and the perlsyn write-up on foreach.
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Fri, 27 Oct 2000 19:46:49 GMT
From: schnurmann@my-deja.com
Subject: Re: ActivePerl under Windoze 98
Message-Id: <8tcm37$6d1$1@nnrp1.deja.com>
Darwin is a wireless ISP and is ssslllloooowwwwwww. My cable modem at
home is twice as fast.
I installed Win 2000 on this machine, still ppm doesn't work remotely.
This did allow for DBI to compile and install though.
In article <39F849A2.DD57DA89@mail.uca.edu>,
Cameron Dorey <camerond@mail.uca.edu> wrote:
> schnurmann@my-deja.com wrote:
> >
> > My Windoze 98 machine cannot use ppm to install, but another NT
machine
> > around here, running the same version of ActivePerl can. i think
it is
> > related to my being on Darwin, but I am not sure.
>
> What is Darwin? A firewall or something? If you download the zipped
> module from ActiveState (http://www.ActiveState.com/PPMPackages/zips/)
> to your hard drive, you can PPM it from there on Win98 machine - read
> the README. If the module is not available for your version/build, as
Ed
> said, and you have done, download and do it manually. I don't know
where
> Makefile.pl could be going wrong, I have been lucky enough as yet to
> only need modules available as PPM or Perl-only ones, where I don't
have
> to go through all the manual steps.
>
> Cameron
>
> --
> Cameron Dorey
> Associate Professor of Chemistry
> University of Central Arkansas
> Phone: 501-450-5938
> camerond@mail.uca.edu
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 27 Oct 2000 18:41:30 GMT
From: "Ad v Meersbergen" <avm.nospam@home.nl>
Subject: apache webserver adn active perl question ??
Message-Id: <u%jK5.35394$fO2.161447@dbsch1.home.nl>
i just installed apache webserver and active perl (win32)
when i want to run the script from my homepage i don't run muy script
the script is place in de cgi-bin dir of my webserver folders.
anyone got a clue how to make the cgi or perl scripts work with apache
webserver and active perl
installed on a win98 machine ??
thanks in advance
--
het leven is als een ui, als je laag na laag
afpelt blijkt er niets in te zitten.
ICQ -->> Yes, but ask first
begin 666 Ad van Meersbergen.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DUE97)S8F5R9V5N.T%D.W9A
M;@T*1DXZ060@=F%N($UE97)S8F5R9V5N#0I414P[4$%'15([5D])0T4Z24-1
M(#<R.34T,#0-"D%$4CM(3TU%.CL[.U1I;&)U<F<[.SM.971H97)L86YD<PT*
M3$%"14P[2$]-13M%3D-/1$E.1SU154]4140M4%))3E1!0DQ%.E1I;&)U<F<]
M,$0],$%.971H97)L86YD<PT*6"U704(M1T5.1$52.C(-"E523#IH='1P.B\O
M=W=W+F%D=F%N;2YN970-"D)$05DZ,3DV-3 W,C$-"D5-04E,.U!2148[24Y4
M15).150Z879M0&AO;64N;FP-"E)%5CHR,# P,3 R-U0Q.#0P,C=:#0I%3D0Z
'5D-!4D0-"@``
`
end
------------------------------
Date: Fri, 27 Oct 2000 18:17:40 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: BerkeleyDB install problem
Message-Id: <8FjK5.461$Si.28163@eagle.america.net>
On Fri, 27 Oct 2000 15:26:19 GMT, Dan Wilga
<dwilgaREMOVE@mtholyoke.edu> wrote:
>In article <8t9j75$p5u$1@news.sovam.com>, "Roman Chumakov"
><zfido88@zr.ru> wrote:
>> Here is strange sting for me:
>> Note (probably harmless): No library found for -ldb
>> May be this is a clue?
>
>Yup, that's a clue allright. Try reinstalling BerkeleyDB with the
>1.x-compatibility mode turned on. That way, it will make the DB 1.x library
>that is needed by Perl and its modules.
>
>Then, you have to make sure it gets into the correct path. By default, DB
>writes its libraries into an odd location (can't recall exactly where it is)
>which has little to do with the library paths of most Linux machines.
>
From the README file in DB_File-1.73:
DB_File is a module which allows Perl programs to make use of the
facilities provided by Berkeley DB version 1. (DB_File can be built
version 2 or 3 of Berkeley DB, but it will only support the 1.x
features),
...
PREREQUISITES
-------------
If you want to use Berkeley DB 2.x, you must have version 2.3.4
or greater. If you want to use Berkeley DB 3.x, any version will
do. For Berkeley DB 1.x, use either version 1.85 or 1.86.
...
Step 1 : If you are running either Solaris 2.5 or HP-UX 10 and want
to use Berkeley DB version 2, read either the Solaris Notes or
HP-UX Notes sections below.
Step 2 : Edit the file config.in to suit you local installation.
Instructions are given in the file.
The Solaris notes in the README file pertain to Solaris 2.5 and
reference another error requiring a patch.
From the config.in file in DB_File-1.73:
# 1. Where is the file db.h?
#
# Change the path below to point to the directory where dh.h is
# installed on your system.
#INCLUDE = /usr/local/include
#INCLUDE = /usr/local/BerkeleyDB/include
INCLUDE = ./libraries/3.0.55
# 2. Where is libdb?
#
# Change the path below to point to the directory where libdb is
# installed on your system.
#LIB = /usr/local/lib
#LIB = /usr/local/BerkeleyDB/lib
LIB = ./libraries/3.0.55
# 3. What version of Berkely DB have you got?
#
# If you have version 2.0 or greater, you can skip this question.
Does this help?
--
Garry Williams
------------------------------
Date: Fri, 27 Oct 2000 20:31:10 -0000
From: <mischief@velma.motion.net>
Subject: Re: Big zip files handling
Message-Id: <svjpge1r55tje9@corp.supernews.com>
In comp.lang.perl.modules Garry Williams <garry@ifr.zvolve.net> wrote:
> On 26 Oct 2000 16:55:32 GMT, Camille Sauvage <camille@fortunecity.fr> wrote:
>>open IN, "-";
>>while (<IN>) {
>> nop
>>}
> $ perldoc -f nop
> No documentation for perl function `nop' found
> $
Ever heard of pseudocode? 'nop' or 'noop' is pretty common to mean
'no operation' in examples. Besides, even if it were meant to be
all real Perl, since it's a snippet there's no way to tell 'nop' isn't
defined as s sub somewhere else in the script.
I can't tell for sure, but I hope that critical post was in jest.
> Garry Williams
--
Christopher E. Stith
mischief@motion.net
------------------------------
Date: 27 Oct 2000 19:51:27 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Bitreverse an integer
Message-Id: <8tcmbv$nnm$1@solti3.sdm.de>
In article <8tcccf$933$1@lublin.zrz.tu-berlin.de>, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Sean McAfee has shown a crystal clear method: shift bits out
> of the less significant end of the operand and shift them into the
> less significant end of the result. Hard to go wrong there.
> Of course, looping over single bits doesn't seem to be particularly
> fast. If we define its performance to be 1, Bart's methods perform
> at 1.2 - 1.3. (Benchmarks and code included below, if anyone is
> interested.)
> Using a lookup-table for byte-sized patterns speeds things up
> a little. This works much like Sean's method, only you shift pre-
> reversed bytes, not bits. The unused bits on top of the highest
> byte (if any) end up as the lowest bits in the reversed word. So
> the whole result must undergo a right shift by a quantity which
> turns out to be 7 - (($size-1) % 8). This performs at 1.4.
A method which works in O( log n ) without using a lookup table
is shown at www.snippets.org - or was it comp.lang.c.[misc,moderated]?
(If I'm not mistaken.)
I can try to find it again if anybody's interested, I think I saved
the algorithm somewhere.
Regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Fri, 27 Oct 2000 16:34:58 -0400
From: Fulko Hew <fulko@wecan.com>
Subject: Re: Detecting socket closure (more symptoms)
Message-Id: <39F9E6F2.2781@wecan.com>
Fulko Hew wrote:
> I am fighting with a problem w.r.t. detecting when a remote end
> of a socket has closed on me.
>
> Me Him
>
> <------ data
> <------ close
> data ----->
> |
> <--- sorry socket was closed
Here is a followup to my own posting:
Simple test code always works.
I've gotten my real code to work too, but only randomnly,
and only by throwing print statements in all over.
The size and amount of print, makes a difference
putting in sleep() causes it to always fail.
So its got to be some weird timing thing...
But what ?
------------------------------------------------------------------------
Fulko Hew, Voice: 905-333-6000 x 6010
Senior Engineering Designer, Direct: 905-333-6010
Northrop Grumman-Canada, Ltd. Fax: 905-333-6050
777 Walkers Line, Home: fulko%fkhew@wecan.com
Burlington, Ontario, Canada, L7N 2G1 Work: fulko@wecan.com
------------------------------
Date: Fri, 27 Oct 2000 21:15:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Detecting socket closure
Message-Id: <x7em12kmsy.fsf@home.sysarch.com>
>>>>> "FH" == Fulko Hew <fulko@wecan.com> writes:
FH> I am fighting with a problem w.r.t. detecting when a remote end
FH> of a socket has closed on me.
FH> unless (defined(send($socket, $string, 0))) {
FH> print "write returning error\n";
FH> return 1;
FH> }
FH> I try doing a select for error conditons first. It returns no errors.
closed sockets are detected by reading 0 bytes. just do a normal read/sysread
and check that its size is 0.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 27 Oct 2000 18:58:58 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: func (a) func !a! func ~a~ func a .... more?
Message-Id: <8tcj9d$3st$1@nnrp1.deja.com>
I know there are several characters that can be used to surround
function paramaters:
func (something);
func !something!;
func ~something~;
func something;
Are there any more?
--
Dave Brondsema
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 27 Oct 2000 15:27:43 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: func (a) func !a! func ~a~ func a .... more?
Message-Id: <slrn8vjlpf.k9u.tadmc@magna.metronet.com>
On Fri, 27 Oct 2000 18:58:58 GMT, Dave Brondsema <brondsem@my-deja.com> wrote:
>
>
>I know there are several characters that can be used to surround
>function paramaters:
You "know" incorrectly then.
>func (something);
>func !something!;
>func ~something~;
>func something;
>
>
>Are there any more?
No, there are 2 *less*.
Only the first and last are Perl.
The other 2 must be some other language...
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 27 Oct 2000 21:23:34 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: func (a) func !a! func ~a~ func a .... more?
Message-Id: <8tcroe$bhm$1@nnrp1.deja.com>
In article <slrn8vjlpf.k9u.tadmc@magna.metronet.com>,
tadmc@metronet.com (Tad McClellan) wrote:
> On Fri, 27 Oct 2000 18:58:58 GMT, Dave Brondsema <brondsem@my-
deja.com> wrote:
> >
> >
> >I know there are several characters that can be used to surround
> >function paramaters:
>
> You "know" incorrectly then.
>
> >func (something);
> >func !something!;
> >func ~something~;
> >func something;
> >
> >
> >Are there any more?
>
> No, there are 2 *less*.
>
> Only the first and last are Perl.
>
> The other 2 must be some other language...
ok, I tried some things and looked through some perl documentation and
you're right. What I really want to know is what can I use instead
of / in a regexp.
print qq(1);
print qq~2~;
print qq!3!;
print qq/4/;
>
> --
> Tad McClellan SGML consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
>
--
Dave Brondsema
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 27 Oct 2000 20:05:53 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Function File::Recurse
Message-Id: <8tcn71$lqt$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, Clas Hortien <clas.hortien@sap.com> wrote:
> i found the function File:Recurse and I want to use it. I found the
> documentation but the function is not accessible.
> I'm using:
> perl, v5.6.0 built for MSWin32-x86-multi-thread
[ ... ]
> Can anyone tell me, where I can find this function or how i scan though a
> directory recursive and perform a action on the found files ?
Hi,
http://www.perl.com/CPAN/README.html suggests several ways for
searching and browsing thru CPAN ... File::Recurse is in the
File-Tools package, which you can install via ppm.
best regards,
randy kobes
------------------------------
Date: 27 Oct 2000 18:41:13 GMT
From: Alex Pomeranz <pomeranz@runner.ucdavis.edu>
Subject: Help breaking up long HTML lines
Message-Id: <8tci89$c3l$1@mark.ucdavis.edu>
I'm writing a javascript program that uses a Perl backend to E-mail the
contents of the page. To accomplish this, I decided to use the Net::SMTP
library because it's easily available for both my Windows machine (where I
develop) and the Unix machine that is the live server.
Anyways, almost everything is working fine (E-mail are being sent and when
they are received in an HTML-capable browser they show up fine), except
for one problem. In long text blocks, the "! " symbol is being sprinkled
throughout the block at non-regular intervals. Here's a snippet of the
received text from an E-mail I sent myself:
---
One subset of this field is "terrain visualization". With the advent of
the! G! lobal Positioning System (GPS) and satellite mappings of th! e
earth, large quantities of terrain data have become available for public
consumption
---
As you can see, 3 "! "'s have been inserted (the two spaces after "the"
have been collapsed down to one space because HTML collapses whitespace).
Does anybody have any idea where these "! "'s are coming from, and how to
make them stop?
Thank you for your time!
Alex
------------------------------
Date: 27 Oct 2000 18:45:46 GMT
From: Alex Pomeranz <pomeranz@runner.ucdavis.edu>
Subject: Re: Help breaking up long HTML lines
Message-Id: <8tcigq$c3l$2@mark.ucdavis.edu>
Oh, I should also mention that these "! "'s seem to occur randomly. When
I copied the text above several times, later copies of it did not have the
"! "'s in them, so I think I can safely count out hidden/control
characters in the document or anything like that.
Also, the "! "'s seem to be occuring in a regular pattern. Here's another
snippet:
---
and it is not feasible to push this much data t! o ! the graphics
hardware. Smart algorithms will cull out polyg! ons not shown on the
screen
---
you can see that there are two "! "'s close to each other, then a pause,
then a third "! ". Then there will be no more "! "'s for a long time and
that pattern will repeat.
Again, thanks in advance for any idea or help any of you may have. :)
Alex
------------------------------
Date: Fri, 27 Oct 2000 21:02:01 GMT
From: guest <gena@mailcity.com>
Subject: Help with system call
Message-Id: <39F9ED49.F80B6099@mailcity.com>
Hi, I am trying to execute couple of linux commands from this little
script, but the rpm part
doesn't work. The output is a small table with date and version of the
rpm package.
Any input will be greatly appreciated.
Reply to email, please.
Thanks.
#!/usr/bin/perl -w
require "html.pl";
require "table.pl";
my $version = `cat /opt/product/bin/product_VERSION`;
my $date = `rpm -qi product | grep Install`;
&ch_start_html();
&ct_start_table(2, 'About Product', 'Date Installed', 'Product
Version');
&ct_table_row($date, $version);
&ct_end_table();
#debugging lines
print $version;
print $date;
print "rpm is " . `rpm -qi product`;
&ch_end_html();
------------------------------
Date: 27 Oct 2000 22:00:35 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Help with system call
Message-Id: <slrn8vjuo3.583.clay@panix6.panix.com>
On Fri, 27 Oct 2000 21:02:01 GMT, guest <gena@mailcity.com> wrote:
>Hi, I am trying to execute couple of linux commands from this little
>script, but the rpm part
>doesn't work. The output is a small table with date and version of the
>rpm package.
>Any input will be greatly appreciated.
>Reply to email, please.
>Thanks.
>
>#!/usr/bin/perl -w
>
>require "html.pl";
>require "table.pl";
>
>my $version = `cat /opt/product/bin/product_VERSION`;
>my $date = `rpm -qi product | grep Install`;
>
>&ch_start_html();
>&ct_start_table(2, 'About Product', 'Date Installed', 'Product
>Version');
>&ct_table_row($date, $version);
>&ct_end_table();
>
>#debugging lines
>print $version;
>print $date;
>print "rpm is " . `rpm -qi product`;
>
>&ch_end_html();
Does it run from the command line? If so, you probably have a problem
related to paths, permissions, etc.
--
Clay Irving <clay@panix.com>
Half of the people in the world are below average.
------------------------------
Date: Fri, 27 Oct 2000 19:07:50 +0000
From: "Ralf D. Kloth" <ralf@kloth.net>
Subject: Re: How can i find my ip?
Message-Id: <39F9D286.C1C1EF5D@kloth.net>
Nathan Going wrote:
>
> How do i discover my internet ip address?
From the CPAN-search DB (try it by yourself next time ...)
http://theoryx5.uwinnipeg.ca/CPAN/cpan-search.html :
use Socket;
use Sys::Hostname;
my $host = hostname();
my $addr = inet_ntoa(scalar gethostbyname($host || 'localhost'));
Regards,
--
Ralf D. Kloth
http://www.kloth.net
It's easy to make decisions if you ignore the facts.
------------------------------
Date: Fri, 27 Oct 2000 21:40:09 +0200
From: "Nathan Going" <nathangoing@yahoo.com>
Subject: Re: How can i find my ip?
Message-Id: <8tclnd$874$1@lacerta.tiscalinet.it>
i know that.
</michael> wrote in message
news:ibejvsssvo7lmu1bfn3gh3j6mdt94aiv8d@4ax.com...
> Ipconfig at the dos prompt
>
>
> On Fri, 27 Oct 2000 12:08:32 +0200, "Nathan Going"
> <nathangoing@yahoo.com> wrote:
>
> >How do i discover my internet ip address?
> >
> >
> >
>
------------------------------
Date: Sat, 28 Oct 2000 01:00:23 +0400
From: "Paul Antonov" <antonov@lib.bmstu.ru>
Subject: How to protect perl program from pirates?
Message-Id: <8tcpr6$jva$1@jumbo.demos.su>
I need to protect my perl program...
How can I crypt... compile...or do something else to
privent free reaching of source codes?
--
Pavel Antonov (mailto: soft@relhum.org)
- Softworks - (http://soft.relhum.org)
------------------------------
Date: Fri, 27 Oct 2000 21:46:35 -0000
From: <mischief@velma.motion.net>
Subject: Re: How to protect perl program from pirates?
Message-Id: <svjttre2fl8r47@corp.supernews.com>
Paul Antonov <antonov@lib.bmstu.ru> wrote:
> I need to protect my perl program...
> How can I crypt... compile...or do something else to
> privent free reaching of source codes?
I've been away from the group for a while, but I could almost swear
this was a FAQ last I remembered.
There is a Perl compiler, although some of my working code under the
normal Perl system doesn't work under it. Most of my code works under
the compiler as well as under the interptreter, but not all. I think
the code that broke under the compiler is the portion of a non-forking
TCP server that keeps track of which filehandles are in use for the
client sockets and reuses the available filehandles, in order to keep
the program from running out of file descriptors to use. The program
runs fairly well under the interpreter, but the compiler is still
chugging when I kill its process several hours later. This is probably
enough to start a thread on its own.
You could write a Perl to C translator, then compile the C code.
This is considered non-trivial. ;)
You could hide the program behind a web interface so the code is never
on the end user's machine.
You could have a stub script unencrypt the rest of the script, then
pass control to the newly plaintext part of the script. This sounds
promising at first, but it falls apart when you realize that the
unecnryption portion has to be in plaintext anyway, and anyone who's
going to rip off your source code is going to just change the
unencyryption section to write the rest of the script to disk.
You could write a source obfuscator to transform the source into
less legible but still valid Perl. You'd need to replace variable
names, run code together as much as possible, use unusual puncuation,
and a few other tricks to even cause a modest slowdown for a good
Perl programmer developing an understanding of your code. This may
not be such a problem, though, as a good programmer will write his
own code or modify something with a public license before he steals
your closed-licensed code.
Seriously, most people who understand how to program will not go
around stealing your code, unless perhaps you develop and distribute
a huge, complex system with a high intelectual property content. In
that case, it will probably be something better suited to a fully
compiled language such as C anyway. Coding in C wouldn't keep your
code completely safe if something with a profiler and debugger and
the skill to use them really wanted to reverse-engineer what your
code is doing. Also, C is just as vulnerable as Perl to code copying
if you at all care about portability and offer the uncompiled source
to the public.
> --
> Pavel Antonov (mailto: soft@relhum.org)
> - Softworks - (http://soft.relhum.org)
--
Christopher E. Stith
mischief@motion.net
------------------------------
Date: Fri, 27 Oct 2000 21:32:38 GMT
From: kras_gadjokov@yahoo.com
Subject: HTTPS request behaving differently
Message-Id: <8tcs9m$c14$1@nnrp1.deja.com>
I am running absolutely identical Perl code on my Windows NT and on UK
Shells - they are running Red Hat Linux.
The version of Perl is also the same - 5.005_03 - on both computers.
Everything runs and behaves identically, NO error messages from Perl,
but an HTTPS request using LWP::UserAgent returns just nothing (the
content of the request is empty when run on UK Shellls).
Again - there is NO error messages. My code inculdes HTTP requests with
the same class LWP::UserAgent - works just fine, no problem . Only the
HTTPS request doesn't work.
Is there any way to check if something specific is required on
the Linux shell to get HTTPS working?
Thanks!
Kras Gadjokov
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 27 Oct 2000 18:11:21 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: in an eval, redirect STDOUT to a variable
Message-Id: <8tcgg1$16k$1@nnrp1.deja.com>
In article <39f98c53@cs.colorado.edu>,
tchrist@perl.com (Tom Christiansen) wrote:
> In article <39F8FB4E.641239CC@vpservices.com>,
> Jeff Zucker <jeff@vpservices.com> wrote:
> >Dave Brondsema wrote:
> >>
> >> I have a string that I've read from a file. Then I eval( it. Is
there
> >> any way to change it so that the print statements don't print to
STDOUT
> >> but rather to a string.
> >
> >At the risk of drawing Tom's ire for suggesting a module, try:
>
> Tsk--you really should have mentioned that this is not a standard
> module, but a CPAN one.
And if anyone's wondering, I found it as part of IO-stringy. Not
really the obvious place to look.
>
> > use IO::Scalar;
> > my $str;
> > my $io = tie *STDOUT, 'IO::Scalar', \$str;
> > print 'Hello, world'; # "prints" to $str
> > undef $io;
> > untie *STDOUT;
> > print "\n[$str]\n"; # print to screen
>
> First of all, the undef+untie is a tricky, and you'll have to be
> careful. More importantly, though, you'll find that that will not
> work for arbitrary output emitting statements. For example:
>
> use IO::Scalar;
> my $str;
> my $io = tie *STDOUT, 'IO::Scalar', \$str;
> system "pwd";
> undef $io;
> untie *STDOUT;
> print "\n[$str]\n"; # print to screen
>
> Notice how the code above in no fashion serves to trap that pwd
> command's output. The equivalent using my approach, however, does
> do so correctly:
>
> sub forksub(&) {
> my $kidpid = open my $self, "-|";
> defined $kidpid || die "cannot fork: $!";
> shift->(@_), exit unless $kidpid;
> local $/ unless wantarray;
> return <$self>;
> }
>
> $string = 'system "pwd"';
> $content = '';
> $content .= forksub { eval $string };
> print "Content now <$content>\n";
>
> Or, more directly than using the eval in the original problem,
>
> $content = '';
> $content .= forksub { system "pwd" };
> print "Content now <$content>\n";
>
> You can enchant *main::STDOUT{IO} all you want, but until and unless
> you should actually do something to fileno(STDOUT), you aren't ever
> really touching it in a way meaningful to the real world--you know,
> the one outside of your program. Whether this should matter in the
> specific case the original poster posed I cannot say, but in the
> general case, it most certainly does. (And reading code in from a
> file and evaluating it sure sounds rather general to me.)
>
> --tom
>
--
Dave Brondsema
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 27 Oct 2000 13:49:41 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: Is there a better way to get "the element before $x" in an array?
Message-Id: <39F9EA65.6FDFA238@ipac.caltech.edu>
Mary Ellen Foster wrote:
>
> I was just fooling around with a program to do "previous" and "next" links
> on a set of web pages. Basically, I look for the current page in the
> directory list, and then display the page either directly before it or
> directly after it in the listing (the pages are to be shown in alphabetical
> order, conveniently).
> ...
> my $cur_letter = "1234.html";
> my @letters = <*.html>;
my $prev_letter = $letters[
(grep $cur_letter eq $letters[$_], 0..$#letters)[0]
- 1];
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Fri, 27 Oct 2000 21:50:26 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: Matching and removing multiline block in perl 1-liner
Message-Id: <CMmK5.77$kd5.72001@news.pacbell.net>
nobull@mail.com wrote:
> "Jan Krag" <jak@framfab.dk> writes:
>> I am having some problems making a small regexp work.
>> I am trying to remove the following block of code:
>> perl -i -pe 's/<!-- PRINT_BLOCK - STATIC -->.*<!-- PRINT_BLOCK -
>> STATIC -->//gs;' index.html
> perl -pe will apply the given perl code to modify each line of the
> file in turn. You want to apply the statements to the whole file
> treated as a single string. You have to tell Perl that there's no
> such thing as an input line separator.
> BEGIN{undef $/};
or -0777 as documented in perlrun.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< Please move on, ...nothing to see here, please disperse >
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4745
**************************************