Re: loop does select next line

2014-07-05 Thread Kent Fredric
=== > > I want to use "while" loop instead of "foreach" . I tried it but while > loop does not select 2nd line of . > "I tried it but while loop does not select 2nd line of ." Can you show us the code after you tried that? Why do you want to use a wh

loop does select next line

2014-07-05 Thread Sunita Pradhan
$c]\n"; $hash{W_c_start}++ if ($words[$c] =~ /^C.*/i); } } print "$_ :: $hash{$_}\n" foreach (keys %hash); = I want to use "while" loop instead of "foreach" . I tried it but

Re: Passing multiple select statements to MySQL

2014-02-20 Thread SSC_perl
On Feb 19, 2014, at 4:20 AM, Dr.Ruud wrote: > my $sth_4; > ... > (untested) Thanks for the code but I still get the same error: DBD::mysql::st execute failed: You have an error in your SQL syntax; - Long pause for trial and error -- Well with the help of the auth

Re: Passing multiple select statements to MySQL

2014-02-19 Thread Dr.Ruud
On 2014-02-18 02:27, SSC_perl wrote: I'm helping someone retrieve some info from a MySQL db and I'm having trouble sending multiple select statements with Perl. Here's a portion of the code: use SQL::SplitStatement; my $query_4 = "CREATE TEMPORARY TABLE `tem

Passing multiple select statements to MySQL

2014-02-17 Thread SSC_perl
I'm helping someone retrieve some info from a MySQL db and I'm having trouble sending multiple select statements with Perl. Here's a portion of the code: use SQL::SplitStatement; my $query_4 = "CREATE TEMPORARY TABLE `temp_ip` AS (SELECT `ip` FROM `ip_address

Re: Line-oriented socket I/O using select()

2013-01-14 Thread Vic Sage
at is one substantial package! POE looks like a pretty steep learning curve; however, it appears as if POE::Wheel::ReadWrite might be what is needed. I've never tried my hand at working with event loops - and I'd be interested to hear if there's a general consensus that this is much preferable to my old-school approach of just looping on a select().

RE: Line-oriented socket I/O using select()

2013-01-14 Thread Bob McConnell
> From: Vic Sage > > I'm writing a multiplexed TCP-based server that reads "\n"-terminated > strings from clients and does something with them. Since this is one process > with multiple client connections, it uses select() (or, actually, can_read > from >

Re: Line-oriented socket I/O using select()

2013-01-13 Thread Charles DeRykus
On Sun, Jan 13, 2013 at 3:03 PM, Vic Sage wrote: > I'm writing a multiplexed TCP-based server that reads "\n"-terminated strings > from clients and does something with them. Since this is one process with > multiple client connections, it uses select() (or, actua

Line-oriented socket I/O using select()

