h2xs directory structure in perl-5.8.x?

2004-12-29 Thread Alex Daniloff
Hello Perl people,

Recently, upgrading to perl v5.8.5 I've noticed that h2xs lays out module
directory structure in a quite different way than before.
Prior to this I could create a module e.g. Data::Loader
h2xs -XA -n Data::Loader
And it would create directory Data, then subdirectory Loader with Loader.pm
module and other files.
The full path to the module looks like /Data/Loader/Loader.pm
If I want to create another module e.g. Data::Reader
h2xs would put it into /Data/Reader/Reader.pm
Which is logically correct.

How the same command produces directory Data-Loader with service files and 
subdirectory lib in which it creates subdirectory Data in which it creates
the module Loader.pm
The full path to the module looks like /Data-Loader/lib/Data/Loader.pm
For another module e.g. Data::Reader it will be
/Data-Reader/lib/Data/Reader.pm
Why? Makes no sense to me. What the hell is going on with h2xs?

Thank you in advance for any clues or practical help.

Alex

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Copying a hash-of-hashes

2004-12-29 Thread Peter Rabbitson
Hello List, 
To explain the problem I am having, I wrote a simple snipet that doesn't do 
anything meaningful other than illustrating the behaviour I want to avoid:

my %hoh = (
1 => {
a => 5, b => 5
},

2 => 5
   );


my @res = &RANDOMSUB;  #call a random subroutine

print "$hoh{1}{a}  $hoh{2} \n";


sub RANDOMSUB {
my %hohcopy = %hoh;

$hohcopy{1}{a} = 2;
$hohcopy{2} = 2;
}

>From my understanding since in the subroutine I am working with a local hash 
%hohcopy all the values assigned to it have no meaning in the main body. 
However the print produces 2, 5 instead of the desired 5, 5. As far as my 
understanding goes this is due to the fact that $hohcopy{1} holds a 
reference to $hoh{1} instead of recreating it's internal structure entirely 
from the root to the leaves while performing a copy. 

The question is whether there is an elegant way to produce a complete copy 
of a hash-of-hashes-of-hashes-...-of-hashes for internal subroutine purposes 
and make sure that all references will be translated properly as well, 
leaving the subroutine no ability to modify the main hash. 

Thank you.

Peter

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Trouble running a script with cron

2004-12-29 Thread Bob Showalter
Rafael Morales wrote:
> Hi list.
> 
> I need to put a script in cron, but this script needs exec some
> Oracle variables for work fine, these variables are: 
> export ORACLE_HOME=/oracle/app/product/9.2.0
> export ORACLE_SID=galdb
> export LD_LIBRARY_PATH=/oracle/app/product/9.2.0/lib32
> export NLS_LANG='MEXICAN SPANISH_MEXICO.WE8MSWIN1252'
> export NLS_NUMERIC_CHARACTERS='.,'
> 
> However when I try to exec these variables in the script (with
> "system" or "exec"), does not work well, this a part of my script: 
> 
> #!/usr/bin/perl
> use strict;
> 
> system "export ORACLE_HOME=/oracle/app/product/9.2.0";
> system "export ORACLE_SID=galdb";
> system "export LD_LIBRARY_PATH=/oracle/app/product/9.2.0/lib32";
> system "export NLS_LANG=\'MEXICAN SPANISH_MEXICO.WE8MSWIN1252\'";
> system "export NLS_NUMERIC_CHARACTERS=\'.,\'";

This should be written as:

  BEGIN {
 $ENV{ORACLE_HOME} = '/oracle/app/product.9.2.0';
 $ENV{ORACLE_SID} = 'galdb';
 ... and so on ...
  }

The BEGIN { } block is probably needed so the vars are set before the "use
DBD::Oracle" happens.

The system() approach won't work because it only changes the environment
variables in the child process; you need to set the %ENV hash instead.

(But you may want to consider setting the variables in the crontab instead
of here)

HTH

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Trouble running a script with cron

2004-12-29 Thread Rafael Morales
Hi list.

I need to put a script in cron, but this script needs exec some Oracle 
variables for work fine, these variables are:
export ORACLE_HOME=/oracle/app/product/9.2.0
export ORACLE_SID=galdb
export LD_LIBRARY_PATH=/oracle/app/product/9.2.0/lib32
export NLS_LANG='MEXICAN SPANISH_MEXICO.WE8MSWIN1252'
export NLS_NUMERIC_CHARACTERS='.,'

