Re: perl script as binary

2003-08-19 Thread Sven Bentlage
Thanks for the tips to everyone.
 Can you turn the app into a web app?
Unluckily that would be even more difficult, I think.
I`m trying to write a small script / program to shutdown a linux box 
remotely.
My basic idea is a small perl script which logs in using ssh, executes 
shutdown  logs out and exits. Any ideas on how to accomplish this 
task otherwise would be very much appreciated.

Best regards,

Sven



On Thursday, August 14, 2003, at 02:09 PM, Jonathan E. Hogue wrote:

I've had some luck with perl2exe in the past. If I remember correctly,
you also have to deliver a couple of .dll's with the executable. Can 
you
turn the app into a web app? You might have more luck with that.
http://www.indigostar.com/perl2exe.htm

-Original Message-
From: Sven Bentlage [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 8:28 AM
To: [EMAIL PROTECTED]
Subject: perl script as binary
Hi everyone!

I`m looking for a way to compile a perl script into an executable
binary for a WIN2000 system (no(!) perl installed).
Is there a way to get this working?

Thanks for your help in advance

Sven

--
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]


cpan module for mail login and scanning

2003-08-19 Thread Alex
Hello cgi-people,

is there such a module that logs into a pop3 account, scans the
content / headers and sends pop3 commands?

the idea is to frequently log in into  my pop3 account and remove
spam-mail.

one pattern, that I found is the whole range of [EMAIL PROTECTED]
accounts in the recipient line... as soon as one of these mails
with this header is found it'd being deleted.

or maybe I'd use the simple telnet-module... but I'd need a pop3
command list...

any help is greatly appreciated.



 Alex  mailto:[EMAIL PROTECTED]


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



RE: cpan module for mail login and scanning

2003-08-19 Thread wiggins


On Tue, 19 Aug 2003 14:08:37 +0200, Alex [EMAIL PROTECTED] wrote:

 Hello cgi-people,
 
 is there such a module that logs into a pop3 account, scans the
 content / headers and sends pop3 commands?
 
 the idea is to frequently log in into  my pop3 account and remove
 spam-mail.
 
 one pattern, that I found is the whole range of [EMAIL PROTECTED]
 accounts in the recipient line... as soon as one of these mails
 with this header is found it'd being deleted.
 

You should have a look at the Mail::Box distribution. It handles many types of mail 
boxes (including remote POP3) very well and can have built in spam detection support 
using spamassassin. There is also a lighter weight Mail::POP3Client module, though I 
am not familar with its working so can't provide a rating.  Both are available from 
CPAN.

 or maybe I'd use the simple telnet-module... but I'd need a pop3
 command list...
 

I would avoid this if at all possible.

 any help is greatly appreciated.
 

HTH,

http://danconia.org

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



Mail Reading and Parsing

2003-08-19 Thread eliu
Hello everybody,

Im looking for some modules that may help me in a proyect where all I
have to do is to analyze all the emails (which supposedly are erronous
mails) and parse them.

So  I have to do different actions depending on if the mails are
returned because 
1. The recipient does not exists
2. the recipient has his mailbox full
3. Other erronous mails.

So im looking for a module that may help me in parsing the emails and if
there is one that can tell me what error is better yet.

Somebody knows a module in which i can relay on?

Thank you


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



RE: Mail Reading and Parsing

2003-08-19 Thread wiggins


On Tue, 19 Aug 2003 09:46:11 -0600, eliu [EMAIL PROTECTED] wrote:

 Hello everybody,
 
 Im looking for some modules that may help me in a proyect where all I
 have to do is to analyze all the emails (which supposedly are erronous
 mails) and parse them.
 
 So  I have to do different actions depending on if the mails are
 returned because 
 1. The recipient does not exists
 2. the recipient has his mailbox full
 3. Other erronous mails.
 
 So im looking for a module that may help me in parsing the emails and if
 there is one that can tell me what error is better yet.
 
 Somebody knows a module in which i can relay on?
 

