[19752] in Perl-Users-Digest
Perl-Users Digest, Issue: 1947 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 17 14:10:31 2001
Date: Wed, 17 Oct 2001 11:10:12 -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: <1003342212-v10-i1947@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 17 Oct 2001 Volume: 10 Number: 1947
Today's topics:
Perl integration with Oracle Enterprise Manager? (John Menke)
Re: Perl integration with Oracle Enterprise Manager? <rereidy@indra.com>
Re: Perl->M$ SQL (Jacqui caren)
Re: perlsec + taint (perl misk)
Reading from a record <robert_loui@yahoo.com>
Re: Reading from a record <jeff@vpservices.com>
Re: Reading from a record <jeff@vpservices.com>
Re: Reading from a record <robert_loui@yahoo.com>
Running a .pl as a background. <news@scottbell.org>
Re: Server Push on Apache localhost? <arnuga@yahoo.com>
Re: String To List <jeff@vpservices.com>
Using a remote file with a Perl script (Marc Bissonnette)
Re: Using a remote file with a Perl script <Tassilo.Parseval@post.rwth-aachen.de>
watchit ? script (Stan Brown)
Re: Writing and reading encrypted string (password) <bart.lateur@skynet.be>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Oct 2001 06:41:16 -0700
From: jmenke@scsnet.csc.com (John Menke)
Subject: Perl integration with Oracle Enterprise Manager?
Message-Id: <3a2d73ac.0110170541.66dc717e@posting.google.com>
The Oracle documentation outlines a process of using OraTCL to enable
you to script responses to events generated by the Enterpise Manager
in TCL. Can this process be done with Perl? (Use Perl-DBI instead of
TCL) Or would I have to make a TCL wrapper and call my Perl script
from the wrapper.
thanks in advance to anyone
john
------------------------------
Date: Wed, 17 Oct 2001 09:19:11 -0600
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Perl integration with Oracle Enterprise Manager?
Message-Id: <3BCDA16F.12A1265D@indra.com>
John Menke wrote:
>
> The Oracle documentation outlines a process of using OraTCL to enable
> you to script responses to events generated by the Enterpise Manager
> in TCL. Can this process be done with Perl? (Use Perl-DBI instead of
> TCL) Or would I have to make a TCL wrapper and call my Perl script
> from the wrapper.
>
> thanks in advance to anyone
>
> john
Never tried it, and Oracle will only support OraTcl, but I think you
could do it by making a system() call to the Perl program.
In Tcl, is there a facility similar to Perl's Inline.pm? If there is,
you could do things the OraTcl way, and embedd your Perl into the Tcl
code.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Wed, 17 Oct 2001 14:38:06 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui caren)
Subject: Re: Perl->M$ SQL
Message-Id: <913D9C456JacquiCarenigcouk@195.8.69.73>
[posted and mailed]
bart.lateur@skynet.be (Bart Lateur) wrote in
<sngsotgium16skksiksk3t0152so1u3her@4ax.com>:
>Nuno wrote:
>
>>Hello, i am working that would connect to a M$ SQL Server and get data.
>>
>>Can anyone give me some help on this? (interface to use..etc..)
>
>DBI + DBD::ODBC
>
>See <http://dbi.symbolstone.org> and follow some links.
>
>Set up a system DSN using the ODBC control panel, and you can then
>connect from within Perl.
><http://tlowery.hypermart.net/perl_dbi_dbd_faq.html#DBDODBCAccess> shows
>what your code can look like. That example assumes no user name or
>password are necessary, and that the system DSN is called "Northwind".
>
One proviso MS ODBC drivers limit you to one query at a time.
try doing
my $id =1;
my $csr = $dbh->prepare('select title,Child from tbl where id = ?');
$csr->execute($id);
my (@recs,$title,$child);
while (($title,$child) = fetchrow_arrayref()) {
push @recs,{ID => $id, TITLE => $title};
last unless defined $child;
$id = $child;
# with crappy MS-ODBC driver (manager) you need
# a finish/prepare here.
$csr->execute($child);
}
$csr->finish();
As you can guess this totaly ruins any chances of
doing reusable cursors etc - a sort of MS go-slower
stripe.
We are looking as DBD::ADO to see if it has the same
go-slower-stripe...
Jacqui
------------------------------
Date: 17 Oct 2001 09:46:09 -0700
From: perlmisk@yahoo.co.uk (perl misk)
Subject: Re: perlsec + taint
Message-Id: <7fe42fcd.0110170846.4f582f2b@posting.google.com>
Thomas Bätzler <Thomas@Baetzler.de> wrote in message news:<3r78st8oltpjtnclibm3hldd4up05s68tq@4ax.com>...
> On 10 Oct 2001 01:33:13 -0700, perlmisk@yahoo.co.uk (perl misk) wrote:
>
> >sub get_hostname {
> [...]
>
> You could also try Sys::Hostname.
>
> HTH,
it works well on my linux box, but on 2 of the production servers I
have tried it Carps - remember, the one in a museum ;)
bash$ uname -a
SunOS picard 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-Enterprise
bash$ /opt/LWperl/bin/perl -v
This is perl, version 5.005_03 built for sun4-solaris
<SNIP>
bash$ ./sort_monitor_menu.pl
Uncaught exception from user code:
Cannot get host name of local machine at
/tmp/andrewm/Sort/Monitor/bin/sort_monitor_menu.pl line 55
Carp::croak('Cannot get host name of local machine') called at
/opt/LWperl/lib/5.00503/Sys/Hostname.pm line 107
Sys::Hostname::hostname() called at
/tmp/andrewm/Sort/Monitor/bin/sort_monitor_menu.pl line 55
bash$
bash$ env|egrep picard
_INIT_UTS_NODENAME=picard
should I set something in ENV to match picard?
------------------------------
Date: Wed, 17 Oct 2001 16:47:37 +0200
From: "Robert" <robert_loui@yahoo.com>
Subject: Reading from a record
Message-Id: <9qk4ft$mjs$1@newstoo.ericsson.se>
Hi all
I will write a small program that receives a PcRecord as an input and saves
the data to a variable.
This is the my Input :
$PcRecord = {
"Name.index" =>"My PC",
"Id.index" =>"PC Number",
"Location.index" =>"PC Location",
}
I want to do :
my $pcname = $PcRecord->{'Name'};
my $pcLocation = $PcRecord->{'Location'};
my $pcId = $PcRecord->{'Id'};
My problem is that the index in the left side of a record is changing each
time I am receiving a new record, and i dont know what would it be in the
next record. For example first time I could have Name.5, Id.5, Location.5
and next time may be Name.8, Id.8, Location.8. I don't know how could I save
the data of a record in to another variable when the key index is changing
all the times
Hope some body could help
Thanks allot Robert
------------------------------
Date: Wed, 17 Oct 2001 08:09:31 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Reading from a record
Message-Id: <3BCD9F2B.DABCAA88@vpservices.com>
Robert wrote:
>
> Hi all
> I will write a small program that receives a PcRecord as an input and saves
> the data to a variable.
>
> This is the my Input :
>
> $PcRecord = {
>
> "Name.index" =>"My PC",
> "Id.index" =>"PC Number",
> "Location.index" =>"PC Location",
> }
>
> I want to do :
>
> my $pcname = $PcRecord->{'Name'};
> my $pcLocation = $PcRecord->{'Location'};
> my $pcId = $PcRecord->{'Id'};
>
> My problem is that the index in the left side of a record is changing each
> time I am receiving a new record,
I'm not sure why you need to create those new variables rather than just
using the hash, but something like this should work:
my($pcname,$pcLocation,$pcId);
while( my($key,$value) = each %$PcRecord ) {
$pcname = $value if $key =~ /Name/;
$pcLocation = $value if $key =~ /Location/;
$pcId = $value if $key =~ /Id/;
}
--
Jeff
------------------------------
Date: Wed, 17 Oct 2001 08:20:22 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Reading from a record
Message-Id: <3BCDA1B6.D196D90@vpservices.com>
Jeff Zucker wrote:
>
> Robert wrote:
> >
> > Hi all
> > I will write a small program that receives a PcRecord as an input and saves
> > the data to a variable.
> >
> > This is the my Input :
> >
> > $PcRecord = {
> >
> > "Name.index" =>"My PC",
> > "Id.index" =>"PC Number",
> > "Location.index" =>"PC Location",
> > }
> >
> > I want to do :
> >
> > my $pcname = $PcRecord->{'Name'};
> > my $pcLocation = $PcRecord->{'Location'};
> > my $pcId = $PcRecord->{'Id'};
Or, if you know the index number each time, put it in a variable and get
the hash key with a string containing that variable:
my $pcname = $PcRecord->{"Name.$index"}
--
Jeff
------------------------------
Date: Wed, 17 Oct 2001 18:01:50 +0200
From: "Robert" <robert_loui@yahoo.com>
Subject: Re: Reading from a record
Message-Id: <9qk8r1$20a$1@newstoo.ericsson.se>
Hi Jeff,
Thanks to your reply i will do this way
/Robert
> I'm not sure why you need to create those new variables rather than just
> using the hash, but something like this should work:
>
> my($pcname,$pcLocation,$pcId);
> while( my($key,$value) = each %$PcRecord ) {
> $pcname = $value if $key =~ /Name/;
> $pcLocation = $value if $key =~ /Location/;
> $pcId = $value if $key =~ /Id/;
> }
>
> --
> Jeff
>
------------------------------
Date: Wed, 17 Oct 2001 17:59:20 +0100
From: "Scott Bell" <news@scottbell.org>
Subject: Running a .pl as a background.
Message-Id: <NIiz7.10202$nT1.1610816@news6-win.server.ntlworld.com>
Is it possible to make a perl script run as a background process? If so,
how?
~scott
------------------------------
Date: Wed, 17 Oct 2001 11:04:10 -0700
From: Arnuga <arnuga@yahoo.com>
Subject: Re: Server Push on Apache localhost?
Message-Id: <lohrst4s556196icoqeuovtdncot8d6agd@4ax.com>
That is supposed to be server-push?
looks like client-side js to me
If you wonna do real server-push technology in perl...
you've got ALOT of work to do. I'm not sure if there is anything
available on CPAN for this sorta thing.... but
<basic concept>
js or meta-tag reload every "?" seconds....
reload checks db (cached preferably) for new data and redraws the
screen
but! thats alot of reloads
if you want something *new* to show up, simply push it into cache, or
db
</basic_concept>
This would work for what your talking about *i think* but really...
is perl the write tool for this job? have you considered a java
applet? there are MANY available for this exact purpose
David S.
On Wed, 17 Oct 2001 12:11:57 +0200, "Web Wizards - PHP/PERL
Developers" <mh2@isis.co.za> wrote:
>Hi,
>
>I am working on a chat script, and am busy implementing a server push option
>into it.
>Basically..
>
>if ( $EnableServerPush eq "Yes" )
>{
> # turn output buffering off...
> $| = 1;
>
> # definition of server-push starting.
> print "$ENV{'SERVER_PROTOCOL'} 200 OK\n";
> print "$Server: $ENV{'SERVER_SOFTWARE'}\n";
> }
>
> print "Content-type: text/html\n\n";
> print "<html>\n";
> print "<head>";
> print "<title>$ProgName</title>\n";
> print "<meta HTTP-EQUIV=\"Pragma\" Content=\"no-cache\">\n";
> print "</head>";
>
> if ( $EnableServerPush )
>{
> print <<__Scroll__;
><SCRIPT>
>function scroll() {
> window.scrollTo(0,50000);
> setTimeout("scroll()",500);
>}
>setTimeout("scroll()",100);
></SCRIPT>
>__Scroll__
>
> # This code is for M$ IE.
> for($i=0;$i<=100;$i++){ print " "; }
> print "\n";
> }
>
>### follows an infinite loop outputting new msgs as they arrive ###
>
>Now, I cannot get this working on my apache localhost, is there anything I
>must set up to make Apache do server push?
>I took the method from another push chat, this one works across a virtual
>server on the web, but wont work either on my localhost, which is why i
>figured its a problem in my server setup rather than the code.
>
>Any ideas?
>
>Regards,
>Mark
>
>--------------------------------------------------------------
>Web Wizards - PHP/PERL Developers
>E-Mail: mh2 at isis.co.za
>--------------------------------------------------------------
>
------------------------------
Date: Wed, 17 Oct 2001 08:00:30 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: String To List
Message-Id: <3BCD9D0E.678EE5D4@vpservices.com>
Benjamin Goldberg wrote:
>
> ...
> if( $dbi is NOT MS Access ) {
> # most databases use % and _ for glob-type wildcards.
> # MSAccess uses * and ? for glob-type wildcards.
> $_->[1] =~ tr/*?/%_/ foreach @where;
> }
I'd advise anyone accessing access to use DBD::ODBC which totally
bypasses access' non-standard symbols and sticks with the standard
percent sign in the LIKE pattern and works fine on an access backend
without this kind of kludge.
> # I'm not sure what DBI::AnyData uses for LIKE... If the author of it
> # was smart, he'd have used File::Glob, in which case it's * and ?
> # so you would get rid of the above line.
DBD::AnyData's LIKE depends on SQL::Statement which uses standard
percent signs.
But as the author of both AnyData and the upcoming version of
SQL::Statement (and you're right about me not being smart :-) I would be
interested to know what you mean about File::Glob. Please email me off
list if its not relevant to the public.
--
Jeff
------------------------------
Date: Wed, 17 Oct 2001 17:28:05 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Using a remote file with a Perl script
Message-Id: <Xns913D88335F9AAdragnetinternalysisc@206.172.150.14>
Hi all;
Could someone point me in the right direction to learn how to use the
contents of a file on a remote server in a perl script?
Specifically, I was thinking of writing a CGI running on a client's server
that would first check with a remote server (mine) to verify that they are
a valid customer. While I know it's impossible to completely avoid people
ripping off one's perl code, I was thinking that either remote user
verification, or even putting a critical subroutine remotely may help stem
the possibility.
(Yes, I am aware that there are implications if my own server ever falls
down)
Suggestions are greatly appreciated.
--
----------------------------
Marc Bissonnette
InternAlysis
Intelligence in Internet Communications
http://www.internalysis.com
------------------------------
Date: Wed, 17 Oct 2001 19:46:20 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Using a remote file with a Perl script
Message-Id: <3BCDC3EC.2000307@post.rwth-aachen.de>
Marc Bissonnette wrote:
> Hi all;
>
> Could someone point me in the right direction to learn how to use the
> contents of a file on a remote server in a perl script?
What do you mean with 'use'? You mean like the use()-function of Perl?
>
> Specifically, I was thinking of writing a CGI running on a client's server
A CGI running on a client's server? I don't quite understand that.
[...]
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 17 Oct 2001 09:37:37 -0400
From: stanb@panix.com (Stan Brown)
Subject: watchit ? script
Message-Id: <9qk1j1$cm9$1@panix1.panix.com>
I remebre having seen somewhere, a perl script designed to watch over a
specific daemin, and restart it, when it dies.
Well I have a mcahine theat routed is dying on (under heavy load). Can
anyone point me to aosurce for this csript, so I don't have to reinvent the
wheel?
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin
------------------------------
Date: Wed, 17 Oct 2001 14:06:18 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Writing and reading encrypted string (password)
Message-Id: <7u3rst8uv92ls0qkjj1hc87fum2lj561es@4ax.com>
Lars Oeschey wrote:
>On Tue, 16 Oct 2001 14:47:17 GMT, Bart Lateur <bart.lateur@skynet.be>
>wrote:
>
>> Crypt::Blowfish
>> Crypt::OpenPGP
>> Crypt::BeoWulf
>> Crypt::DES
>> Crypt::GOST
>
>aren't those all (like the crypt() function) one-way encryptions? i.e.
>I can't get the cleartext back from the encrypted password?
Since their descriptions all contain the word "decrypt", I think not.
For example, for Crypt::Blowfish:
my $cipher = new Crypt::Blowfish $key;
my $ciphertext = $cipher->encrypt($plaintext);
my $cipher = new Crypt::Blowfish $key;
my $plaintext = $cipher->decrypt($ciphertext);
--
Bart.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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 V10 Issue 1947
***************************************