However when I try to exec these variables in the script (with "system" or 
"exec"), does not work well, this a part of my script:

#!/usr/bin/perl
use strict;

system "export ORACLE_HOME=/oracle/app/product/9.2.0";
system "export ORACLE_SID=galdb";
system "export LD_LIBRARY_PATH=/oracle/app/product/9.2.0/lib32";
system "export NLS_LANG=\'MEXICAN SPANISH_MEXICO.WE8MSWIN1252\'";
system "export NLS_NUMERIC_CHARACTERS=\'.,\'";

use DBI;
use DBD::Oracle qw(:ora_types);

If I run these script manually (without cron) works fine . 
The error message that I see when run with cron is this:

Can't load 
'/usr/local/lib/perl5/site_perl/5.8.2/sun4-solaris/auto/DBD/Oracle/Oracle.so' 
for module DBD::Oracle: ld.so.1: /usr/bin/perl: fatal: 
/oracle/app/product/9.2.0/lib/libclntsh.so.9.0: wrong ELF class: ELFCLASS64
at /usr/local/lib/perl5/5.8.2/sun4-solaris/DynaLoader.pm line 229. at 
/home/horus/SCRIPTS/./estadisticas.pl line 11
Compilation failed in require at /home/horus/SCRIPTS/./estadisticas.pl line 11.
BEGIN failed--compilation aborted at /home/horus/SCRIPTS/./estadisticas.pl line 
11.

Regards !!!
-- 
___
Get your free email from http://mymail.bsdmail.com

