Re: dynamically input fields to select from my table in the database

2008-10-02 Thread Aruna Goke
John W. Krahn wrote: Aruna Goke wrote: Thanks Rob, from the query.. if i statically substituted the array elements on both select and the condition sides, it worked. however, I want to give room to select @smswanted(ie. only requested columns) and the condition too will will be where $given

Re: dynamically input fields to select from my table in the database

2008-10-01 Thread Aruna Goke
Rob Dixon wrote: Goke Aruna wrote: Can someone be of help; I have the code below, what i wanted this code to do is to dynamically create fields to select and again to dynamically subtitute the value of the given fields. my sms content is the source of my data and my table definition is as

Re: Delete file if it contains x y or z

2008-09-06 Thread Aruna Goke
Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way of achieving this please? If however, it would

Re: Delete file if it contains x y or z

2008-09-06 Thread Aruna Goke
brian54321uk wrote: Aruna Goke wrote: Mr. Shawn H. Corey wrote: On Fri, 2008-09-05 at 19:09 +0100, brian54321uk wrote: HI again I would like to test a folder full of files, and if a file contains abc123blue or xyz357green then that file is to be deleted. What would be the best way

Re: what is the best GUI to display this result

2008-08-28 Thread Aruna Goke
zentara wrote: On Wed, 27 Aug 2008 19:35:46 +0100, [EMAIL PROTECTED] (Aruna Goke) wrote: however, I wanted to be able to scroll both horizontally and vertically so that i can see all the numbers printed. and which one is selected as winner on click. and ability to click and randomly

Re: what is the best GUI to display this result

2008-08-27 Thread Aruna Goke
zentara wrote: On Tue, 26 Aug 2008 18:09:58 +0100, [EMAIL PROTECTED] (Aruna Goke) wrote: I am writing a raffle draw promo using perl and i have the script as below. what i intend to achieve is to print all the numbers in the array to gui screen, clear the screen and display randomly selected

Re: what is the best GUI to display this result

2008-08-27 Thread Aruna Goke
zentara wrote: On Tue, 26 Aug 2008 18:09:58 +0100, [EMAIL PROTECTED] (Aruna Goke) wrote: ... __END__ zentara Thanks Zentara, I have edited the code as below.. however, I wanted to be able to scroll both horizontally and vertically so that i can see all

what is the best GUI to display this result

2008-08-26 Thread Aruna Goke
I am writing a raffle draw promo using perl and i have the script as below. what i intend to achieve is to print all the numbers in the array to gui screen, clear the screen and display randomly selected one as the winner. however, I have run my script in the cmd line .. it works fine but I

displaying my randomly selected numbers in a colorful interface.

2008-08-19 Thread Aruna Goke
dear all, i have arrays of number of size lets say 4000 i.e. 201000..2013999 now i want to do the following. first print all the numbers to a colorful console. be it wx, tk, or web based(this is what i am yet to know how i can i achieve) then pick a winning number from the range which

Re: Regular expression: How to determine wether entry is a number?

2008-07-29 Thread Aruna Goke
Jan-Henrik wrote: Dear Group, I'm new to Perl and I have a simple question: I ask for the entry of a number vie STDIN: #!/usr/bin/perl -w use strict; my $foo; print Enter number: ; $foo = STDIN; comp($foo);

Re: rand()

2008-07-28 Thread Aruna Goke
Bobby wrote: Hi all, How do I use the rand function to print out more than one random number for an array? In the example script below i have an array @nums with a list of numbers; how do i print out more than one random numbers from that list (@nums)? Thanks. #!/usr/bin/perl use strict;

Re: rand()

2008-07-28 Thread Aruna Goke
[EMAIL PROTECTED] wrote: On Mon, Jul 28, 2008 at 11:52 PM, Bobby [EMAIL PROTECTED] wrote: Peng, Could you give me an example code? I want to randomly select X numbers of numbers from the @nums list. For instance, i want to randomly select 3 numbers from @nums i.e. 1, 10005, 14. How

Re: how to read the last line of a file directly?

2008-07-06 Thread Aruna Goke
loody wrote: Dear all: I try to read the last line of a file directly instead of using while() or something else to read each line until undef bumped to me. If you know some build-in functions or another modules for me to use, please help me. appreciate your help, miloody use File::Tail

Re: I could not do it with matlab could perl do it?