There are numerous modules for parsing mail, though I don't know of any that will tell 
you whether a recipient has exceeded his quota, etc. as that is generally the work of 
an MTA not a parser.  You might start with the documentation for Mail::Box and 
MIME::Parser and see if they meet your needs. I have had success with both for mail 
parsing uses.

http://danconia.org

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



right click help please?

2003-08-19 Thread Catriona Wordsworth
Can anyone assist me with how to change the right click menu.  When someone right 
clicks the html page, the menu there gives the option to view source  I would still 
like to keep this there but have it password protected so that only I can view the 
source.

any ideas on this one??

thanks  regards

Cat


Re: right click help please?

2003-08-19 Thread Oliver Schnarchendorf
On Wed, 20 Aug 2003 14:38:52 +1000, Catriona Wordsworth wrote:
 When 
 someone right clicks the html page, the menu there gives the option 
 to view source  I would still like to keep this there but have it 
 password protected so that only I can view the source.
Cat,

a) This is an html question... but you asked it in a CGI forum.
b) HTML is an open format, and everyone can see your HTML just by downloading 
it with something else than a normal browser (If what you want would be possible), 
like curl, ftp, ...
c) It is not possible to change the right click menu of browsers. People tried 
to use JavaScript to popup a message along the lines of This code is copyrighted by 
..., but how I said: HTML is an open format. I for once would turn javascript off and 
see what you are trying to hide.

HTML being an open format allows you to learn from others, and others to learn 
from you.

thanks
/oliver/


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



disable back button

2003-08-19 Thread Catriona Wordsworth
Hi guys,

pretty simple stuff I hope, but can someone tell me how to disable the back button in 
my perl script?

thanks  regards

Cat


Re: Display realtime data As it changes in the databse - TK

2003-08-19 Thread Voodoo Raja
Sorry for not posting it in the first place.

Will this sub.. chew memory if I run it a number of times.. or does it 
overwrite it.

sub read {
print \nreading data;
$db = DBI-connect(DBI:mysql:$dbase:$hostname, $username, $password);
$query = $db-prepare(SELECT * FROM cash where f1 = '1002');
$query-execute;
$numrows = $query-rows;
while (@array = $query-fetchrow_array ) {
($field1, $field2, $field3, $field4, $field5, $field6, $field7, $field8, 
$field9, $field10,
$field11, $field12, $field13, $field14, $field15, $field16, $field17, 
$field18) = @array;}
$query-finish;
$db-disconnect;
print \nf1 is $field1;
$lasttrans = $field1;
$newtrans = ($lasttrans+1);
}

this is the exact sub where I feel that I am doing something wrong..
Should this leave memory occupied if I run this loop a number of times
What happans if I runn this a number of times...
I am sorry if I cant explain it anybetter.. I am trying my best to learn 
this. please take me as a very begginer..

Regards
Sam