Powered by Outblaze

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread Dave Gray
On Wed, 29 Dec 2004 12:50:21 -0500, GMane Python
<[EMAIL PROTECTED]> wrote:
> while ( <> ) {

That isn't doing what you expect, which (I assume) is an infinite
loop. <> loops over @ARGV and attempts to open each arg as a file and
iterate over the lines in each. I suppose it is functionally a
somewhat infinite (heh) loop with no args, as it reads from STDIN
until EOF. Except that it won't do anything until it can read
something from STDIN.

You probably want while (1) { ... } The rest looks ok at first glance,
other than the variable declaration thing.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
It does not compile on Netware, but it's OK on Windows.  For Netware, I
copied from my Windows PC the perl/lib and perl/site directories to Netware
because Sockets::IO was not found.  Now, I get:

Missing $ on loop variable at sys:\perl\lib/strict.pm li
BEGIN failed--compilation aborted at sys:\perl\lib/IO/So
BEGIN failed--compilation aborted at pyhbclt.pl line 3.

Can anyone point me in a direction here with this error?

Another problem I had but resolved:  I thought the sleep was in
microseconds, not seconds.  It would work once then not again.  Then I
decided I had to test EVERYTHING.  Thanks to all those who helped.  For
anyone who wants to use PYTHONS ThreadedHeartBeatServer.py by Nicola Larosa
to monitor a Netware Server, the Perl port is here:

#!/usr/bin/perl
use IO::Socket::INET;
use Time::HiRes qw( time alarm sleep );

do
{
   my $MySocket=new IO::Socket::INET->new(Proto=>"udp",
   PeerPort=>43278,
   PeerAddr=>'localhost'
 ) or die "Can't make UDP socket: $@";
   $msg="PyHB";

   $MySocket->send($msg);
   sleep (5);
}
while (1==1);




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: CGI and variables? What´s the problem?

2004-12-29 Thread brian . barto
Should be as simple as:

use CGI;
$co = new CGI;

## Here I grab the info from the form field named "date"
## and assign it to the variable $data

my $data = $co->param('date');

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 29, 2004 2:14 PM
To: beginners@perl.org
Subject: CGI and variables? What´s the problem?


Hi guys... I´d like to ask you a question. Some of you might have
encountered something like this... I´m creating a web interface using CGI
library so that the user enter a data in the textfield, i put these values
into some variables and use them in the system... for example... I type
the new date and the script executes the date command with that value
typed in the textfield... but I just can´t get it done... If I give fixed
value to the variable, it works fine... but in the same script of the CGI,
it doesn´t...
Please, help me!

Thanks!


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




CGI and variables? What´s the problem?

2004-12-29 Thread diogo . senai
Hi guys... I´d like to ask you a question. Some of you might have
encountered something like this... I´m creating a web interface using CGI
library so that the user enter a data in the textfield, i put these values
into some variables and use them in the system... for example... I type
the new date and the script executes the date command with that value
typed in the textfield... but I just can´t get it done... If I give fixed
value to the variable, it works fine... but in the same script of the CGI,
it doesn´t...
Please, help me!

Thanks!


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
Yes, but I posted a wrong file.  This one doesn't work at all.  I have
another that seems to work, but doesn't register on my Python heartbeat
server.  It's posted as a reply to Dave just above.  Sorry about the wrong
file.

-Dave
"JupiterHost.Net" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> GMane Python wrote:
> > Thank you for the reply to my topic, not BASH wars, but does this look
> > correct?
> >
> >
> >
> > use IO::Socket;
> > use strict;
> > use Time::HiRes qw( time alarm sleep );
> >
> > $server_ip = 'localhost';
> > $server_port = 43278;
> > $microseconds = 5_000_000;
>
> You need to do
>
> my $server_ip ... etc with use strict;
>
> Did you even try it? or at least perl -c file.pl ?
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
I'm having a bit of trouble so far.  The code below is what I've found on
different web sites as being the functions I believe I need:

use IO::Socket;
use strict;
use Time::HiRes qw( time alarm sleep );

while ( <> ) {

my $message =
IO::Socket::INET->new(Proto=>"udp",PeerPort=>'43278',PeerAddr=>'127.0.0.1')
  or die "Can't make UDP socket: $@";
$message->send("PyHB");

sleep (5_000_000);
}

However, it doesn't register on my Python server like the Python script
does.  Any idea what I'm doing wrong?

Thanks
-Dave




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread JupiterHost.Net

GMane Python wrote:
Thank you for the reply to my topic, not BASH wars, but does this look
correct?

use IO::Socket;
use strict;
use Time::HiRes qw( time alarm sleep );
$server_ip = 'localhost';
$server_port = 43278;
$microseconds = 5_000_000;
You need to do
my $server_ip ... etc with use strict;
Did you even try it? or at least perl -c file.pl ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread GMane Python
Thank you for the reply to my topic, not BASH wars, but does this look
correct?



use IO::Socket;
use strict;
use Time::HiRes qw( time alarm sleep );

$server_ip = 'localhost';
$server_port = 43278;
$microseconds = 5_000_000;

while ( <> ) {

my $message =
IO::Socket::INET->new(Proto=>"udp",PeerPort=>$server_port,PeerAddr=>$server_
ip)
  or die "Can't make UDP socket: $@";
$message->send("PyHB!");

sleep ($microseconds);

}

-Dave

"Dave Gray" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > was wondering if there were a translation in PERL so I could have my
Netware
> > servers send heartbeats to the heartbeat server?
> >
> >   Title: PyHeartbeat - detecting inactive computers
> >   Submitter: Nicola Larosa
> >
> >   # Filename: HeartbeatClient.py
> >
> >   """Heartbeat client, sends out an UDP packet periodically"""
> >
> >   import socket, time
> >
> >   SERVER_IP = '127.0.0.1'; SERVER_PORT = 43278; BEAT_PERIOD = 5
> >
> >   print ('Sending heartbeat to IP %s , port %d\n'
> >   'press Ctrl-C to stop\n') % (SERVER_IP, SERVER_PORT)
> >   while True:
> >   hbSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
> >   hbSocket.sendto('PyHB', (SERVER_IP, SERVER_PORT))
> >   if __debug__: print 'Time: %s' % time.ctime()
> >   time.sleep(BEAT_PERIOD)
>
> Checkout Socket [1] and Time::HiRes [2], both of which should be
> installed already, depending on what version of perl you're working
> with. The rest should be fairly simple to translate by following the
> code examples. Let us know how that works out for you.
>
> [1] 
> [2] 
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: :Pcap Install test fail

2004-12-29 Thread Welsh, Ed
I found one other reference to this issue on google and the guy having the 
problem did exactly what
you did and forced the install.  He then had issues.  He thought it was related 
to network device
detection.  I'll have to go that route and hope to not have problems.  Thanks

We need some smart people to find the root cause of this issue.  I'm too dumb. 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 29, 2004 10:34 AM
To: beginners@perl.org
Subject: RE: :Pcap Install test fail

I recently installed Net::Pcap from the cpan shell and the test failed as well. 
I did a force install
and the install completed and it appears to be working fine. Not sure if will 
be any repercussions in
the future though.

-Original Message-
From: Welsh, Ed [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 29, 2004 11:23 AM
To: beginners@perl.org
Subject: Net::Pcap Install test fail


Environment:
Fedora Core 3
yum updated libpcap-0.8.3
tarball download of Net-Pcap.0.5
Perl 5.8.5


Problem:
Makefile.PL works fine and creates Makefile
make works
make install works
make test fails on 07-stats.t

Discussion:
The only error is "bad statistics".  Has anyone else seen this problem? 
 How can I further
troubleshoot the issue?





Ed Welsh




The information transmitted in this e-mail is intended only for the addressee 
and may contain
confidential and/or privileged material. 
Any interception, review, retransmission, dissemination, or other use of, or 
taking of any action upon
this information by persons or entities other than the intended recipient is 
prohibited by law and may
subject them to criminal or civil liability. If you received this communication 
in error, please
contact us immediately at 816.421.6611, and delete the communication from any 
computer or network
system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to create and use external modules with ActiveState Perl 5.8+?

2004-12-29 Thread Jonathan Paton
...
> 
> our @EXPORT qw($convex_pl);

This is supposed to be a list to array assignment, except that the
assignment operator "=" is missing.  Try:

our @EXPORT = qw($convex_pl);

...
> syntax error at sample.pm line 4, near "@EXPORT qw($convex_pl)"

This message tells you there was a syntax error, which means
the code you have is not valid perl.  The line number, and what it says
it is near helps pinpoint the problem.

> Compilation failed in require at test_sample_module.pl line 1.

This message tells you your script couldn't compile because the
module failed to load.

> BEGIN failed--compilation aborted at test_sample_module.pl line 1.

This message tells you the BEGIN block failed.  That is because
"use" is shorthand for:

BEGIN { require Module; import Module LIST; }


Hopefully, by carefully examining the error message you can avoid
having to ask.  Perhaps the example had a misprint.

Jonathan Paton

-- 
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: :Pcap Install test fail

2004-12-29 Thread brian . barto
I recently installed Net::Pcap from the cpan shell and the test failed as
well. I did a force install and the install completed and it appears to be
working fine. Not sure if will be any repercussions in the future though.

-Original Message-
From: Welsh, Ed [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 29, 2004 11:23 AM
To: beginners@perl.org
Subject: Net::Pcap Install test fail


Environment:
Fedora Core 3
yum updated libpcap-0.8.3
tarball download of Net-Pcap.0.5
Perl 5.8.5


Problem:
Makefile.PL works fine and creates Makefile
make works
make install works
make test fails on 07-stats.t

Discussion:
The only error is "bad statistics".  Has anyone else seen this
problem?  How can I further
troubleshoot the issue?





Ed Welsh




The information transmitted in this e-mail is intended only for the
addressee and may contain confidential and/or privileged material. 
Any interception, review, retransmission, dissemination, or other use of, or
taking of any action upon this information by persons or entities
other than the intended recipient is prohibited by law and may subject them
to criminal or civil liability. If you received this communication 
in error, please contact us immediately at 816.421.6611, and delete the
communication from any computer or network system.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




How to create and use external modules with ActiveState Perl 5.8+?

2004-12-29 Thread Siegfried Heintze
I'm trying to follow the example Larry Wall's "Programming Perl" book and it
is not working with ActiveState 5.8+.

 

Here is sample.pm:

package sample;

require Exporter;

our @ISA = ("Exporter");

our @EXPORT qw($convex_pl);

$convex_pl = "/cgi-shl/convex.pl";

1;

 

Here is test_sample_module.pl in the same directory:

use sample;

print $convex_pl;

 

 

I get a syntax error:

syntax error at sample.pm line 4, near "@EXPORT qw($convex_pl)"

Compilation failed in require at test_sample_module.pl line 1.

BEGIN failed--compilation aborted at test_sample_module.pl line 1.



RE: Password Encryption

2004-12-29 Thread Siegfried Heintze

What a coincidence! I was wondering about thy same thing. Will this work on
ActiveState Perl running WinXP2003 Server? I have Cygwin installed which
should give me a glibc, but don't think ActiveState knows about it.

How would I do this on my platform?
Thanks,
Siegfried

-Original Message-
From: Mike Blezien [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 29, 2004 8:00 AM
To: zentara
Cc: beginners@perl.org
Subject: Re: Password Encryption

Thx's works like a charm. :)

zentara wrote:
> On Tue, 28 Dec 2004 08:14:37 -0600, [EMAIL PROTECTED] (Mike
> Blezien) wrote:
> 
> 
>>Hello,
>>
>>Been trying to figure out how to encrypt a password w/Perl so it's uses
the same 
>>scheme used in a webmin control panel for password protecting directories.
It 
>>says it's the MD5 method, but I have tried serveral variations using the
MD5 and 
>>Digest::MD5 but can't seem to find the correct format. This is a sample of
a 
>>encyrpted password generated by the control panel: 
>>$1$03838433$k1ZFcLyZ13Q8tU.3WpK9o1
>>
>>Is there a Perl method to encrypt plain text password in this same manner
??
> 
> 
> #!/usr/bin/perl
> 
> print "Standard crypt output\n";
> print crypt("password","sa"), "\n";
> 
> #glibc's implementation  that takes  care of  this.  Since  perl on 
> # Linux uses glibc, you get this automagically. When the salt looks like
> # $1$, it will encrypt the password using MD5.  e.g. 
> 
> print "MD5 crypt output\n";
> print crypt("password","\$1\$thesalt\$"), "\n";
> 
> 
> 
> 
> 


-- 
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Net::Pcap Install test fail

2004-12-29 Thread Welsh, Ed
Environment:
Fedora Core 3
yum updated libpcap-0.8.3
tarball download of Net-Pcap.0.5
Perl 5.8.5


Problem:
Makefile.PL works fine and creates Makefile
make works
make install works
make test fails on 07-stats.t

Discussion:
The only error is "bad statistics".  Has anyone else seen this problem? 
 How can I further
troubleshoot the issue?





Ed Welsh




The information transmitted in this e-mail is intended only for the addressee 
and may contain confidential and/or privileged material. 
Any interception, review, retransmission, dissemination, or other use of, or 
taking of any action upon this information by persons or entities
other than the intended recipient is prohibited by law and may subject them to 
criminal or civil liability. If you received this communication 
in error, please contact us immediately at 816.421.6611, and delete the 
communication from any computer or network system.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Password Encryption

2004-12-29 Thread Mike Blezien
Thx's works like a charm. :)
zentara wrote:
On Tue, 28 Dec 2004 08:14:37 -0600, [EMAIL PROTECTED] (Mike
Blezien) wrote:

Hello,
Been trying to figure out how to encrypt a password w/Perl so it's uses the same 
scheme used in a webmin control panel for password protecting directories. It 
says it's the MD5 method, but I have tried serveral variations using the MD5 and 
Digest::MD5 but can't seem to find the correct format. This is a sample of a 
encyrpted password generated by the control panel: 
$1$03838433$k1ZFcLyZ13Q8tU.3WpK9o1

Is there a Perl method to encrypt plain text password in this same manner ??

#!/usr/bin/perl
print "Standard crypt output\n";
print crypt("password","sa"), "\n";
#glibc's implementation  that takes  care of  this.  Since  perl on 
# Linux uses glibc, you get this automagically. When the salt looks like
# $1$, it will encrypt the password using MD5.  e.g. 

print "MD5 crypt output\n";
print crypt("password","\$1\$thesalt\$"), "\n";



--
Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Moving Data from one table to another table

2004-12-29 Thread Chris Lyon
> -Original Message-
> From: Scott Pham [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 28, 2004 12:55 PM
> To: Perl Beginners List
> Cc: Christopher Lyon
> Subject: Re: Moving Data from one table to another table
> 
> Depending on what database platform you are using, you can easily do
> 
> "SELECT * into new_table from table;
> 

So, just the select * into will replace the entire select * from... and
then a insert into?
I can rip out the while statement and just do this select and the delete.

That might fix the problem. 


> 
> On Tue, 28 Dec 2004 15:50:41 -0500 (EST), Chris Devers
> <[EMAIL PROTECTED]> wrote:
> > On Tue, 28 Dec 2004, Chris Lyon wrote:
> >
> > > So, I am trying to move data from one sql table to another table
> > > called logs_archive. It seems that I am running into some problems
> > > with memory as I am moving this much data from one table to another.
> > > This is just syslog data but we need to archive it in some way. Can
> > > anybody give any advice? Code is below.
> >
> > You're archiving syslog data?
> >
> > Then why pump it into a database to begin with?
> >
> > Log data `bzip`s wonderfully well, you know...
> >
> > > $sth = $dbh->prepare( "select * from logs where ( timestamp <=
> > > '$start_date$start_time' )" );
> >
> > If you stub in values for $start_date and $start_time, what happens when
> > you run this statement directly to your database?
> >
> > You don't mention what database server you're running, but in the SQL
> > dialects I'm familiar with, '<=' isn't a valid operator I'm aware of.
> >
> > In any case, you don't really spell out what the problem is. Does this
> > code work, but run too slowly, or does it not work at all? What happens
> > when you run this script?
> >
> > --
> > Chris Devers
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >  
> >
> >



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Moving Data from one table to another table

2004-12-29 Thread Chris Lyon
> -Original Message-
> From: Chris Devers [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 28, 2004 12:51 PM
> To: Christopher Lyon
> Cc: Perl Beginners List
> Subject: Re: Moving Data from one table to another table
> 
> On Tue, 28 Dec 2004, Chris Lyon wrote:
> 
> > So, I am trying to move data from one sql table to another table
> > called logs_archive. It seems that I am running into some problems
> > with memory as I am moving this much data from one table to another.
> > This is just syslog data but we need to archive it in some way. Can
> > anybody give any advice? Code is below.
> 
> You're archiving syslog data?
> 
> Then why pump it into a database to begin with?
> 
> Log data `bzip`s wonderfully well, you know...

We have a couple of scripts that pull over the data in the DB to gather
stats look for certain things and we only need this data for a day or so.
Then it gets moved to other tables for reference for up to a week. Once the
week is over all the data gets moved to a file and the tables get hacked.

> 
> > $sth = $dbh->prepare( "select * from logs where ( timestamp <=
> > '$start_date$start_time' )" );
> 
> If you stub in values for $start_date and $start_time, what happens when
> you run this statement directly to your database?
> 

Runs just fine. When I vmstat while this is running the free memory goes
down and down until there is almost nothing left.

> You don't mention what database server you're running, but in the SQL
> dialects I'm familiar with, '<=' isn't a valid operator I'm aware of.
> 
> In any case, you don't really spell out what the problem is. Does this
> code work, but run too slowly, or does it not work at all? What happens
> when you run this script?
> 

MySQL is what we are running and the operator was something left over from
another script. 

As for what the real problem is: Resources and slowness is the main problem
and every so often the script won't complete.

> 
> 
> --
> Chris Devers



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Moving Data from one table to another table

2004-12-29 Thread Scott Pham
Depending on what database platform you are using, you can easily do

"SELECT * into new_table from table;


On Tue, 28 Dec 2004 15:50:41 -0500 (EST), Chris Devers
<[EMAIL PROTECTED]> wrote:
> On Tue, 28 Dec 2004, Chris Lyon wrote:
> 
> > So, I am trying to move data from one sql table to another table
> > called logs_archive. It seems that I am running into some problems
> > with memory as I am moving this much data from one table to another.
> > This is just syslog data but we need to archive it in some way. Can
> > anybody give any advice? Code is below.
> 
> You're archiving syslog data?
> 
> Then why pump it into a database to begin with?
> 
> Log data `bzip`s wonderfully well, you know...
> 
> > $sth = $dbh->prepare( "select * from logs where ( timestamp <=
> > '$start_date$start_time' )" );
> 
> If you stub in values for $start_date and $start_time, what happens when
> you run this statement directly to your database?
> 
> You don't mention what database server you're running, but in the SQL
> dialects I'm familiar with, '<=' isn't a valid operator I'm aware of.
> 
> In any case, you don't really spell out what the problem is. Does this
> code work, but run too slowly, or does it not work at all? What happens
> when you run this script?
> 
> --
> Chris Devers
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
> 
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to throw exceptions for perl cgi program?

2004-12-29 Thread Peter Scott
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Siegfried Heintze) writes:
>I'm buffering my html/javascript output in a large array of strings. This
>frees me to perform my computations independently of the order they appear
>in the output.
>
>However, I have a problem: Let us suppose I have an error from my database
>and I have not executed "print $q->header( ),start_html(-title =>
>$case_name);"; yet.
>
>Is there a way I can throw an exception in my function (that retrieves data
>from the database) and let the main program have an exception handler that
>will execute "print $q->header( ),start_html(-title => $case_name);" earlier
>than normal so I can print my error messages and abort?

Main program:

eval {
  # Save output in $page
};
if ($@) {
  print $q->header, start_html(-title => 'Error'),
p("Error: $@");
}
else {
  print $q->header, start_html(-title => $case_name);
  print $page;
}
 
-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Subscription

2004-12-29 Thread Thota Shireesh-A20599
I would like to subscribe to this daily email.
Please add my email [EMAIL PROTECTED]  
 
thanks
shireesh