2013-01-13 Thread Vic Sage
I'm writing a multiplexed TCP-based server that reads "\n"-terminated strings from clients and does something with them. Since this is one process with multiple client connections, it uses select() (or, actually, can_read from IO::Select) to block until data has arrived from an

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-02 Thread Rajeev Prasad
can not say no to you. i am using CGI::Simple now. i will be moving over to mod_perl later. - Original Message - From: Randal L. Schwartz To: Rajeev Prasad Cc: "beginners@perl.org" Sent: Saturday, October 1, 2011 7:06 AM Subject: Re: How to get the multiselect sel

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Rob Dixon
On 01/10/2011 21:50, shawn wilson wrote: On Sep 30, 2011 12:59 PM, "Rob Dixon" wrote: On the contrary, I think you are missing a few brain cells yourself Shawn. Your friends at work may tolerate such obnoxious and juvenile language, otherwise they wouldn't be your friends, but the members of t

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Brandon McCaig
Shawn: On Sat, Oct 1, 2011 at 4:50 PM, shawn wilson wrote: > Also, the completely valid point was made that the validation > wouldn't effect browsers that don't support js. This generally > a moot point since 99% of the rest of a site won't work without > js anyway. That is only true of poorly c

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread shawn wilson
On Sep 30, 2011 12:59 PM, "Rob Dixon" wrote: > > On 30/09/2011 12:26, Shawn Wilson wrote: >> >> >> You validate data with js? Are you f*g crazy? So, you think that >> >> if I want to hand you bad data I'm actually going to use your form to do it? > > > On the contrary, I think you are missing

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Randal L. Schwartz
> "Rajeev" == Rajeev Prasad writes: Rajeev> I thought it would be overkill (RAM, CPU etc.) to use CGI.pm Rajeev> when all i need is to get values out of form-variables. but i Rajeev> am going to settle for CGI::Simple CGI.pm is optimized though with it's own version of the lazy loader. If

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Peter Scott
On Sat, 01 Oct 2011 01:00:47 -0700, Rajeev Prasad wrote: > I thought it would be overkill (RAM, CPU etc.) to use CGI.pm when all i > need is to get values out of form-variables. but i am going to settle > for CGI::Simple Do you have any figures on how the trivial use of RAM/CPU by CGI.pm impacts

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-10-01 Thread Rajeev Prasad
, 2011 10:50 PM Subject: Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module >>>>> "Rajeev" == Rajeev Prasad writes: Rajeev> without using CGI.pm Whenever someone says "without $BEST_WAY_TO_DO_IT", I'm seriou

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Brandon McCaig
On Fri, Sep 30, 2011 at 11:50 PM, Randal L. Schwartz wrote: > Whenever someone says "without $BEST_WAY_TO_DO_IT", I'm seriously > motivated to say "why not?  what is the restriction?". Well put, Randal. :D -- Brandon McCaig V zrna gur orfg jvgu jung V fnl. Vg qbrfa'

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Brandon McCaig
Rajeev: On Fri, Sep 30, 2011 at 11:26 PM, Rajeev Prasad wrote: > point of that email was not where validation should happen?? it > was sent to find a solution(sample code) to the problem of > collecting value of a multi. > > you missed the point, > many people miss the point - it is common.

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Randal L. Schwartz
> "Rajeev" == Rajeev Prasad writes: Rajeev> without using CGI.pm Whenever someone says "without $BEST_WAY_TO_DO_IT", I'm seriously motivated to say "why not? what is the restriction?". So, why not? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rajeev Prasad
son To: beginners@perl.org Sent: Friday, September 30, 2011 1:04 PM Subject: Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module On Fri, Sep 30, 2011 at 13:33, Rob Dixon wrote: > John, whether or not you meant it, you came over to me as criticising > Raj

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread John SJ Anderson
On Fri, Sep 30, 2011 at 13:33, Rob Dixon wrote: > John, whether or not you meant it, you came over to me as criticising > Rajeev for denouncing every reply to his question. But he said he was > talking to: > >> Mr. Shawn and all others who are etching to criticize ever, > > and his meaning is cle

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rob Dixon
On 30/09/2011 15:37, John SJ Anderson wrote: On Fri, Sep 30, 2011 at 10:19, Rajeev Prasad wrote: by the way, question was: how do you collect the value of a multiselect, without using CGI module. Octavian did answer that question; I'll do it again: John, whether or not you meant it, you c

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rob Dixon
On 30/09/2011 12:26, Shawn Wilson wrote: You validate data with js? Are you f*g crazy? So, you think that if I want to hand you bad data I'm actually going to use your form to do it? On the contrary, I think you are missing a few brain cells yourself Shawn. Your friends at work may tolerat

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread John SJ Anderson
On Fri, Sep 30, 2011 at 10:19, Rajeev Prasad wrote: > by the way, question was: how do you collect the value of a multiselect, > without using CGI module. Octavian did answer that question; I'll do it again: you collect the value of a multiselect by getting and parsing the value of the query st

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Rajeev Prasad
e.     thx. From: Shawn Wilson To: "beginners@perl.org" Sent: Friday, September 30, 2011 6:26 AM Subject: Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module Rajeev Prasad wrote: >Hi, >  >without using CGI.pm

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Shawn Wilson
Rajeev Prasad wrote: >Hi, >  >without using CGI.pm how can i collect the values of a multiselect >element? >  >say for e.g.: >  >< select name="hobbies" id="hobbies" multiple> >Reading Books >Writing Stories >Collecting Coins >Cr

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-30 Thread Shlomi Fish
ckage Size > Installed Size > Files > all220.1 kB 616.0 kB [list of files] > > > > From: Octavian Rasnita > To: Rajeev Prasad ; beginners@perl.org > Sent: Friday, September 30, 2011 12:43 AM > Subject: Re: How to get the multiselect select box or checkbox element v

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-29 Thread Rajeev Prasad
Rasnita To: Rajeev Prasad ; beginners@perl.org Sent: Friday, September 30, 2011 12:43 AM Subject: Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module From: "Rajeev Prasad" Hi, without using CGI.pm how can i collect the values of a multiselect ele