From: Ramprasad A Padmanabhan [EMAIL PROTECTED]
To: [EMAIL PROTECTED], Samuel Shankar [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: Display realtime data As it changes in the databse - TK
Date: Tue, 19 Aug 2003 11:32:33 +0530
Samuel Shankar wrote:
Hi List

I was wandering if someone can help me out in displaying database data in 
a
TK window.
please wander a little more, on google if you are looking for readymade 
script

I have tried a number of ways but I am loosing memory eventually.. I vet 
all
my's are not really mine..

All I need to do is fetch from a database and display it In a GUI based
window.
Or some ones has got a a better ways to flush ..
Display real time database data without losing memory in perl TK

Best Regards
SAM


How can any one help if you dont post your code

Ram

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail

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


Re: memoizing a variable

2003-08-19 Thread Jenda Krynicky
From: John W. Krahn [EMAIL PROTECTED]
 Robert Citek wrote:
  I want a variable to be memoized, that is, keep the variable
  available only to the function and the value remembered across
  invocations.  So far, I have created two versions listed below, both
  of which work.  The first version prints a warning message
  'Variable $bar will not stay shared ...' which I would like to
  avoid by coding The Right Way(TM).  Also, I wonder if the second
  version is modular enough so that it can be put in a module and
  loaded.
  
  Is there a better way to memoize?
  
  --
  
  #!/usr/bin/perl -wl
  # version 1
  use strict
  
  sub foo {
my $bar=100;
sub bat {
  $bar++;
  return $bar;
}
return bat();
  }

The error says that the foo() and bat() will only share the same $bar 
during the first call to foo(). Basicaly you should not define named 
subroutines inside some code that may be executed several times.

{my $bar = 100;
  sub bat {
return ++$bar;
  }
}
is OK, but 

while ($x  5) {
  my $bar = 100;
  sub bat {
return ++$bar;
  } 
}

would not. Because each iteration of the loop, just like each 
invocation of the foo() subroutine creates a brand new variable, 
while the bar() still points to the first one.

  BEGIN {
  my $bar=100;
  sub foo {
$bar++;
return $bar;
  }
  }
 All you need to do is limit the scope of the
 variable so that only the sub can see it.
 
 { # limit scope of $bar
 my $bar = 100;
 sub foo { ++$bar }
 }

Yes, this is how it's written most often. The BEGIN{} block may be a 
good idea though, it ensures the $bar is set just after the 
subroutine is compiled. so even if you define your subroutines at the 
end of the source and call this particular subroutine somewhere 
above, the variable is set:

#!perl
print foo(),\n;
print foo(),\n;
{ # limit scope of $bar
 my $bar = 100;
 sub foo { ++$bar }
}
print foo(),\n;
print foo(),\n;

vs.

#!perl
print foo(),\n;
print foo(),\n;
BEGIN { # limit scope of $bar
 my $bar = 100;
 sub foo { ++$bar }
}
print foo(),\n;
print foo(),\n;

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


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



RE: Regular expression help

2003-08-19 Thread EUROSPACE SZARINDAR

Hi Rob, 


You are totally right your exemple (' data11 '' data12' 'data13') should
raise an error and this is normal. I will nethertheless look carefully for
the Text::CSV module.

 Thanks 

Michel




-Message d'origine-
De: Rob Anderson [mailto:[EMAIL PROTECTED]
Date: lundi 18 août 2003 17:34
À: [EMAIL PROTECTED]
Objet: Re: Regular expression help



Eurospace Szarindar [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]

Thanks you, it works fine. Could you explain me why have you added the \1 ?

Hi,

A quick breakdown...


/(['])(((''|)|[^'])*?)\1(\s|$)/g
 ^^
1  
  2
  ^^
  3


1) This is picking up either a single or double quote

2) This is scoping up any quotes pairs, and is being carefull not
   to match quotes on thier own.

3) In a regex \1, \2 etc.. will match the same sequence of characters
matched
   earlier in the same-numbered pair of parentheses, in this case, it means
   that were making sure the opening and closing quotes are the same by
mathching
   that same character as in part 1.

Explaining it like this has made me spot a problem. The regex you really
want is