2008-06-30 Thread Aruna Goke
Amit Saxena wrote: $str= 'GO:022 0.00312066574202497 9/2884 1/597 0.0023457 NAmitotic spindle elongation YBL084C ' (undef, undef, undef, $var1, $var2) = split (/\s*/, $str); On Wed, Jun 25, 2008 at 1:20 PM, fadlyemen [EMAIL PROTECTED] wrote: Hi All I could not do it with matlab

Re: How can I translate it back to @ sign.

2008-06-30 Thread Aruna Goke
Amit Saxena wrote: Try $email =~ s/[[:cntrl:]]/@/g; instead of $email =~ s/!/@/g; Infact try this in the entire file. Note :- This is on the assumption that there are no other control characters in the input file. On Fri, Jun 27, 2008 at 2:51 AM, Aruna Goke [EMAIL PROTECTED] mailto

accessing imap servers using perl script - LOGIN FAILURE: access denied

2008-06-30 Thread Aruna Goke
when i run the script below am getting LOGIN FAILURE: access denied, if I login with Net::IMAP::Simple and my username and password is correct. However, If I run same script on my local server, its working okay. If I use the Mail::IMAPClient module to do the login. I have the error below.

Re: AW: accessing imap servers using perl script - LOGIN FAILURE: access denied

2008-06-30 Thread Aruna Goke
Tobias Eichner wrote: Connecting to imap.mail.yahoo.com port 143 Connected to imap.mail.yahoo.com ... my $imapserver = 'imap.mail.yahoo.com'; my $user = 'testkingonet'; my $pass = '123456'; May it possible that Yahoo's SMTP server detects that it is being used by a script instead of by a

Re: How can I translate it back to @ sign.

2008-06-30 Thread Aruna Goke
that is also cumbersome if there are many lines and many control charcters. Regards, Amit Saxena On Mon, Jun 30, 2008 at 7:05 PM, Aruna Goke [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Amit Saxena wrote: Try $email =~ s/[[:cntrl:]]/@/g; instead of $email

Re: AW: AW: accessing imap servers using perl script - LOGIN FAILURE: access denied

2008-06-30 Thread Aruna Goke
Tobias Eichner wrote: what is smtp from what i raised so far? I need an imap access to the server not smtp. Sorry, I meant IMAP, my mistake. Anyway, solution could be the same... to exclude problems with your source code, try an alternative server that is working for sure. Tobias.

Re: Array problem

2008-06-30 Thread Aruna Goke
Beyza wrote: Hi, I would like to know how to insert escape character in front of special characters in an array. I have an array which has strings like; John's House Bla bla; etc, When I use them in an SQL query, perl gives an error. So, I need to put escape character for every special

How can I translate it back to @ sign.

2008-06-26 Thread Aruna Goke
hi, i have the this log from my sms gateway, however, the inverted exclamation mark was sent from the smsc as @. 2008-06-26 17:22:35 SMS request sender:+2342019122 request: 'maruna¡ontng.com,test,Love my test message' file answer: '' 2008-06-26 17:27:17 Receive SMS [SMSC:caxt] [SVC:] [ACT:]

Re: How can I translate it back to @ sign.

2008-06-26 Thread Aruna Goke
David Romero wrote: use a regular expression my $email = 'user!dominio.com'; $email =~ s/!/@/g; ###Result [EMAIL PROTECTED] http://www.troubleshooters.com/codecorn/littperl/perlreg.htm On Thu, Jun 26, 2008 at 1:35 PM, Aruna Goke [EMAIL PROTECTED] wrote: hi, i have the this log from my sms

Re: the file format does not write to the output file

2008-06-11 Thread Aruna Goke
John W. Krahn wrote: Aruna Goke wrote: If i run the below code it does not right to the voucher.rtf file. Can you guide on the best way to accomplish this. #!/usr/bin/perl use warnings; use strict; my ($pin, $pin1, $pin2, $val); format MINE= Voucher @ Voucher

the file format does not write to the output file

2008-06-10 Thread Aruna Goke
If i run the below code it does not right to the voucher.rtf file. Can you guide on the best way to accomplish this. #!/usr/bin/perl use warnings; use strict; my ($pin, $pin1, $pin2, $val); format MINE= Voucher @ Voucher @ Voucher @ $val,

Re: HoH problem representing a data structure.

2008-06-08 Thread Aruna Goke
Rodrick Brown wrote: I'm trying to fully understand references so I created a data structure to stores the output of users on my system who share home dirs. I use a HoH to represent this data set but its not working as expected. Conceptually I can visualize how the data should look but I cant

Re: HoH problem representing a data structure.

2008-06-08 Thread Aruna Goke
Rodrick Brown wrote: I'm trying to fully understand references so I created a data structure to stores the output of users on my system who share home dirs. I use a HoH to represent this data set but its not working as expected. Conceptually I can visualize how the data should look but I cant

Re: Looping through an anonymous array of arrays

2008-06-07 Thread Aruna Goke
Gunnar Hjalmarsson wrote: Rodrick Brown wrote: my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', [Hello] ]]; I have no problem returning single elements but how would one walk this list of elements with say a for loop? One way: my $level = 0; breakdown( $arrayRef ); sub breakdown {

Re: Multiline comment in Perl

2008-05-19 Thread Aruna Goke
Octavian Rasnita wrote: From: Rob Dixon [EMAIL PROTECTED] The documentation that John referred you to recommends =begin comment : =end Which may be a trifle awkward, but I'm sure there are worse things that happen to you in your day. It takes less than a second to type, and if you do

generating number ranges using rand function

2008-05-04 Thread Aruna Goke
I have worked on the code below and am able to generate the 15digit lenght required . However, what i wish to achieve is to make sure all the output comes out in 15 digits each. a sample of my output is as below. Can someone guide on how to make all come out in 15digits. Thank you. Goksie

Re: generating number ranges using rand function

2008-05-04 Thread Aruna Goke
John W. Krahn wrote: Aruna Goke wrote: I have worked on the code below and am able to generate the 15digit lenght required . However, what i wish to achieve is to make sure all the output comes out in 15 digits each. a sample of my output is as below. Can someone guide on how to make all

Re: Building/defining variables from an value in string

2008-04-23 Thread Aruna Goke
Li, Jialin wrote: use strict; my $string = 'field1,int,10#field2,string,abc'; my @values = split /#/,$string; my @vars; no strict 'refs'; for (@values) { my @tmp = split /,/; push @vars, $tmp[0]; ${$tmp[0]} = $tmp[2]; } for (@vars) { print $_, : , ${$_},

[Fwd: Re: Building/defining variables from an value in string]

2008-04-23 Thread Aruna Goke
] The following message is a courtesy copy of an article that has been posted to perl.beginners as well. AG == Aruna Goke [EMAIL PROTECTED] writes: AG my $string = field1,int,10#field2,string,abc#field3,varchar,abc123; AG my @vals = split(/#/,$string); AG my %h; AG my @arr; AG for (@vals

