[16421] in Perl-Users-Digest
Perl-Users Digest, Issue: 3833 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 28 14:06:21 2000
Date: Fri, 28 Jul 2000 11:05:18 -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: <964807518-v9-i3833@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Jul 2000 Volume: 9 Number: 3833
Today's topics:
Re: &func(), &func, or func()? <makarand_kulkarni@my-deja.com>
-T switch <vicki@kr8.com>
Re: -T switch <sariq@texas.net>
Re: -T switch <news@webneeds.com>
Re: -T switch (Abigail)
Re: Analog vs Cable connections schnurmann@my-deja.com
Re: Analog vs Cable connections schnurmann@my-deja.com
Re: Callback in SNMP module (Peter J Scott)
can't use global $^W in "my"... <eaglewing@zensearch.com>
Re: Capturing info accross multiple pages in one form (Mark W. Schumann)
Checking Pragma in XS <yacob@rcn.com>
Converting to different Bases (R W Richey)
Re: Converting to different Bases <uri@sysarch.com>
Re: DBI.pm (Mark W. Schumann)
Re: download file from another server (Abigail)
Good Perl Courses In UK? gavin_gibson@my-deja.com
Re: Help with SQL query in Perl script <michael.segulja@sgi-lsi.com>
Re: Help with SQL query in Perl script <atrus@atrustrivalie.eu.org>
hide or encrypted Per source? nospam.tomtt@hotmail.com
Re: hide or encrypted Per source? <lauren_smith13@hotmail.com>
Re: How to trim strings? <news@webneeds.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 Jul 2000 09:53:49 -0700
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
To: "Alex T." <samara_biz@hotmail.com>
Subject: Re: &func(), &func, or func()?
Message-Id: <3981BA9D.32879679@my-deja.com>
> I saw in other scripts that some of them use &function_name and some
> function_name().
If a sub us called using "&" the argument list is
optional and if it is omitted then the current value of
@_ is passed to it.
ie &function_name is like function_name ( @_ );
and
&function_name( ) gets passed the null list as arg.
perldoc perlsub
------------------------------
Date: Fri, 28 Jul 2000 17:29:22 +0200
From: "Vicki Youll" <vicki@kr8.com>
Subject: -T switch
Message-Id: <8ls9cv$7sd$1@duke.telepac.pt>
Hi ,
I have no experience with perls "taint" - however am trying to use taint
mode via the -T switch on the #! perl interpreter line
(e.g #! /usr/bin/perl -w -T) . I however receive this message back when
i execute my script on the perl command line " Too late for -T option" .
What does this mean ? and how can i run my cgi scripts under taint mode? I
would appreciate any suggestions. Thanks.
This is the first few lines of my code - if this helps.
#! /usr/bin/perl -w -T
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use diagnostics;
use strict;
Vic
------------------------------
Date: Fri, 28 Jul 2000 10:55:15 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: -T switch
Message-Id: <3981ACE3.A0122BEA@texas.net>
Vicki Youll wrote:
>
> Hi ,
>
> I have no experience with perls "taint" - however am trying to use taint
> mode via the -T switch on the #! perl interpreter line
> (e.g #! /usr/bin/perl -w -T) . I however receive this message back when
> i execute my script on the perl command line " Too late for -T option" .
> What does this mean ?
Perl's diagnostic messages are documented in:
perldoc perldiag
> and how can i run my cgi scripts under taint mode?
The answers to 99% of your Perl questions are as close as your
harddrive.
Read:
perldoc perlrun
for a description of the -T switch. This refers you to:
perldoc perlsec
Then, learn to fish.
perldoc perldoc
perldoc perl
- Tom
------------------------------
Date: Fri, 28 Jul 2000 10:00:44 -0600
From: "Dan Manion" <news@webneeds.com>
Subject: Re: -T switch
Message-Id: <raig5.515$fS5.107537@news.uswest.net>
You're problem comes from how you are executing your program from the
command line.
try running "./programname" from the command line and not "perl programname"
make sure you've run "chmod +x programname" as well if you haven't done so
already.
If you do want to run a script in taint mode from the command line as you
are, try "perl -T programname"
For more information on why these are different run "man perlrun"
Hope this helps!
"Vicki Youll" <vicki@kr8.com> wrote in message
news:8ls9cv$7sd$1@duke.telepac.pt...
> Hi ,
>
> I have no experience with perls "taint" - however am trying to use taint
> mode via the -T switch on the #! perl interpreter line
> (e.g #! /usr/bin/perl -w -T) . I however receive this message back
when
> i execute my script on the perl command line " Too late for -T option" .
> What does this mean ? and how can i run my cgi scripts under taint mode?
I
> would appreciate any suggestions. Thanks.
>
> This is the first few lines of my code - if this helps.
>
>
> #! /usr/bin/perl -w -T
>
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
> use diagnostics;
> use strict;
>
>
> Vic
>
>
------------------------------
Date: 28 Jul 2000 13:18:04 EDT
From: abigail@foad.org (Abigail)
Subject: Re: -T switch
Message-Id: <slrn8o3g23.vcg.abigail@alexandra.foad.org>
Vicki Youll (vicki@kr8.com) wrote on MMDXXIII September MCMXCIII in
<URL:news:8ls9cv$7sd$1@duke.telepac.pt>:
^^
^^ I have no experience with perls "taint" - however am trying to use taint
^^ mode via the -T switch on the #! perl interpreter line
^^ (e.g #! /usr/bin/perl -w -T) . I however receive this message back when
^^ i execute my script on the perl command line " Too late for -T option" .
^^ What does this mean ? and how can i run my cgi scripts under taint mode? I
^^ would appreciate any suggestions. Thanks.
So, when you looked up this error in 'man perldiag', what did you find?
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
------------------------------
Date: Fri, 28 Jul 2000 16:16:58 GMT
From: schnurmann@my-deja.com
Subject: Re: Analog vs Cable connections
Message-Id: <8lsbll$mgr$1@nnrp1.deja.com>
I assume you have a WIndows OS here. I had a similar problem, though
not with Perl, when I had the modem and the netcard in the same machine
when I hooked it up to my cable modem. I didn't need the dial modem,
so I yanked it and all works fine. Also, check the IRQs for the NIC
and the modem.
Btw, cable modems are analog too.
In article <3981897d.1673740@news-server>,
jcrae@bigpond.net.au wrote:
> I suspect this is an ISP problem rather than a Perl problem (therefore
> off-topic for which I apologise), but I have to start somewhere.
>
> I have a perl script which gets some web pages (and does various other
> things). It has worked fine for a couple of years over analog dial up
> lines, and via networks with ISDN links, on Win95, Win98 and WinNT. I
> recently got a cable connection (Telstra's Big Pond Advance service in
> Australia, FWIW), and the script doesn't work on this service. But it
> still works on an analog modem dial up on the samePC.
>
> Here's a snippet of code showing the problem:
> ==========================================
> use IO::Socket;
>
> $host = "www.apcmag.com";
> $remote = IO::Socket::INET->new( Proto => "tcp",
> PeerAddr => $host,
> PeerPort => "http(80)",
> );
>
> unless ($remote) {die "Cannot connect to http daemon on host"};
> print "Connection made\n";
> $remote->autoflush(1);
> $getname = "/start/";
> print "About to GET $getname\n";
> print $remote "GET $getname HTTP/1.0\n\n"; #Hangs here
> while ( <$remote> ) {
> print;
> }
> =============================================
> On cable, it prints the diagnostic line "About to GET.." etc, then
> hangs. It eventually exits, presumably on a time out.
>
> Anyone have any experience of this problem?
>
> Cheers
> John Rae
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 16:17:42 GMT
From: schnurmann@my-deja.com
Subject: Re: Analog vs Cable connections
Message-Id: <8lsbn0$mhd$1@nnrp1.deja.com>
Oh, I forgot to say what I suspect....it is trying to dial the modem in
order to connect to network.
In article <3981897d.1673740@news-server>,
jcrae@bigpond.net.au wrote:
> I suspect this is an ISP problem rather than a Perl problem (therefore
> off-topic for which I apologise), but I have to start somewhere.
>
> I have a perl script which gets some web pages (and does various other
> things). It has worked fine for a couple of years over analog dial up
> lines, and via networks with ISDN links, on Win95, Win98 and WinNT. I
> recently got a cable connection (Telstra's Big Pond Advance service in
> Australia, FWIW), and the script doesn't work on this service. But it
> still works on an analog modem dial up on the samePC.
>
> Here's a snippet of code showing the problem:
> ==========================================
> use IO::Socket;
>
> $host = "www.apcmag.com";
> $remote = IO::Socket::INET->new( Proto => "tcp",
> PeerAddr => $host,
> PeerPort => "http(80)",
> );
>
> unless ($remote) {die "Cannot connect to http daemon on host"};
> print "Connection made\n";
> $remote->autoflush(1);
> $getname = "/start/";
> print "About to GET $getname\n";
> print $remote "GET $getname HTTP/1.0\n\n"; #Hangs here
> while ( <$remote> ) {
> print;
> }
> =============================================
> On cable, it prints the diagnostic line "About to GET.." etc, then
> hangs. It eventually exits, presumably on a time out.
>
> Anyone have any experience of this problem?
>
> Cheers
> John Rae
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 17:41:59 GMT
From: peter@PSDT.com (Peter J Scott)
Subject: Re: Callback in SNMP module
Message-Id: <HBjg5.14659$Cm.508601@news1.gvcl1.bc.home.com>
In article <8lqs4r$63s$1@dipsy.missouri.edu>,
Justin McNutt <mcnuttj@nin.iats.missouri.edu> writes:
>Okay, the problem has changed..
>
>Consider the following snippet:
[snip]
> $sess[$x] = new SNMP::Session(DestHost => $fullip,
> Community => $comm,
> Retries => 1,
> Timeout => 1000000);
[snip]
> $sess[$x]->getnext($vb[$x], [\&poller, $sess[$x], $x]);
[snip]
>All goes well until the line where 'getnext' is called. Then I get the error:
>
>Can't call method "getnext" on unblessed reference at [blah blah] line 17.
>
>I have no real idea of what "bless" does (although I read the section in
>'man perlfunc' on it), but I do know that the problem is with $sess[$x]. If
>I try "bless $sess[$x]" on it, I get this:
Nice try, but this is not your problem. If SNMP::Session::new returned a reference
and didn't bless it, the bug is in SNMP/Session.pm, not your code, and is serious
enough that your trying to fix it in your code is unlikely to work. Get the latest
version of SNMP. If you *have* the latest version, send a bug report to the author;
all you need to do is have one line that does my $thing = new SNMP::Session (args)
and in the next, print ref $thing. If the output from the print doesn't contain
an = sign, you've reproduced the bug and you can send it to the author. If it does,
something bizarre is going on; head back here.
--
Peter Scott
------------------------------
Date: Fri, 28 Jul 2000 11:03:14 -0700
From: "eaglewing" <eaglewing@zensearch.com>
Subject: can't use global $^W in "my"...
Message-Id: <8lshu6$56vab$1@ID-41717.news.cis.dfn.de>
If someone could help me with this before I am unable to resist putting my
fist through my screen I'd be very much obliged.
On a linux/apache setup, I have a relatively simple script which seems throw
this error 50% of the time (a refresh on the browser will make it go away,
refresh again it will come back):
[Thu Jul 27 22:13:06 2000] [error] Can't use global $^W in "my" at
/home/gavin/codebase/v1/scripts/lucia2 line 1
I was using vi for development, which can be tricky with control chars, but
looking at it in emacs, and uploading it into windows notepad I still
couldn't see anything wrong.
thanks
-gavin
------------------------------
Date: 28 Jul 2000 12:34:19 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Capturing info accross multiple pages in one form
Message-Id: <8lscmb$q93@junior.apk.net>
In article <8lphs5$8u2$1@eastnews1.east.sun.com>,
Nobody <nobody@contract.East.Sun.COM> wrote:
>This is a good technique. Another similar way to do this is to
>build a "hidden" page (by using a frame that is 100% of your
>screen) and setting up a set of hidden variables there. Each
>time you move to the next page, you call a function that copies all
>of the form inputs to their respective hidden counterparts on the
>other page. Then, your input forms can all be straight html pages
>and you can do your actual "submit" to the cgi that will process the
>data at the end. You can write similar code for your own "go back"
>button, to fill in the values of the previous page, or add context-
>sensitive help. Granted, this isn't entirely a Perl solution, but
>it came in handy on a project I did once that was working over a dog-slow
>network connection to an overworked NT server (doesn't take much to
>overwork those puppies :-). This technique simply shifts some of the
>processing to the client side.
Sure, but now we're getting far, far away from a Perl discussion.
Perhaps this could be moved to one of the CGI newsgroups.
------------------------------
Date: Fri, 28 Jul 2000 16:55:10 GMT
From: Daniel Yacob <yacob@rcn.com>
Subject: Checking Pragma in XS
Message-Id: <8lsdtb$o71$1@nnrp1.deja.com>
Greetings All,
I'd like to know how to check if a pragma has been set from within the
XS layer? Specifically I want to check if "use utf8" has been set from
within an XS sub to determine what I should return (ascii or utf8 text).
thanks,
/Daniel
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 28 Jul 2000 15:52:53 GMT
From: rwr09b50@u.cc.utah.edu (R W Richey)
Subject: Converting to different Bases
Message-Id: <8lsa8l$s1t$1@coward.ks.cc.utah.edu>
I'm writing a program that converts numbers from either binary, decimel,
or hexidecimel into the other two formats. I'm wondering if there is some
elegant way to do that. I know about the hex function (and the oct
function for that matter) and I can write a program which just does the
math, but since the computer is doing these conversions all the time
behind the scenes I figured there might be an easier way.
RW Richey
Humble Perl Newbie
------------------------------
Date: Fri, 28 Jul 2000 16:09:39 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Converting to different Bases
Message-Id: <x7og3i5j98.fsf@home.sysarch.com>
>>>>> "RWR" == R W Richey <rwr09b50@u.cc.utah.edu> writes:
RWR> I'm writing a program that converts numbers from either binary,
RWR> decimel, or hexidecimel into the other two formats. I'm
RWR> wondering if there is some elegant way to do that. I know about
RWR> the hex function (and the oct function for that matter) and I can
RWR> write a program which just does the math, but since the computer
RWR> is doing these conversions all the time behind the scenes I
RWR> figured there might be an easier way.
read the functions pack, unpack and sprintf.
5.6 supports binary format.
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: 28 Jul 2000 12:37:53 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: DBI.pm
Message-Id: <8lsct1$rik@junior.apk.net>
In article <39805220.7F7B5C1@mail.ford.com>,
Chalapathi Malempati <cmalempa@mail.ford.com> wrote:
>I have a MS Access database on Unix. I am using the following perl code
>to open the access database and it doesn't work.
I'll say what I usually do with such a vague question. It's honestly
not meant to be insulting, it just helps you focus the question:
"How do you know it doesn't work?"
In other words, what happens unexpectedly when you try to run it? Does
it give some kind of error message? Does it do nothing at all? Does
it do something bad? Does it give incorrect output?
Once you (and the rest of us) understand the question the answer might
come a lot more easily.
------------------------------
Date: 28 Jul 2000 13:06:13 EDT
From: abigail@foad.org (Abigail)
Subject: Re: download file from another server
Message-Id: <slrn8o3fbs.vcg.abigail@alexandra.foad.org>
Sebastian Erlhofer (Seb.Erlhofer@evc.net) wrote on MMDXXIII September
MCMXCIII in <URL:news:dvi2osg7ulvq8re4sess4cqj82vrk8futs@4ax.com>:
$$ >does the job you want, this group needs more info. about
$$ >the problem space.
$$
$$
$$ no prob...
$$
$$ The script has to work as follows:
$$
$$ User click at button (call script)
$$ Script has to download file, lets say from "www.minehost.com/abc.zip"
$$ Script has to save file to "www.minehostmirror.com/abc.zip"
$$ Giving report...
If that are all your requirements, NFS should do fine. Although UUCP
would work too.
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
------------------------------
Date: Fri, 28 Jul 2000 17:04:57 GMT
From: gavin_gibson@my-deja.com
Subject: Good Perl Courses In UK?
Message-Id: <8lsefm$olb$1@nnrp1.deja.com>
Hello All,
Myself and a colleague, are already fairly experienced shell coders and
have a smattering of Perl, learnt from books etc. However the
opportunity for Perl training has come up and we're now looking for a
course.
Ideally we want something which will teach us about Perl, rather than
just about programming with Perl, as we won't need the concept of
loops, boolean operators etc to be explained to us.
We're both DBA's and so specifically we'd be interested in DBI stuff
but we couldn't afford just to learn this exclusively.
Does anyone know of a good course that would meet these needs? + if
it's in London all the better!
Thanks for your help in advance
Gavin
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 15:09:07 GMT
From: Michael Segulja <michael.segulja@sgi-lsi.com>
Subject: Re: Help with SQL query in Perl script
Message-Id: <8ls7me$j57$1@nnrp1.deja.com>
I checked my apache error log. The following is the error I get when I
run the cgi script from my web browser. If I run it from the command
line, I get nothing.
Use of uninitialized value at /home/httpd/cgi-bin/dbase.cgi line 40.
install_driver(mysql) failed: Can't
load '/usr/lib/perl5/site_perl/5.005/i386-li
nux/auto/DBD/mysql/mysql.so' for module
DBD::mysql: /usr/lib/perl5/site_perl/5.0
05/i386-linux/auto/DBD/mysql/mysql.so: undefined symbol: uncompress
at /usr/lib/
perl5/5.00503/i386-linux/DynaLoader.pm line 169.
I checked my install of DBD::mysql, and I'm getting some errors when I
run make test. Here's what I get there.
[michael.segulja@sgi_nt_image Msql-Mysql-modules-1.2214]# make test
make[1]: Entering directory `/usr/local/src/Msql-Mysql-modules-
1.2214/mysql'
make[1]: Leaving directory `/usr/local/src/Msql-Mysql-modules-
1.2214/mysql'
make[1]: Entering directory `/usr/local/src/Msql-Mysql-modules-
1.2214/mysql'
PERL_DL_NONLAZY=1 /usr/bin/perl -I../blib/arch -I../blib/lib -
I/usr/lib/perl5/5.
00503/i386-linux -I/usr/lib/perl5/5.00503 -e 'use Test::Harness qw
(&runtests $ve
rbose); $verbose=0; runtests @ARGV;' t/*.t
t/00base............install_driver(mysql) failed: Can't
load '../blib/arch/auto/
DBD/mysql/mysql.so' for module
DBD::mysql: ../blib/arch/auto/DBD/mysql/mysql.so:
undefined symbol: uncompress at /usr/lib/perl5/5.00503/i386-
linux/DynaLoader.pm
line 169.
at (eval 1) line 3
Perhaps a required shared library or dll isn't installed where expected
at t/00base.t line 38
dubious
Test returned status 255 (wstat 65280, 0xff00)
Undefined subroutine &Test::Harness::WCOREDUMP called
at /usr/lib/perl5/5.00503/
Test/Harness.pm line 288.
make[1]: *** [test_dynamic] Error 255
make[1]: Leaving directory `/usr/local/src/Msql-Mysql-modules-
1.2214/mysql'
make: *** [test] Error 2
at (eval 5) line 3
Perhaps a required shared library or dll isn't installed where expected
at /home/httpd/cgi-bin/dbase.cgi line 64
I ran a search and found the following:
/usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
/usr/local/src/Msql-Mysql-modules-
1.2214/blib/arch/auto/DBD/mysql/mysql.so
/usr/lib/perl5/5.00503/Test/Harness.pm
Searching for Dynaloader.pm found nothing. I found a file called perl-
5.6.0.tar.gz on CERN that says Dynaloader for Module/Category, but this
almost looks like an entire download of Perl. It's 5MB!
Am I on the right track here? I'm obviously lost and confused, but I
do understand how most of this stuff works so I'm not totally clueless
at least. :) Sorry to post such a long post, but I'm really pushing
this where I work as a viable solution for our help desk system so we
can get Linux here. If you noticed above, the server name is
sgi_nt_image because right now all the higher ups think it's an NT
server!! ;-)
Anyway, I really appreciate everybody's help with this one.
In article <39810AB5.88D162A2@atrustrivalie.eu.org>,
Yann Ramin <atrus@atrustrivalie.eu.org> wrote:
> Try to see if you can run the script on the command line. You won't
be
> able to "submit" it, but you should get a spew of HTML. Is the HTML
> correct as well?
>
> Look in the Apache error_log for any clues if everything seems happy.
>
> Yann
>
> Michael Segulja wrote:
> >
> > I am learning Perl 5, and following along with a tutorial I found
on the
> > Internet. First, here's my setup... Mandrake Linux 7.1 server,
Apache
> > Web Server, MySql database, and Perl 5. Basically, the tutorial
walks
> > through creating a simple MySql database called Clients, a MySql
user I
> > named webdb, and a CGI script in Perl that will create a nice
looking
> > form that, after entering certain criteria, will return a query
from the
> > database. My question is how do I test this to find out why it
doesn't
> > work? I know there are no typos, so I'm guessing it's probably some
> > setup problem. When I load the form in my web browser, I just get a
> > blank screen. I don't really know what to do to see what's
happening
> > behind the scenes. As far as I can tell, I'm not even getting an
> > attempted connection to the database, and I have no idea why.
> >
> > I know this might sound like I'm fumbling in the dark, but it's
quite a
> > lot to try to digest all at once, between getting Apache working
like I
> > want it, Perl like I want it, and then setting up MySql. Thank you
in
> > advance for any help.
> >
> > Michael
>
> --
>
> --------------------------------------------------------------------
> Yann Ramin atrus@atrustrivalie.eu.org
> Atrus Trivalie Productions www.redshift.com/~yramin
> Monterey High IT www.montereyhigh.com
> ICQ 46805627
> AIM oddatrus
> Marina, CA
>
> IRM Developer Network Toaster Developer
> SNTS Developer KLevel Developer
>
> (yes, this .signature is way too big)
>
> "All cats die. Socrates is dead. Therefore Socrates is a cat."
> - The Logician
>
> THE STORY OF CREATION
>
> In the beginning there was data. The data was without form and null,
> and darkness was upon the face of the console; and the Spirit of IBM
> was moving over the face of the market. And DEC said, "Let there be
> registers"; and there were registers. And DEC saw that they carried;
> and DEC seperated the data from the instructions. DEC called the data
> Stack, and the instructions they called Code. And there was evening
> and there was a maorning, one interrupt...
> -- Rico Tudor
>
> William Safire's Rules for Writers:
>
> Remembe
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 09:08:59 -0700
From: Yann Ramin <atrus@atrustrivalie.eu.org>
Subject: Re: Help with SQL query in Perl script
Message-Id: <3981B01B.2025EDC@atrustrivalie.eu.org>
It looks like your MySQL module is linked with some odd things...try
giving it a whirl by installing via. the CPAN shell. Its some library
dependancy thing, specific to your site.
Michael Segulja wrote:
>
> I checked my apache error log. The following is the error I get when I
> run the cgi script from my web browser. If I run it from the command
> line, I get nothing.
>
> Use of uninitialized value at /home/httpd/cgi-bin/dbase.cgi line 40.
> install_driver(mysql) failed: Can't
> load '/usr/lib/perl5/site_perl/5.005/i386-li
> nux/auto/DBD/mysql/mysql.so' for module
> DBD::mysql: /usr/lib/perl5/site_perl/5.0
> 05/i386-linux/auto/DBD/mysql/mysql.so: undefined symbol: uncompress
> at /usr/lib/
> perl5/5.00503/i386-linux/DynaLoader.pm line 169.
>
> I checked my install of DBD::mysql, and I'm getting some errors when I
> run make test. Here's what I get there.
>
> [michael.segulja@sgi_nt_image Msql-Mysql-modules-1.2214]# make test
> make[1]: Entering directory `/usr/local/src/Msql-Mysql-modules-
> 1.2214/mysql'
> make[1]: Leaving directory `/usr/local/src/Msql-Mysql-modules-
> 1.2214/mysql'
> make[1]: Entering directory `/usr/local/src/Msql-Mysql-modules-
> 1.2214/mysql'
> PERL_DL_NONLAZY=1 /usr/bin/perl -I../blib/arch -I../blib/lib -
> I/usr/lib/perl5/5.
> 00503/i386-linux -I/usr/lib/perl5/5.00503 -e 'use Test::Harness qw
> (&runtests $ve
> rbose); $verbose=0; runtests @ARGV;' t/*.t
> t/00base............install_driver(mysql) failed: Can't
> load '../blib/arch/auto/
> DBD/mysql/mysql.so' for module
> DBD::mysql: ../blib/arch/auto/DBD/mysql/mysql.so:
> undefined symbol: uncompress at /usr/lib/perl5/5.00503/i386-
> linux/DynaLoader.pm
> line 169.
>
> at (eval 1) line 3
> Perhaps a required shared library or dll isn't installed where expected
> at t/00base.t line 38
> dubious
> Test returned status 255 (wstat 65280, 0xff00)
> Undefined subroutine &Test::Harness::WCOREDUMP called
> at /usr/lib/perl5/5.00503/
> Test/Harness.pm line 288.
> make[1]: *** [test_dynamic] Error 255
> make[1]: Leaving directory `/usr/local/src/Msql-Mysql-modules-
> 1.2214/mysql'
> make: *** [test] Error 2
> at (eval 5) line 3
> Perhaps a required shared library or dll isn't installed where expected
> at /home/httpd/cgi-bin/dbase.cgi line 64
>
> I ran a search and found the following:
>
> /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
> /usr/local/src/Msql-Mysql-modules-
> 1.2214/blib/arch/auto/DBD/mysql/mysql.so
> /usr/lib/perl5/5.00503/Test/Harness.pm
>
> Searching for Dynaloader.pm found nothing. I found a file called perl-
> 5.6.0.tar.gz on CERN that says Dynaloader for Module/Category, but this
> almost looks like an entire download of Perl. It's 5MB!
>
> Am I on the right track here? I'm obviously lost and confused, but I
> do understand how most of this stuff works so I'm not totally clueless
> at least. :) Sorry to post such a long post, but I'm really pushing
> this where I work as a viable solution for our help desk system so we
> can get Linux here. If you noticed above, the server name is
> sgi_nt_image because right now all the higher ups think it's an NT
> server!! ;-)
>
> Anyway, I really appreciate everybody's help with this one.
>
> In article <39810AB5.88D162A2@atrustrivalie.eu.org>,
> Yann Ramin <atrus@atrustrivalie.eu.org> wrote:
> > Try to see if you can run the script on the command line. You won't
> be
> > able to "submit" it, but you should get a spew of HTML. Is the HTML
> > correct as well?
> >
> > Look in the Apache error_log for any clues if everything seems happy.
> >
> > Yann
> >
> > Michael Segulja wrote:
> > >
> > > I am learning Perl 5, and following along with a tutorial I found
> on the
> > > Internet. First, here's my setup... Mandrake Linux 7.1 server,
> Apache
> > > Web Server, MySql database, and Perl 5. Basically, the tutorial
> walks
> > > through creating a simple MySql database called Clients, a MySql
> user I
> > > named webdb, and a CGI script in Perl that will create a nice
> looking
> > > form that, after entering certain criteria, will return a query
> from the
> > > database. My question is how do I test this to find out why it
> doesn't
> > > work? I know there are no typos, so I'm guessing it's probably some
> > > setup problem. When I load the form in my web browser, I just get a
> > > blank screen. I don't really know what to do to see what's
> happening
> > > behind the scenes. As far as I can tell, I'm not even getting an
> > > attempted connection to the database, and I have no idea why.
> > >
> > > I know this might sound like I'm fumbling in the dark, but it's
> quite a
> > > lot to try to digest all at once, between getting Apache working
> like I
> > > want it, Perl like I want it, and then setting up MySql. Thank you
> in
> > > advance for any help.
> > >
> > > Michael
> >
> > --
> >
> > --------------------------------------------------------------------
> > Yann Ramin atrus@atrustrivalie.eu.org
> > Atrus Trivalie Productions www.redshift.com/~yramin
> > Monterey High IT www.montereyhigh.com
> > ICQ 46805627
> > AIM oddatrus
> > Marina, CA
> >
> > IRM Developer Network Toaster Developer
> > SNTS Developer KLevel Developer
> >
> > (yes, this .signature is way too big)
> >
> > "All cats die. Socrates is dead. Therefore Socrates is a cat."
> > - The Logician
> >
> > THE STORY OF CREATION
> >
> > In the beginning there was data. The data was without form and null,
> > and darkness was upon the face of the console; and the Spirit of IBM
> > was moving over the face of the market. And DEC said, "Let there be
> > registers"; and there were registers. And DEC saw that they carried;
> > and DEC seperated the data from the instructions. DEC called the data
> > Stack, and the instructions they called Code. And there was evening
> > and there was a maorning, one interrupt...
> > -- Rico Tudor
> >
> > William Safire's Rules for Writers:
> >
> > Remembe
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
--------------------------------------------------------------------
Yann Ramin atrus@atrustrivalie.eu.org
Atrus Trivalie Productions www.redshift.com/~yramin
Monterey High IT www.montereyhigh.com
ICQ 46805627
AIM oddatrus
Marina, CA
IRM Developer Network Toaster Developer
SNTS Developer KLevel Developer
(yes, this .signature is way too big)
"All cats die. Socrates is dead. Therefore Socrates is a cat."
- The Logician
THE STORY OF CREATION
In the beginning there was data. The data was without form and null,
and darkness was upon the face of the console; and the Spirit of IBM
was moving over the face of the market. And DEC said, "Let there be
registers"; and there were registers. And DEC saw that they carried;
and DEC seperated the data from the instructions. DEC called the data
Stack, and the instructions they called Code. And there was evening
and there was a maorning, one interrupt...
-- Rico Tudor
William Safire's Rules for Writers:
Remembe
------------------------------
Date: Sat, 29 Jul 2000 00:31:35 +0800
From: nospam.tomtt@hotmail.com
Subject: hide or encrypted Per source?
Message-Id: <MPG.13ec364036dd9176989680@news.newsguy.com>
Someone please help me the follow code? What is the all about, Million
Thanks
#!/usr/local/bin/perl
use Socket;*DB::readline=sub{gethostbyname($ub[2]);"q"};sub SUB{sub
sub6{my($Sub,$sUb,$suB)=@_;@sub6=split(/\./,$Sub);@sub0=split(/\./,$sUb);
$n=25;while($n-->0){@sUb=@sub0;@sub0=@sub6;sub
sUb{$_="M$_";}for($SUB=0;$SUB<4;$SUB++){$sub6[$SUB]=
$sUb[$SUB]^(($suB*$sub6[$SUB])%256);}}join('',@sub6)."|".join('',@sub0);}
subsub7{my($SUb,$Sub1)=@_;while(!$suB){$sUB++;$suB1=sub6($SUb,$Sub1,$sUB)
;$sUb1=join('',map(chr,split(/\||\s+/,$suB1)));if($sUb1=~/bT/){$suB=$sUB;
}}$suB;}$sub4=\&sub2;$sub5=\&sub3;sub
sub7{$@='u';}subsub1{die(&$sub4(&$sub5((shift)
))."\n")}subsub2{$SUb=sub6($ub[2],
$ub[3],$suB);$SUb.="".sub6($ub[4],$ub[5],$suB);$SUb=~s/98/32/g;(shift).jo
in('',map(chr,split(/\||\s+/,$SUb)));sub sub6{&sub4;}}
subsub3{$SUb=sub6($ub[0],$ub[1],&{(shift)}
);$SUb=~s/98/32/g;join('',map(chr,split(/\||\s+/,$SUb)));}sub1sub{$suB=su
b7($ub[0],$ub[1]);};}$_=<<'';&sub7;eval(&sub6);sub sub3 {$n="0m26<l~l
*,..VztRE@<620,*-!
";$B=65521;useinteger;$sb='{$a=shift;'.'$g=$h=$i=0;@c=';eval"subu".$sb.
'map{'.'$g+=$_*$a;$b=$g%$B;$g/=$B;$b;}@_;!$g||'.
'push@c,$g;@c;}';eval"sub" .' d' .$sb. 'reverse ' .'map
{$h=($_+$g*$B'.')/$a;$g=($_+$g*'.'$B)-$h*$a;$h;}re'.'ve'.'rse@_;'.'
@c[$#c]!=0|'.'|p'.'op@c;('.'$g'.',@c);}' ;sub
sub5{&sUb;unpack($@,$_);}sub p{for($j=0;(($k,@l) =d(2,@_))&&$k ==0;$j++)
{@_=@l;}return$j*(("@_"eq 1)&&($#_==0));}push@o,2;do{($r,@t)=d(
ord(substr$n,$m+14,1)-31,@o) ;if($r==0){@o=u(ord(substr$n,$m, 1)-
31,@t);sub sub4{unpack ($@,&sub5);}$m=0;if($p= p(@o)){print"$p\n";}}
else{$m=($m+1)%14;} }while($n);}
32)`2"H]-
RU%*"<M5#Q&14,](TQ`(D!(1#\C5%$N4$E5/%8T0#!4/2DN4$@JM/3<M12@D43<T(TA:-
3<M10I-/$0E1SDV650N4$E5/%8T0#(E,30T(TA:-$8UM43TV-
5,](TPJ/3<M12@D030U)6!:+D4I13Q7(4\[1RU%"DTN4$@J/3<M12@DM43<T(TA:-
"<I3STF74,[5E!;(D<U4SDR(2PU56!:+D4A4CM7,4\X5EU,+D-
)M2#TG,5`*33XC3"HS)3TP+D-),#Q&750[5BU/.R-(6CHV55`[)C5-
.3995#M7M*$@I5D%4/2<A6"E24$<S)3TP+D-),`I-
/$9=5#M6+4\[(TA:.B<Q5#PG0$<JM,TPJ(D9562@B,5$]-C52/C-
53CDW/$`P5#TI+E!(1#PW-44\1T1-"DTO1D5-M/"9=4CTE74XX-
E5%/%)`1S0B/$DN4$E0/$9%3CTB8$0\-S5%/$=$32]&044XM-C%%/$-,*CLW1$`*32DG-
5([(U1'.B<Q5#PG0%HK4EU7.#8M4#@V+$XX5EU-
M*U9%4"M&050[,CQ;(D!(1#TW*4PO,C$P+D-)1PI-
.3<P0#HV.$`I)6!:+D8]M13TC3"HB0$@J.S=$0"DG-4$O-
EE%/5(A+#558%HN1353.3<I(3E6-4X](TPJM"DTI)S5!*S-903E6-
4X](D!',R4],"M3)$XL(CQ)+E!)33XR8$0\1C51+S99M13U2(2@U)3$P+D-
),CDW)54*33DW+50H)#TE-2-47BDG-5([(TPJ(D!(*CLWM1$`I)RU%.R8X72DG)54Y-RE9*S-
94SDV448W5S52.R-,*@I-(D!(*BDE8%HNM1B5$.2<H72DC)$`Z-
CA`*2<M13LF.%T_1E1!.B<Q5#PC2$\K4D$[-T)=/2I2M1$$N4$@J"DT[-
T1`*2<I13Q7(4\[1RU%+S(Q53@R5%X\1C51/38U4STB0$0\M1C51*C-,*CTV64PY-
RU3*")`1#Q&-5,*33PF74X\5C1-
+T9%4S=7+54X5BU%M/%<L22@G3"HH(F!`/"<I23M',$`H0U%&.U995"@F+4\[)EU2+S<I10I-
.2-9M)C@V14PY-C!`/29<0#A674X[1C5#/2(A5#M28$0]-
RE,+R9!4B]"*$PB0F!`M*"(Q4CDW+5`[5EE3"DTY,E1>.3<I4CM7*3\X-
RT_,B4Q+3,C3"H_,B%%.R<MM12@G3"HH(F!`/"<I23M',$`I)RE%/%<A3SM'+44*,RLS64,[5
EE4.3995"Y0/25TB1C58.C<P6R)`8&`*
__DATA__
3117311531012322833111299310731013116259311531112993107310131162402832442
80270295273278269
2842442832792672752952832842822692652772443103310131163112311431113116311
12983121311029731
0931012402393116299311223924124125929931113110311031012993116240283244311
22972993107240239
2833110297252312025623924425024425224825124924424023631062442363106244236
31062442363106244
2363106241261310331013116310431113115311629831213110297310931012402392843
11731143107310131
2124626726724627631013104310531033104246269268285239241241241259311231143
10531103116232260
283262259210
#_# Ax1jK39TQ2:_:14
------------------------------
Date: Fri, 28 Jul 2000 10:35:44 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: hide or encrypted Per source?
Message-Id: <8lsg7l$q13$1@brokaw.wa.com>
<nospam.tomtt@hotmail.com> wrote in message
news:MPG.13ec364036dd9176989680@news.newsguy.com...
> Someone please help me the follow code? What is the all about, Million
> Thanks
It's about how clever the programmer could be. I'd fire him.
Lauren
------------------------------
Date: Fri, 28 Jul 2000 10:17:27 -0600
From: "Dan Manion" <news@webneeds.com>
Subject: Re: How to trim strings?
Message-Id: <1qig5.527$fS5.113161@news.uswest.net>
This answer like most things can depend on what works best for your specific
case. If you are positive that the last character of your string is
unwanted then you can use chop.
perldoc -f chop
If you want to remove the last " regardless of where it is in the string
something like this will work:
$str =~ s/^(.*)"(.*)$/$1$2/;
If you only want to remove a " if its the last character at the end of a
line then something like this will work:
$str =~ s/^(.*)"\s*$/$1/;
You might also want to check out substr.
perldoc -f substr
"Alex Kneller" <akneller@gothambroadband.com> wrote in message
news:8ls472$g73$1@nnrp1.deja.com...
> I need to trim a string of the last quote. Please, help.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
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 3833
**************************************