m/(['])(((''|)|[^\1])*?)\1(\s|$)/g

This way our 'scoping up' part matches any paired quotes or anything other
than
our closing quote.


The following test data wouldn't have worked...

' data11 '' data12' 'data13'


I will have a look at Text::CSV


Please do, my mistake above shows you why you shouldn't reinvent this stuff
if you can
get away with it. :-)

Ta

Rob



Michel

-Message d'origine-
De: Rob Anderson [mailto:[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: Display realtime data As it changes in the databse - TK

2003-08-19 Thread Ramprasad A Padmanabhan
Voodoo Raja wrote:

Sorry for not posting it in the first place.

Will this sub.. chew memory if I run it a number of times.. or does it 
overwrite it.

sub read {
print \nreading data;
$db = DBI-connect(DBI:mysql:$dbase:$hostname, $username, $password);
$query = $db-prepare(SELECT * FROM cash where f1 = '1002');
$query-execute;
$numrows = $query-rows;
while (@array = $query-fetchrow_array ) {
($field1, $field2, $field3, $field4, $field5, $field6, $field7, 
$field8, $field9, $field10,
$field11, $field12, $field13, $field14, $field15, $field16, $field17, 
$field18) = @array;}
$query-finish;
$db-disconnect;
print \nf1 is $field1;
$lasttrans = $field1;
$newtrans = ($lasttrans+1);
}

this is the exact sub where I feel that I am doing something wrong..
Should this leave memory occupied if I run this loop a number of times
What happans if I runn this a number of times...
I am sorry if I cant explain it anybetter.. I am trying my best to 
learn this. please take me as a very begginer..

Regards
Sam

From: Ramprasad A Padmanabhan [EMAIL PROTECTED]
To: [EMAIL PROTECTED], Samuel Shankar [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: Display realtime data As it changes in the databse - TK
Date: Tue, 19 Aug 2003 11:32:33 +0530
Samuel Shankar wrote:

Hi List

I was wandering if someone can help me out in displaying database 
data in a
TK window.


please wander a little more, on google if you are looking for 
readymade script

I have tried a number of ways but I am loosing memory eventually.. I 
vet all
my's are not really mine..

All I need to do is fetch from a database and display it In a GUI based
window.
Or some ones has got a a better ways to flush ..
Display real time database data without losing memory in perl TK

Best Regards
SAM


How can any one help if you dont post your code

Ram

What you seem to be doing is not very clear.  Why are you running this loop
while (@array = $query-fetchrow_array ) {
($field1, $field2, $field3, $field4, $field5, $field6, $field7, $field8, 
$field9, $field10,
$field11, $field12, $field13, $field14, $field15, $field16, $field17, 
$field18) = @array;}

If you just want the last  transaction id  change the query
to select max($field1) from cash where $x = $y ;
This will give you the last transaction id directly

BTW 
1) Have you considered using an autoincrement field
2) Do not connect to the database in every function of yours .
Make one connection in the beginning and pass the handle to all functions.
3) And when you post a reply  to a newsgroup post your reply *at the 
bottom* avoid top posting

Ram





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


Dates

2003-08-19 Thread Support
Thanks to all those who replied.
I ended up doing some research myself and found a good date module at
http://search.cpan.org/author/STBEY/Date-Pcalc-1.2
for those who are interested in juggling dates. Its called Date::Pcalc
Cheers
Colin
---
www.rentmyplace.co.nz
The ultimate in that holiday spot away from the maddening crowd
Join as a member today its FREE
List your holiday accommodation for FREE


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 14/08/2003

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

function to encode/decode url

2003-08-19 Thread Ramprasad A Padmanabhan
I know there must be a function to encode/decode urls
I was searching the LWP documentation but couldnt find any
Can anyone tell me where I can find encoding functions like

encode([EMAIL PROTECTED]) == ram%40yahoo.com

and decode(ram%40yahoo.com) == [EMAIL PROTECTED]

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


Re: function to encode/decode url

2003-08-19 Thread Jenda Krynicky
From: Ramprasad A Padmanabhan [EMAIL PROTECTED]
 I know there must be a function to encode/decode urls
 I was searching the LWP documentation but couldnt find any
 
 Can anyone tell me where I can find encoding functions like
 
 encode([EMAIL PROTECTED]) == ram%40yahoo.com
 
 and decode(ram%40yahoo.com) == [EMAIL PROTECTED]

As usualy. See CPAN - http://search.cpan.org/

Eg. CGI::Enurl + CGI::Deurl

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


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



unexpected runtime error

2003-08-19 Thread Gary Stainburn
Hi folks,

I'm getting:

Use of uninitialized value in hash element at /home/gary/bin/svcimport line 
188, FIN line 4301.

when running my program, of which like 188 is:

  $addr4=$abbrevs{$addr4} if (defined $abbrevs{$addr4}); # expand 
abbreviations

Surely the 'if defined' should prevent this from happening by checking that it 
is in fact initialized.  BTW, I'm not getting it for every input line, but 
for a significant number.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


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



Re: unexpected runtime error

2003-08-19 Thread Gary Stainburn
On Tuesday 19 Aug 2003 12:25 pm, Gary Stainburn wrote:
 Hi folks,

 I'm getting:

 Use of uninitialized value in hash element at /home/gary/bin/svcimport line
 188, FIN line 4301.

 when running my program, of which like 188 is:

   $addr4=$abbrevs{$addr4} if (defined $abbrevs{$addr4}); # expand
 abbreviations

 Surely the 'if defined' should prevent this from happening by checking that
 it is in fact initialized.  BTW, I'm not getting it for every input line,
 but for a significant number.

I've sussed it, I hand an empty pair (''='') in the hash from when I was 
keying in the key/value pairs.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


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



Re: Display realtime data As it changes in the databse - TK

2003-08-19 Thread Gabriel Cooper
Ramprasad A Padmanabhan wrote:

Voodoo Raja wrote:

Sorry for not posting it in the first place.

Will this sub.. chew memory if I run it a number of times.. or does 
it overwrite it.

sub read {
print \nreading data;
$db = DBI-connect(DBI:mysql:$dbase:$hostname, $username, $password); 

as Ramprasad said, you should pass in your db connection if you use it 
in more than one function...

$query = $db-prepare(SELECT * FROM cash where f1 = '1002'); 

Generally speaking, if you're selecting  *  then you're doing 
something wrong. You should only select exactly what you want from a 
database rather than just give me it all and I'll figure it out later. 
Especially because--judging from the loop below--you don't appear to use 
anything in the db except the first field, but also because this method 
doesn't take into account changing database structure. Ramprasad 
suggested select max($field1) from cash where $x = $y  but keep in 
mind you should do this using placeholders where any user input is 
involved to protect yourself from SQL injection attacks. =]

$query-execute;
$numrows = $query-rows;
while (@array = $query-fetchrow_array ) {
($field1, $field2, $field3, $field4, $field5, $field6, $field7, 
$field8, $field9, $field10,
$field11, $field12, $field13, $field14, $field15, $field16, $field17, 
$field18) = @array;}
$query-finish;
$db-disconnect; 

Don't disconnect yourself from the database in the middle of a while 
loop that's iterating through database query results!
Move finish and disconnect out of the loop.

print \nf1 is $field1;
$lasttrans = $field1;
$newtrans = ($lasttrans+1);
}
[...]