Re: regex variable matching when it's more than variable

2008-04-20 Thread Aruna Goke
Richard Lee wrote: say I have my $var1 = 'abcdefg'; my @array = ( 'abcdefg_3432', 'defg_333', 'abcdefg_' , 'abcdefg_a' ); Let's say I want to go through the array to see if $var1 exists and also to see if it followed by _ and then 4 digits (only first one should quailfy , abcdefg_3432 ) I

Re: Intermittent problems accessing MySQL data

2008-01-23 Thread Aruna Goke
Chris W wrote: I have inherited a site written in perl. Recently an intermittent problem has come up and when users log into the site, they end up seeing other users data. I personally can not reproduce the problem but it has happened enough that I am sure it is more than just a fluke. Does

Re: Intermittent problems accessing MySQL data

2008-01-23 Thread Aruna Goke
Chris W wrote: I have inherited a site written in perl. Recently an intermittent problem has come up and when users log into the site, they end up seeing other users data. I personally can not reproduce the problem but it has happened enough that I am sure it is more than just a fluke. Does

Re: Looping Dates.

2008-01-18 Thread Aruna Goke
[EMAIL PROTECTED] wrote: I am stuck here, I want to get list of dates in a certain range. Like: Start Date: 2007-01-03 to End Date: 2007-05-30 I am pointless here as what should I do in order to get all dates between start and end? Is there any for, foreach loop or other method? that will

Re: Using 'sendmail'

2008-01-03 Thread Aruna Goke
Gurpreet Singh wrote: Hi All, I am a beginner of perl and sorry if I am asking something silly. I have written the following code using some pre-made scripts on net. #!/usr/bin/perl l1:printEnter your E-Mail ID; my $from=STDIN; l2:printEnter receipt's E-Mail ID; my $to=STDIN;

Re: date addition-reg

2007-10-22 Thread Aruna Goke
Jeff Pang wrote: On 10/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: HI I need to get the $to as 18-10-2007 But it throws as 18.can u give the suggestion to get the same format? Thanks #!/usr/perl/bin $from=15-10-2007; $to=$from+3; print $from,\n; print $to; It looks like you