Re: How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-29 Thread Octavian Rasnita
From: "Rajeev Prasad" Hi, without using CGI.pm how can i collect the values of a multiselect element? say for e.g.: < select name="hobbies" id="hobbies" multiple> Reading Books Writing Stories Collecting Coins Cross Stitching Tenis Playing Cricket <

How to get the multiselect select box or checkbox element values WITHOUT using CGI module

2011-09-29 Thread Rajeev Prasad
Hi,   without using CGI.pm how can i collect the values of a multiselect element?   say for e.g.:   < select name="hobbies" id="hobbies" multiple> Reading Books Writing Stories Collecting Coins Cross Stitching Tenis Playing Cricket < /select>   when the form

Re: Select equivalent in perl

2011-04-09 Thread Tim Maher
l fo all my automation. So proud I did that. > > > > Quick question: I have been using "Select" function in shell to present > > menu to users. Do we have a "select" equivalent in perl? Yes we do! I uploaded a version to CPAN many years ago, which I (for one) use

Re: Select equivalent in perl

2011-04-07 Thread Alan Haggai Alavi
Hello Balaji, I have been using shell script for my admin work and recently decided to use perl fo all my automation. So proud I did that. Nice to know that you have decided to use Perl. Quick question: I have been using "Select" function in shell to present menu to users. Do

Re: Select equivalent in perl

2011-04-07 Thread Jim Gibson
On 4/7/11 Thu Apr 7, 2011 10:48 AM, "Balaji krishnan" scribbled: > Hi folks > > I have been using shell script for my admin work and recently decided to use > perl fo all my automation. So proud I did that. > > Quick question: I have been using "Select&quo

Select equivalent in perl

2011-04-07 Thread Balaji krishnan
Hi folks I have been using shell script for my admin work and recently decided to use perl fo all my automation. So proud I did that. Quick question: I have been using "Select" function in shell to present menu to users. Do we have a "select" equivalent in perl? Or if I hav

Re: prepare(SELECT ... FROM TABLE) error