What you seem to be doing is not very clear.  Why are you running this 
loop
while (@array = $query-fetchrow_array ) {
($field1, $field2, $field3, $field4, $field5, $field6, $field7, 
$field8, $field9, $field10,
$field11, $field12, $field13, $field14, $field15, $field16, $field17, 
$field18) = @array;}

If you just want the last  transaction id  change the query
to select max($field1) from cash where $x = $y ;
This will give you the last transaction id directly

BTW 1) Have you considered using an autoincrement field
2) Do not connect to the database in every function of yours .
Make one connection in the beginning and pass the handle to all 
functions.
3) And when you post a reply  to a newsgroup post your reply *at the 
bottom* avoid top posting

Ram







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


RE: Measure bandwidth for my site

2003-08-19 Thread Durick,James D.
I wanted to test the bandwidth for my website every 15 minutes (to verify my
ISP was getting me 1.5 like they say)and was wondering if there are any
modules that make the job easier.  Any help would be appreciated.
Currently, there are tools out there that do what I want but I wanted to
write my own and was wondering if anyone had any ideas.
tia

-Original Message-
From: Gabriel Cooper [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 9:01 AM
To: Voodoo Raja
Cc: [EMAIL PROTECTED]
Subject: Re: Display realtime data As it changes in the databse - TK



Ramprasad A Padmanabhan wrote:

 Voodoo Raja wrote:

 Sorry for not posting it in the first place.

 Will this sub.. chew memory if I run it a number of times.. or does
 it overwrite it.

 sub read {
 print \nreading data;
 $db = DBI-connect(DBI:mysql:$dbase:$hostname, $username, $password);

as Ramprasad said, you should pass in your db connection if you use it
in more than one function...


 $query = $db-prepare(SELECT * FROM cash where f1 = '1002');

Generally speaking, if you're selecting  *  then you're doing
something wrong. You should only select exactly what you want from a
database rather than just give me it all and I'll figure it out later.
Especially because--judging from the loop below--you don't appear to use
anything in the db except the first field, but also because this method
doesn't take into account changing database structure. Ramprasad
suggested select max($field1) from cash where $x = $y  but keep in
mind you should do this using placeholders where any user input is
involved to protect yourself from SQL injection attacks. =]


 $query-execute;
 $numrows = $query-rows;
 while (@array = $query-fetchrow_array ) {
 ($field1, $field2, $field3, $field4, $field5, $field6, $field7,
 $field8, $field9, $field10,
 $field11, $field12, $field13, $field14, $field15, $field16, $field17,
 $field18) = @array;}
 $query-finish;
 $db-disconnect;

Don't disconnect yourself from the database in the middle of a while
loop that's iterating through database query results!
Move finish and disconnect out of the loop.


 print \nf1 is $field1;
 $lasttrans = $field1;
 $newtrans = ($lasttrans+1);
 }

 [...]


 What you seem to be doing is not very clear.  Why are you running this
 loop
 while (@array = $query-fetchrow_array ) {
 ($field1, $field2, $field3, $field4, $field5, $field6, $field7,
 $field8, $field9, $field10,
 $field11, $field12, $field13, $field14, $field15, $field16, $field17,
 $field18) = @array;}

 If you just want the last  transaction id  change the query
 to select max($field1) from cash where $x = $y ;

 This will give you the last transaction id directly


 BTW 1) Have you considered using an autoincrement field
 2) Do not connect to the database in every function of yours .
 Make one connection in the beginning and pass the handle to all
 functions.
 3) And when you post a reply  to a newsgroup post your reply *at the
 bottom* avoid top posting

 Ram