Re: squid log cleaning not fully executed

2007-10-21 Thread Aruna Goke
John W. Krahn wrote: Aruna Goke wrote: I put up a small script to delete old logs and at the same time rotating the logs. on my squid log directory ( I can use logrorate and unlink the logs, but I choose to test my ability to do that) however, with my code below, I can see delete the old logs

Re: squid log cleaning not fully executed

2007-10-21 Thread Aruna Goke
Dr.Ruud wrote: Aruna Goke schreef: actually the script is placed in the /var/log/squid directory and the unlink is actually deleting the old logs. however, the output of the system('squid' '-k', 'rotate') is access.log.0, store.log.0 and these were not included when the unlink is executed

squid log cleaning not fully executed

2007-10-20 Thread Aruna Goke
I put up a small script to delete old logs and at the same time rotating the logs. on my squid log directory ( I can use logrorate and unlink the logs, but I choose to test my ability to do that) however, with my code below, I can see delete the old logs, however, the output of the log the

Re: Regex to matching Parenthesis

2007-09-07 Thread Aruna Goke
Chris E. Rempola wrote: How would you match Parenthesis in Perl? - STRING - Received: from 10.143.205.68.abc.def.gh.com (10.205.143.238) - /STRING - I want to be able to grab the IP address in (10.205.143.238). Thanks in advance. #/usr/bin/perl use warnings; use strict; #use re 'debug';

Re: Regex to matching Parenthesis

2007-09-07 Thread Aruna Goke
John W. Krahn wrote: Aruna Goke wrote: Chris E. Rempola wrote: How would you match Parenthesis in Perl? - STRING - Received: from 10.143.205.68.abc.def.gh.com (10.205.143.238) - /STRING - I want to be able to grab the IP address in (10.205.143.238). Thanks in advance. #/usr/bin/perl use

working with regexp without escaping range symbol

2007-08-04 Thread Aruna Goke
hello all, How can I work with this kind on expression without escaping the range. #!/usr/bin/perl use warnings; use strict; use DateTime; my $ystd = DateTime-today-subtract(days = 1); my $mdy = $ystd-ymd('-'); #date format in 09-25-2007 my $dty = $ystd-mdy(''); #date in format 09252007 {

[Fwd: working with regexp without escaping range symbol]

2007-08-04 Thread Aruna Goke
I made a wrong substitution in the if(/$ystd/) instead of if(/$mdy/). Thanks Goksie Original Message Subject: working with regexp without escaping range symbol Date: Sun, 05 Aug 2007 05:39:09 +0100 From: Aruna Goke [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: beginners

the Database is not updated

2007-06-20 Thread Aruna Goke
Can someone put me thru this? when I run the script..it bring no error.. however, the table radacct is not updated. what have i done wrong. Goksie #!/usr/bin/perl use strict; use warnings; use DBI; my ($fn, @x); #define the file $fn = 'lost.csv'; $/ = \n; #prepare a database connection

the Database is not updated

2007-06-20 Thread Aruna Goke
hi all, Can someone put me thru this? when I run the script..it bring no error.. however, the table radacct is not updated. what have i done wrong. Goksie #!/usr/bin/perl use strict; use warnings; use DBI; my ($fn, @x); #define the file $fn = 'lost.csv'; $/ = \n; #prepare a database

Re: the Database is not updated

2007-06-20 Thread Aruna Goke
Chas Owens wrote: On 6/20/07, Paul Lalli [EMAIL PROTECTED] wrote: snip This might not be necessary for the RDMS you use, but I generally end my database-driven scripts with this block: END { if ($?) { print Exiting with error, rolling back data!\n; $dbh-rollback(); } else

Re: the Database is not updated

2007-06-20 Thread Aruna Goke
Chas Owens wrote: On 6/20/07, Paul Lalli [EMAIL PROTECTED] wrote: snip This might not be necessary for the RDMS you use, but I generally end my database-driven scripts with this block: END { if ($?) { print Exiting with error, rolling back data!\n; $dbh-rollback(); } else

Re: Removing decimal points

2007-06-09 Thread Aruna Goke
ash wrote: Hello there! I need to remove decimal points from numbers. For eg 1.23 or 1.77 would be just 1. Any suggestion is appreciated. Thank you. perldoc -f int int EXPR int Returns the integer portion of EXPR. If EXPR is omitted, uses $_. You should not use this