2010-02-13 Thread Dr.Ruud
Jay Savage wrote: Dr.Ruud: Because $@ is a global, it is best practice to act on the return value of eval itself: [snip] $@ is also *guaranteed*--in the words of perlfunc--to be set correctly. I believe that historically this may not have been the case: $@ may have only been set on failure

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Jeff Peng
On Thu, Feb 11, 2010 at 2:03 AM, Jay Savage wrote: > > $@ is also *guaranteed*--in the words of perlfunc--to be set > correctly. I believe that historically this may not have been the > case: $@ may have only been set on failure and not flushed on success, > but in recent Perls it should be reliab

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Jay Savage
On Tue, Feb 9, 2010 at 8:05 PM, Dr.Ruud wrote: > Jay Savage wrote: > [snip] > Because $@ is a global, it is best practice to act on > the return value of eval itself: [snip] $@ is also *guaranteed*--in the words of perlfunc--to be set correctly. I believe that historically this may not have be

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Dr.Ruud
Jay Savage wrote: Wrap the call in an eval block. Then check $@ to see if there was a fatal error, which you can ignore if you want to or do something along the lines of: eval { my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable"); }; if ($@) {

Re: prepare(SELECT ... FROM TABLE) error

2010-02-09 Thread Jay Savage
On Wed, Feb 3, 2010 at 9:22 PM, Tony Esposito wrote: > This question has never been answered.  To out it another way, given the code > ... > >  foreach my $mytable (@mytables) { >  my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable"); >  # report error but move

Re: prepare(SELECT ... FROM TABLE) error

2010-02-05 Thread Dr.Ruud
Tony Esposito wrote: This question has never been answered. To out it another way, given the code ... foreach my $mytable (@mytables) { my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable"); # report error but move on to next table } how do I ignore the situation/e

Re: prepare(SELECT ... FROM TABLE) error

2010-02-03 Thread Tony Esposito
This question has never been answered.  To out it another way, given the code ...  foreach my $mytable (@mytables) {  my $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable");    # report error but move on to next table } how do I ignore the situation/error that DBI throws when

Re: prepare(SELECT ... FROM TABLE) error

2010-02-02 Thread 7
On Mon, Feb 1, 2010 at 1:40 PM, Tony Esposito wrote: > Is this the idea? I do not ever want to catch the error from the prepare > statement itsel > I thought you said the program fails if you don't catch the error? If so, and you want your program to continue executing, then you have to catch

Re: prepare(SELECT ... FROM TABLE) error

2010-02-01 Thread Tony Esposito
Also, if prepare fails, I want to continue processing -- hence the need to capture the error in my code and not have DBI::DBD throw and exception then stop all processing ... --- On Mon, 1/2/10, Tony Esposito wrote: From: Tony Esposito Subject: Re: prepare(SELECT ... FROM TABLE) error To

Re: prepare(SELECT ... FROM TABLE) error

2010-02-01 Thread Tony Esposito
Is this the idea? I do not ever want to catch the error from the prepare statement itself -- I want my code to catch and throw the error.  And I am using Perl 5.8 so I do not need the use 5.010; pragma   thx  use strict; use warnings; use 5.010;  eval { my $sth = $dbh->prepare(&quo

Re: prepare(SELECT ... FROM TABLE) error

2010-02-01 Thread 7
,$login > ,$passwd > ,{ RaiseError => 0 } > ); > ... > $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable"); # don't catch > $retCode = $sth->execute(); > if ($dbh->err) {

prepare(SELECT ... FROM TABLE) error

2010-02-01 Thread Tony Esposito
iseError => 0 }     ); ... $sth = $dbh->prepare("SELECT COUNT(*) FROM mytable");   # don't catch $retCode = $sth->execute(); if ($dbh->err) {   print "Table $table -- DOES NOT EXIST\n"; }  

Re: Oracle DBI::ODBC and SELECT FOR UPDATE

2009-12-26 Thread Uri Guttman
>>>>> "TE" == Tony Esposito writes: TE> Has anyone successfully used, in Oracle, a 'SELECT ... FOR UPDATE' TE> using the Perl DBI:: ODBC? i can't answer that, but that is far from a question for the perl beginner's list. please post this in

Oracle DBI::ODBC and SELECT FOR UPDATE

2009-12-26 Thread Tony Esposito
Has anyone successfully used, in Oracle, a 'SELECT ... FOR UPDATE' using the Perl DBI:: ODBC?

Re: LWP Select Options Count

2009-05-12 Thread Gunnar Hjalmarsson
Bobby wrote: I'm trying to use LWP to scape a website's content and count the number of options in a select dropdown box and ran into a bit of a stubling block. Below is the code I have so far but it's not getting the desired results for me, could someone help me look through th

LWP Select Options Count

2009-05-12 Thread Bobby
Hi, I'm trying to use LWP to scape a website's content and count the number of options in a select dropdown box and ran into a bit of a stubling block.  Below is the code I have so far but it's not getting the desired results for me, could someone help me look through the code a

Re: How can I select an item from a listbox?

2009-03-31 Thread Chas. Owens
On Tue, Mar 31, 2009 at 13:16, Thomas H. George wrote: > On Tue, Mar 31, 2009 at 12:17:24PM -0400, Chas. Owens wrote: >> On Tue, Mar 31, 2009 at 11:27, Thomas H. George wrote: >> > I have tried a dozen different ways but can't retrieve an item from a >> > list box.  With a cursor > left clicked >

Re: How can I select an item from a listbox?

2009-03-31 Thread Thomas H. George
On Tue, Mar 31, 2009 at 12:17:24PM -0400, Chas. Owens wrote: > On Tue, Mar 31, 2009 at 11:27, Thomas H. George wrote: > > I have tried a dozen different ways but can't retrieve an item from a > > list box.  With a cursor left clicked > > on the item it is highlighted (= active?) but > > code such

Re: How can I select an item from a listbox?

2009-03-31 Thread Chas. Owens
On Tue, Mar 31, 2009 at 11:27, Thomas H. George wrote: > I have tried a dozen different ways but can't retrieve an item from a > list box.  With a cursor on the item it is highlighted (= active?) but > code such as > > $selected = $lbox -> get('active'); > print $selected; > > prints the last item

How can I select an item from a listbox?

2009-03-31 Thread Thomas H. George
I have tried a dozen different ways but can't retrieve an item from a list box. With a cursor on the item it is highlighted (= active?) but code such as $selected = $lbox -> get('active'); print $selected; prints the last item in the list. What am I doing wrong? -- To unsubscribe, e-mail: be

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

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

2008-10-01 Thread John W. Krahn
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[0]...[6] wi

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: dynamically input fields to select from my table in the database

2008-09-28 Thread Rob Dixon
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 d

dynamically input fields to select from my table in the database

2008-09-28 Thread Goke Aruna
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 below: (Id int auto_increment primary

problem with module install about Shell::POSIX::Select

2008-07-29 Thread Jiancong
Hi all: When I install the “Shell-POSIX-Select” module into my system, I got the following error message from screen. After I searched on internet, I found any useful messages to resolve it. Could you tell me how to resolve it or where to find some useful messages. Thanks a lot

SELECT STATEMENT - with WHERE

2008-06-24 Thread jobst müller
hi there hello list first of all - this is slightly off - topic. but i need your helphere i want to do some db-requests via a phpMyadmin frontend. please advice - i am aware that this is slightly of topic but - i needhelp with a SELECT-STATEMENT here we go; the dump looks like this

select on file handle

2007-11-16 Thread ton de w
Hello List, Have some code I dont quite understand first line (appart from some harmless variable setting is: select((select(STDOUT), $| = 1)[0]); Could someone help with an explanation please? Will this work on unix and windows BTW? TIA Ton -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: select on file handle

2007-11-16 Thread John W . Krahn
On Friday 16 November 2007 00:24, ton de w wrote: > Hello List, Hello, > Have some code I dont quite understand > first line (appart from some harmless variable setting is: > select((select(STDOUT), $| = 1)[0]); > > Could someone help with an explanation please? perldoc -q f

Re: select on file handle

2007-11-16 Thread Jeff Pang
On Nov 16, 2007 4:24 PM, ton de w <[EMAIL PROTECTED]> wrote: > Hello List, > > Have some code I dont quite understand > first line (appart from some harmless variable setting is: > select((select(STDOUT), $| = 1)[0]); > select FH returns the before handler which had been

Re: erro with Select your continent

2007-06-25 Thread Rodrigo Tavares
Hello, The list continents not happen in my screen. I try to digit: Select your continent (or several nearby continents) [] 1 invalid items entered, try again Select your continent (or several nearby continents) [] Europe invalid items entered, try again Select your continent (or several nearby

Re: erro with Select your continent

2007-06-25 Thread Chas Owens
On 6/25/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote: snip Select your continent (or several nearby continents) [] Sorry! since you don't have any existing picks, you must make a geographic selection. snip There should be a list of continents before the []. Are you trying to ru

erro with Select your continent

2007-06-25 Thread Rodrigo Tavares
earby continent and country (you can pick several of each, separated by spaces, or none if you just want to keep your existing selections). Then, you will be presented with a list of URLs of CPAN mirrors in the countries you selected, along with previously selected URLs. Select some of those URLs, or

WWW::Mechanize, problem with select

2007-04-01 Thread marco zucchelli
Hi, I am trying to uise $mech-> select() to make a selection in a web form. The form looks like a frame with several choices that you can click. Once clicked the choiice is highlighted in blue and then you can submit the form by clicking on a submit button. From my understanding the sel

RE: select case or switch statement

2005-06-12 Thread Charles K. Clarkson
Omega -1911 wrote: : I am still trying to grasp using case statements... Since I am : new to this, I had a question as to the speed of using CASE. I : currently have a script that has 91 if/elsif/else statements in : total. Will switching to using CASE improve the execut

Re: select case or switch statement

2005-06-12 Thread Omega -1911
I am still trying to grasp using case statements...Since I am new to this, I had a question as to the speed of using CASE. I currently have a script that has 91 if/elsif/else statements in total. Will switching to using CASE improve the execution of the script? On 6/11/05, Chris Devers <[EMAIL PRO

Re: select case or switch statement

2005-06-11 Thread Chris Devers
On Sat, 11 Jun 2005, Jeff 'japhy' Pinyan wrote: > On Jun 11, Ron Smith said: > > > Does Perl have the equivalent of a case statement or a switch > > statement. I'm trying to avoid a bunch of "if-then" statements. > > I'm seeing posts regarding "use switch", but I want to make sure > > it's not a

Re: select case or switch statement

2005-06-11 Thread Jeff 'japhy' Pinyan
On Jun 11, Ron Smith said: Does Perl have the equivalent of a case statement or a switch statement. I'm trying to avoid a bunch of "if-then" statements. I'm seeing posts regarding "use switch", but I want to make sure it's not a deprecated practice. I'm using Perl -v 5.8.0. The Switch.pm mod

Re: select case or switch statement

2005-06-11 Thread Ron Smith
I used 'perldoc -f switch' and nothing came up. I've done what you suggested and I'm on my way. Thank you very much. R "Ing. Branislav Gerzo" <[EMAIL PROTECTED]> wrote: Ron Smith [RS], on Saturday, June 11, 2005 at 14:11 (-0700 (PDT)) has on mind: RS> Does Perl have the equivalent of a case st

Re: select case or switch statement

2005-06-11 Thread Ing. Branislav Gerzo
Ron Smith [RS], on Saturday, June 11, 2005 at 14:11 (-0700 (PDT)) has on mind: RS> Does Perl have the equivalent of a case statement or a switch RS> statement. I'm trying to avoid a bunch of "if-then" statements. RS> I'm seeing posts regarding "use switch", but I want to make sure RS> it's not a d

select case or switch statement

2005-06-11 Thread Ron Smith
Does Perl have the equivalent of a case statement or a switch statement. I'm trying to avoid a bunch of "if-then" statements. I'm seeing posts regarding "use switch", but I want to make sure it's not a deprecated practice. I'm using Perl -v 5.8.0. my $day; if ($day = "mon") { $num = 0; }

select system call

2005-05-16 Thread Gayatri
Dear Friends, I am facing one problem please let me know if anybody knows the solution. The problem is as follows use IO::Select; use IO::Socket; The variable $sock will be handling my socket id for TCP, AF_INET/PF_INET family and the code is as shown

Re: DBI - SELECT by Date

2005-05-05 Thread John Doe
gisters from 05/01/2005 to > 05/05/2005. How do I do that? > I´m trying SELECT * FROM table WHERE date BETWEEN $inicial AND $final; > and > SELECT * FROM table WHERE (date > $inicial) AND (date < $final); > But I just can´t get it done... Thanks in advance... See chapter 11.3

select the content of matching braces

2005-05-05 Thread baskaran
Dear sirs, How to select the content of the groups suppose the string \newcommand{\sumfun}{\sum_{i=1,2,\ldots}^{n}f(x)} if i use the command s/\\newcommand\{(.*?)\}\{(.*?)\}//g; I get the value 2nd group is "\sum_{i=1,2,\ldots" But my expected output is \sum_{i=1,2,\ldots}^{n}f(

DBI - SELECT by Date

2005-05-05 Thread Diogo Nunes de Oliveira
Hi all, I´m having quite a problem here... My script works with postgree. Now i want to get a result from a date range... But I just can´t get it done... Explaining... Let´s supose I want to get all registers from 05/01/2005 to 05/05/2005. How do I do that? I´m trying SELECT * FROM table WHERE

Re: select the content of matching braces

2005-05-05 Thread Peter Scott
On Thu, 05 May 2005 13:54:22 +0530, Baskaran wrote: > How to select the content of the groups suppose the string > > \newcommand{\sumfun}{\sum_{i=1,2,\ldots}^{n}f(x)} > > if i use the command > > s/\\newcommand\{(.*?)\}\{(.*?)\}//g; > > I get the value 2nd group is

select the content of matching braces

2005-05-05 Thread baskaran
Dear sirs, How to select the content of the groups suppose the string \newcommand{\sumfun}{\sum_{i=1,2,\ldots}^{n}f(x)} if i use the command s/\\newcommand\{(.*?)\}\{(.*?)\}//g; I get the value 2nd group is "\sum_{i=1,2,\ldots" But my expected output is \sum_{i=1,2,\ldots}^{n}f(

RE: using data return from DBI SELECT statement

2004-08-16 Thread Bob Showalter
Tim McGeary wrote: > This is probably a very newbie-type of question, but I have this code > which a question noted by the ** below. > [snip] ># join patrons to respective disciple default lists ># bib_databases >my $sth2 = $dbh->prepare("S

Re: using data return from DBI SELECT statement

2004-08-16 Thread Wiggins d Anconia
> This is probably a very newbie-type of question, but I have this code > which a question noted by the ** below. > > my $sth = $dbh->prepare("SELECT * FROM patrons WHERE patron_id=$patron_id"); > $sth -> execute(); > > # check to see if re

RE: using data return from DBI SELECT statement

2004-08-16 Thread Moon, John
This is probably a very newbie-type of question, but I have this code which a question noted by the ** below. my $sth = $dbh->prepare("SELECT * FROM patrons WHERE patron_id=$patron_id"); $sth -> execute(); # check to see if record is in database if

using data return from DBI SELECT statement

2004-08-16 Thread Tim McGeary
This is probably a very newbie-type of question, but I have this code which a question noted by the ** below. my $sth = $dbh->prepare("SELECT * FROM patrons WHERE patron_id=$patron_id"); $sth -> execute(); # check to see if record is in database if (my $ref = $sth-&

Re: Class to select/insert/delete/update

2004-06-24 Thread LRMK
valueArray) . ")"; $self->{dbh}->do($query); } like that you can also write a method for select which takes the tablename, a list of fields to query and the where cluse, and orderby clouse as arguments And a update method and list goes on You may also write methods for lockin

Re: Class to select/insert/delete/update

2004-06-24 Thread Wiggins d Anconia
> Hello, > > i'm trying to make a class to do select/insert/delete/update on a MySQL table (via DBI). > this is a snip of code: > You haven't really shown us a class, just a method... > sub query{ > my $self = shift; > my($sql) = @_; >

Class to select/insert/delete/update

2004-06-24 Thread Rod Za
Hello, i'm trying to make a class to do select/insert/delete/update on a MySQL table (via DBI). this is a snip of code: sub query{ my $self = shift; my($sql) = @_; my @result; my $sth = $self->{dbh}->prepare($sql) or return undef; if($sql

Re: question about select

2004-02-19 Thread Papo Napolitano
> Papo Napolitano wrote: > > >> On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: > >> > >> > Heh, sorry... I simplified the code... > >> > I'm still not posting the full source because it's like 15 files :( > >> > > >> > > >> > while (1) { > >> > Fork("Whatever"); > >> > sleep 60; > >> > } >

Re: question about select

2004-02-19 Thread david
Papo Napolitano wrote: >> On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: >> >> > Heh, sorry... I simplified the code... >> > I'm still not posting the full source because it's like 15 files :( >> > >> > >> > while (1) { >> > Fork("Whatever"); >> > sleep 60; >> > } >> >> The first time y

Re: question about select

2004-02-18 Thread R. Joseph Newton
Papo Napolitano wrote: > Hi! > > I'm using the "select undef, undef, undef, 60" trick to sleep for 60 > seconds. > But it seems to not work after I do a couple of forks like this: ... > Any clue as to what could be causing this behaviour? Yes. You are usin

Re: question about select

2004-02-18 Thread Papo Napolitano
> On Feb 18, 2004, at 3:50 PM, Papo Napolitano wrote: > > > Hi! > > > > I'm using the "select undef, undef, undef, 60" trick to sleep for 60 > > seconds. > > But it seems to not work after I do a couple of forks like this: > > > >

Re: question about select

2004-02-18 Thread James Edward Gray II
On Feb 18, 2004, at 3:50 PM, Papo Napolitano wrote: Hi! I'm using the "select undef, undef, undef, 60" trick to sleep for 60 seconds. But it seems to not work after I do a couple of forks like this: while (1) { Fork('sub1'); Fork('sub2'); Fork('

Re: question about select

2004-02-18 Thread Papo Napolitano
> On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: > > > Heh, sorry... I simplified the code... > > I'm still not posting the full source because it's like 15 files :( > > > > > > while (1) { > > Fork("Whatever"); > > sleep 60; > > } > > The first time you showed this loop, it had multiple

Re: question about select

2004-02-18 Thread James Edward Gray II
On Feb 18, 2004, at 4:45 PM, Papo Napolitano wrote: Heh, sorry... I simplified the code... I'm still not posting the full source because it's like 15 files :( while (1) { Fork("Whatever"); sleep 60; } The first time you showed this loop, it had multiple fork()s in it. Now it's just one. Whi

Re: question about select

2004-02-18 Thread Papo Napolitano
> On Feb 18, 2004, at 3:50 PM, Papo Napolitano wrote: > > > Hi! > > > > I'm using the "select undef, undef, undef, 60" trick to sleep for 60 > > seconds. > > But it seems to not work after I do a couple of forks like this: > > > >

Re: question about select

2004-02-18 Thread James Edward Gray II
On Feb 18, 2004, at 3:50 PM, Papo Napolitano wrote: Hi! I'm using the "select undef, undef, undef, 60" trick to sleep for 60 seconds. But it seems to not work after I do a couple of forks like this: while (1) { Fork('sub1'); Fork('sub2'); Fork('

question about select

2004-02-18 Thread Papo Napolitano
Hi! I'm using the "select undef, undef, undef, 60" trick to sleep for 60 seconds. But it seems to not work after I do a couple of forks like this: while (1) { Fork('sub1'); Fork('sub2'); Fork('sub3'); select undef, undef, undef, 60; } "F

Re: selecting select as an option was Re: first steps with perl, a log reader

2003-11-17 Thread drieux
On Sunday, Nov 16, 2003, at 21:22 US/Pacific, R. Joseph Newton wrote: drieux wrote: I on the other hand have had the unpleasantry of FORGETTING that I was whacking new code in that was doing a 'select'. So one solution is to make sure that IF you do a select that you put things back

Re: selecting select as an option was Re: first steps with perl, alog reader

2003-11-17 Thread R. Joseph Newton
Jeff 'japhy' Pinyan wrote: > On Nov 16, R. Joseph Newton said: > > >sometimes. The perfect setup for the great Perl anonymous block: > > > >{ > >$| = 1; > > do stuff that really needs to be autoflushed > >} # Get things back to normal > > I think you want a 'local' in front of that

  1   2   >