--
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: unexpected runtime error

2003-08-19 Thread Hanson, Rob
 $addr4=$abbrevs{$addr4} if (defined $abbrevs{$addr4});

I think you might want to use exists instead of defined in this case, or
maybe both depending on what you are trying to do.

$addr4=$abbrevs{$addr4}
 if (exists $abbrevs{$addr4} and defined $abbrevs{$addr4});

Rob


-Original Message-
From: Gary Stainburn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2003 7:25 AM
To: [EMAIL PROTECTED]
Subject: unexpected runtime error


Hi folks,

I'm getting:

Use of uninitialized value in hash element at /home/gary/bin/svcimport line 
188, FIN line 4301.

when running my program, of which like 188 is:

  $addr4=$abbrevs{$addr4} if (defined $abbrevs{$addr4}); # expand 
abbreviations

Surely the 'if defined' should prevent this from happening by checking that
it 
is in fact initialized.  BTW, I'm not getting it for every input line, but 
for a significant number.
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


-- 
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: Measure bandwidth for my site

2003-08-19 Thread Dan Muey
Howdy,

When starting a new thread don't top post on another thread.

 I wanted to test the bandwidth for my website every 15 
 minutes (to verify my ISP was getting me 1.5 like they 
 say)and was wondering if there are any modules that make the 

That would depend on how you plan to measure the speed. Are you downloading 
a file and calulating the speed like bandwidth testing places do?

Are you keeping track of packets in a datatbase, interfacing a QOS system, etc?

The method you use to figure that will decide how you go about doing it with Perl.

 job easier.  Any help would be appreciated. Currently, there 
 are tools out there that do what I want but I wanted to write 
 my own and was wondering if anyone had any ideas. Tia\\

What tools are they? Maybe we can find a way to do what they do in Perl.

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



the File::Copy module

2003-08-19 Thread Saadat Saeed
I was just reading the File::Copy module. Now on a
pure Win32 environment will this work

copy(\\machine1\share\file1,\\machine2\share\file2);

Or should I do something else???

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: the File::Copy module

2003-08-19 Thread Jeff Westman
Try:

  use strict;
  use warnings;
  ...
  my $returnValue = 
copy(machine1\\share\\file1,machine2\\share\\file2);

  unless ($returnValue) warn Copy failed: $!;


(not tested)


-JW


--- Saadat Saeed [EMAIL PROTECTED] wrote:
 I was just reading the File::Copy module. Now on a
 pure Win32 environment will this work
 
 copy(\\machine1\share\file1,\\machine2\share\file2);
 
 Or should I do something else???
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: the File::Copy module

2003-08-19 Thread Dan Muey
 Try:
 
   use strict;
   use warnings;
   ...
   my $returnValue = 
 copy(machine1\\share\\file1,machine2\\share\\file2);
^ I think that quote will cause problems.

Have you tried single quotes also? That way you don't have to worry about 
properly escaping the \.

copy('\\machine1\share\file1','\\machine2\share\file2') or die Copy failed 
$!;

Just a thought

Dmuey

 
   unless ($returnValue) warn Copy failed: $!;
 
 
 (not tested)
 
 
 -JW
 
 
 --- Saadat Saeed [EMAIL PROTECTED] wrote:
  I was just reading the File::Copy module. Now on a
  pure Win32 environment will this work
  
  copy(\\machine1\share\file1,\\machine2\share\file2);
  
  Or should I do something else???
  
  __
  Do you Yahoo!?
  Yahoo! SiteBuilder - Free, easy-to-use web site design software 
  http://sitebuilder.yahoo.com
  
  --
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design software
 http://sitebuilder.yahoo.com
 
 -- 
 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: the File::Copy module

2003-08-19 Thread Jeff Westman

--- Dan Muey [EMAIL PROTECTED] wrote:
  Try:
  
use strict;
use warnings;
...
my $returnValue = 
  copy(machine1\\share\\file1,machine2\\share\\file2);
   ^ I think that quote will cause problems.
 
   Have you tried single quotes also? That way you don't have to worry about
 properly escaping the \.
 
   copy('\\machine1\share\file1','\\machine2\share\file2') or die Copy
 failed $!;
 
 Just a thought

That won't work if the write decides that file1 should be a variable
instead.  Just a thought :-/

 
 Dmuey
 

-JW

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



paypal module

2003-08-19 Thread awards
Hi,

I was curious if anyone have used Business-PayPal module ??
If so is it safe to use? I guess I have to use it under a secure connection?

Anthony



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



Re: the File::Copy module

2003-08-19 Thread Gabriel Cooper


Jeff Westman wrote:

Try:

 use strict;
 use warnings;
 ...
 my $returnValue = 
   copy(machine1\\share\\file1,machine2\\share\\file2);

you probably don't want that first quotation mark before copy.

 unless ($returnValue) warn Copy failed: $!;
 

you could do it in one step as:

copy(machine1\\share\\file1,machine2\\share\\file2) or warn Copy failed: $!;

(not tested)
 

ditto =]

-JW
 

 



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


multiple regex in if() staetment

2003-08-19 Thread Dan Muey
Howdy all:

I'm trying to figure out the best way to test a string agains a list of regexs like so:

my @regex = qw(qr(joe$) qr(^mama) qr([abc]));

 if($string does not match any of the regexs in @regex) {  }
So basically
if($string !~ [EMAIL PROTECTED]) { ... }

I suppose I could do a for() and set a value accordingly and then test against that in 
my if() statement.
I just figured theres a better way to do it than my initial idea.
my $matches;
for(@regex) { if($string =~ m/$_/) { $itmatches++; } }
if(!$itmatches) {  }

I could always just do

if($string !~ m/joe$|^mama|[abc]/) {  }

Just waondering if theres a way to use an actual array in the if statement

TIA

Dan

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



Re: multiple regex in if() staetment

2003-08-19 Thread Wiggins d'Anconia
Dan Muey wrote:
Howdy all:

I'm trying to figure out the best way to test a string agains a list of regexs like so:

my @regex = qw(qr(joe$) qr(^mama) qr([abc]));

 if($string does not match any of the regexs in @regex) {  }
So basically
if($string !~ [EMAIL PROTECTED]) { ... }
I suppose I could do a for() and set a value accordingly and then test against that in 
my if() statement.
I just figured theres a better way to do it than my initial idea.
my $matches;
for(@regex) { if($string =~ m/$_/) { $itmatches++; } }
if(!$itmatches) {  }
I could always just do

	if($string !~ m/joe$|^mama|[abc]/) {  }

Just waondering if theres a way to use an actual array in the if statement

Well there is always 'grep' or 'map'

perldoc -f grep

Remember that grep can take a block rather than a simple expression, but 
then you are really just talking about a special for loop

if (grep { $string =~ /$_/ } @regex) {
}
Or something similar...

http://danconia.org

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


RE: the File::Copy module

2003-08-19 Thread Dan Muey
 --- Dan Muey [EMAIL PROTECTED] wrote:
   Try:
   
 use strict;
 use warnings;
 ...
 my $returnValue = 
   
   copy(machine1\\share\\file1,machine2\\share\\file2);
  ^ I think that quote will cause problems.
  
  Have you tried single quotes also? That way you don't 
 have to worry 
  about properly escaping the \.
  
  copy('\\machine1\share\file1','\\machine2\share\file2') 
 or die Copy 
  failed $!;
  
  Just a thought
 
 That won't work if the write decides that file1 should be a 
 variable instead.  Just a thought :-/

Ok, in the example file1 wasn't a variable but if you dod want to do
\\machine1\share\$file

 copy(qq(\\machine1\share\$file),qq(\\mahine2\share\$file)) or ...

Would that cover all the bases?

DMuey

 
  
  Dmuey
  
 
 -JW
 
 __
 Do you Yahoo!?
 Yahoo! SiteBuilder - Free, easy-to-use web site design 
 software http://sitebuilder.yahoo.com
 
 -- 
 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: multiple regex in if() staetment

2003-08-19 Thread James Edward Gray II
On Tuesday, August 19, 2003, at 05:54  PM, Dan Muey wrote:

I'm trying to figure out the best way to test a string agains a list 
of regexs like so:

my @regex = qw(qr(joe$) qr(^mama) qr([abc]));
I see you already got your grep() answer, but...

There's definitely no reason to use that qw() operator and plenty not 
to:

my @regex = (qr(joe$), qr(^mama), qr([abc]));

James

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


Cron jobs and perl

2003-08-19 Thread Vema Venkata
Hi Dan 

The problem still persisits pls. help/suggest me what to do ?

When iam executing the xapipgm.pl it is getting executed properly but when iam trying 
to execute thru crontab
it is not 

xapipgm.pl
**
#!/bin/sh
  #myrun.shell
  xapipgm=srvtst26.pl
  pgrep -f $xapipgm  /dev/null
  # runrc=$?
  # echo Return Code is: $?
  if [ $? -eq 0 ]
  then
  set `pgrep -f $xapipgm `
  echo AHD XAPI Server ($xapipgm) Running with Process Id: $1 
 else 
  echo AHD XAPI Server is now Started Running on  
`date`.log/init/ahdxapi.init.$1$2$3.$4$5.log
  set `date '+%Y %m %d %H %M' `
  xapipgm=srvtst26.pl
 perl -w $xapipgm  log/init/ahdxapi.init.$1$2$3.$4$5.log 
2log/init/ahdxapi.init.$1$2$3.$4$5.err
  #perl -w $4$5log/init/ahdxapi.init
  fi
  
**


Cron tab settings are as follows

* * * * * . /home/paradigm/.profile; /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl  
/proj/ahd02/CAisd/site/mods/scripts/log/init/ahdxapi.init.log  21

_

Access permsissons Details

In the following path i have

/proj/ahd02/CAisd/site/mods/scripts-Xapipgm.pl
/proj/ahd02/CAisd/site/mods/scripts/log/init-ahdxapi.init.log
and the access permission for log folder is drwxr-xr-x and init folder is drwxr-xr-x.

And the log file name i.e (agdxapi.init.log) is -rwxrwxrwx




rgds
venkat

 
 


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