Re: what happens with $b = $b++?

2002-06-30 Thread Peter Scott
At 01:15 AM 7/1/02 -0400, Michael Turner wrote: >>>$b = $b++; >>The simple answer is *DON'T DO THAT*. :-) >>John > >Ok, :-) but I suggest that when 'use warnings' is true, this >construction should be warned. It fails silently. No, it's not failing. The behavior is undefined. Possibly the

Re: what happens with $b = $b++?

2002-06-30 Thread Michael Turner
>> $b = $b++; > The simple answer is *DON'T DO THAT*. :-) > John > -- > use Perl; > program > fulfillment Ok, :-) but I suggest that when 'use warnings' is true, this construction should be warned. It fails silently. Thanks to everyone. /Michael -- To unsubscribe, e-mail: [EMAIL PROTECTE

RE: Check for integer -- More problems.

2002-06-30 Thread Timothy Johnson
Oops. That was my typo originally. The + must be escaped within a regex. So if you were going to do it that way, you should replace (+|-) with (\+|-). But the method you used with the character class below is easier to read, so if it was me I'd go with that one. -Original Message- Fr

perl dbi insertid

2002-06-30 Thread Donnie Jones
Heylo. I am using this command to get the latest value for the auto_increment field in the mysql database: $field_insertid = $sth->{'insertid'}; but, it is always returning a value of zero, eventhough the latest v

Re: Login script

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 02:15 , Robert Dohrenburg wrote: > Hi, > > I'm trying to log into a protected resource using a custom form instead of > the default browser login box. > > I found a shareware script called csPassword ( > http://www.cgiscript.net/site_apps.htm ) but the script is an o

Re: Check for integer -- More problems.

2002-06-30 Thread Donnie Jones
> > > ### > > # Here's my code for this instance > > # > > if( $insert_field[$i] =~ /^(+|-)?\d+$/ ) ### Line 161 > > { > > $sql .= qq{ > > $insert_field[$i] > > }; > I found what it should

Re: Check for integer -- More problems.

2002-06-30 Thread John W. Krahn
[Please, please, please, trim the text at the bottom of your posts. 100 lines removed] Donnie Jones wrote: > > I'm back...heh. I hope all this formats correctly for easy reading Did you read perlfaq4? I didn't think so. perldoc -q integer Found in /usr/lib/perl5/5.6.0/pod/perlfaq4.pod

Re: Check for integer -- More problems.

2002-06-30 Thread Donnie Jones
I'm back...heh. I hope all this formats correctly for easy reading ### # Here's my code for this instance # if( $insert_field[$i] =~ /^(+|-)?\d+$/ ) ### Line 161 { $sql .= qq{ $insert_field[$i]

Re: Obtaining a slice of unique values from an array

2002-06-30 Thread Jeff 'japhy' Pinyan
On Jun 30, Dan Fish said: >What is the most efficient (or at least AN efficient :-) way of obtaining a >slice from an array wherein the slice contains only unique values found in >the array? >if @array = (1,3,5,5,3,5,2,1) then @slice = (1,3,5,2) This is FAQ. perldoc -q unique Found in /u

Login script

2002-06-30 Thread Robert Dohrenburg
Hi, I'm trying to log into a protected resource using a custom form instead of the default browser login box. I found a shareware script called csPassword ( http://www.cgiscript.net/site_apps.htm ) but the script is an overkill for my needs. Is there a simple way to login into a protected resour

Re: what happens with $b = $b++?

2002-06-30 Thread Elias Assmann
On Sun, 30 Jun 2002, Michael Turner wrote: > > $ perl -Dt -le '$b=$b++' > > > > EXECUTING... > > > > (-e:0) enter > > (-e:0) nextstate > > (-e:1) gvsv(main::b) > > (-e:1) postinc > > (-e:1) gvsv(main::b) > > (-e:1) sassign > > (-e:1) leave > Now to go look up how you did that... especia

Re: About Perl OO Orthodoxy

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 12:33 , Felix Geerinckx wrote: > on Sun, 30 Jun 2002 16:57:23 GMT, Drieux wrote: > >> volks, > [...Some 180 lines snipped...] >> ciao >> drieux > > And your beginners question was? so as not to conflate the usual 'religious wars' about OO v. Proceduralism - forgive

Re: About Perl OO Orthodoxy

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 11:45 , Daniel Gardner wrote: > Sunday, June 30, 2002, 5:57:23 PM, drieux wrote: > > I don't know if it's just me, but I didn't really understand > what you're actually trying to achieve... [..] > This sounds straightforward: > > package FOO::BAR::BOB; > use base

Re: About Perl OO Orthodoxy

2002-06-30 Thread Felix Geerinckx
on Sun, 30 Jun 2002 16:57:23 GMT, Drieux wrote: > volks, [...Some 180 lines snipped...] > ciao > drieux And your beginners question was? -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: building perl with -D was Re: what happens with $b = $b++?

2002-06-30 Thread John W. Krahn
Drieux wrote: > > On Sunday, June 30, 2002, at 09:38 , Peter Scott wrote: > [..] > > > > $ perl -Dt -le '$b=$b++' > > > > EXECUTING... > > [..] > > vladimir: 53:] perl -Dt -le '$b=$b++' > Recompile perl with -DDEBUGGING to use -D switch > vladimir: 54:] > > why was it that we opted for or agai

Re: About Perl OO Orthodoxy

2002-06-30 Thread Daniel Gardner
Sunday, June 30, 2002, 5:57:23 PM, drieux wrote: I don't know if it's just me, but I didn't really understand what you're actually trying to achieve... > Ok, so let's start with the simples stuff, I'm not God's > brightest child - so I tend to try stuff, and argue with > myself about whether or

Re: building perl with -D was Re: what happens with $b = $b++?

2002-06-30 Thread Peter Scott
At 11:32 AM 6/30/02 -0700, drieux wrote: >On Sunday, June 30, 2002, at 09:38 , Peter Scott wrote: >[..] >> >>$ perl -Dt -le '$b=$b++' >> >>EXECUTING... > >[..] > >vladimir: 53:] perl -Dt -le '$b=$b++' >Recompile perl with -DDEBUGGING to use -D switch >vladimir: 54:] > >why was it that we opted fo

Re: what happens with $b = $b++?

2002-06-30 Thread John W. Krahn
Michael Turner wrote: > > OK, here is a "real" beginners question, but interesting nonetheless: > > Sample code: > > $b = 1; > $b = $b++; > > Result: > > $b = 1 > > Which strikes me as a little surprising. Shouldn't the result be 2? What > is happening? The simple answer is *DON'T DO THAT*.

building perl with -D was Re: what happens with $b = $b++?

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 09:38 , Peter Scott wrote: [..] > > $ perl -Dt -le '$b=$b++' > > EXECUTING... [..] vladimir: 53:] perl -Dt -le '$b=$b++' Recompile perl with -DDEBUGGING to use -D switch vladimir: 54:] why was it that we opted for or against setting the DEBUGGING flag at build time

Re: what happens with $b = $b++?

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 10:32 , Connie Chan wrote: > This post is not talking about $b++, but I suddenly recalled a memory... > once upon > a time, a perl guy told me should avoid to use $a and $b as a var, because > we will > use this for sorting an numeric array ( i.e. $a<=>$b )... and..

Re: command line argument

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 10:14 , Ankit Gupta wrote: [..] > I was trying the following through command line > > c:\> perl abc.pl folder1\folder2 folder3\folder4 > > but in script I am just able to get folder1\folder2 where as I need both > folder1\folder2 and folder3\folder4 separately i

Re: what happens with $b = $b++?

2002-06-30 Thread Michael Turner
> $ perl -Dt -le '$b=$b++' > > EXECUTING... > > (-e:0) enter > (-e:0) nextstate > (-e:1) gvsv(main::b) > (-e:1) postinc > (-e:1) gvsv(main::b) > (-e:1) sassign > (-e:1) leave > > What I think this means is, "Take the current value of $b, save it as > the result of the expression. Incremen

Re: How to check if a string is a valid english word?

2002-06-30 Thread drieux
On Sunday, June 30, 2002, at 10:01 , bob ackerman wrote: [..] >> My complements on these two references. > > speaking of which - hard to break an old habit - eh? > my 'compliments' to the chef. [..] technically I am Ideologically Orthodox - in that I bring the completeness to the set - in that t

Re: what happens with $b = $b++?

2002-06-30 Thread Connie Chan
This post is not talking about $b++, but I suddenly recalled a memory... once upon a time, a perl guy told me should avoid to use $a and $b as a var, because we will use this for sorting an numeric array ( i.e. $a<=>$b )... and.. that's all. =) Smiley Connie =) - Original Message - Fro

command line argument

2002-06-30 Thread Ankit Gupta
Hello Everyone, I was trying the following through command line c:\> perl abc.pl folder1\folder2 folder3\folder4 but in script I am just able to get folder1\folder2 where as I need both folder1\folder2 and folder3\folder4 separately in different variables. Is there any method to achieve

Re: How to check if a string is a valid english word?

2002-06-30 Thread bob ackerman
On Sunday, June 30, 2002, at 08:37 AM, drieux wrote: > > On Saturday, June 29, 2002, at 11:07 , George Georgalis wrote: > >> Huh? Why not look it up in a dictionary? ... oh I guess you said that to >> :) > > part of the problem is that there are many > dictionary routines that would consider >

About Perl OO Orthodoxy

2002-06-30 Thread drieux
volks, Ok, so let's start with the simples stuff, I'm not God's brightest child - so I tend to try stuff, and argue with myself about whether or not a thing makes sense. Here is the basic problem. I need to have a base class FOO::BAR from which I will have a secondary class F

Re: what happens with $b = $b++?

2002-06-30 Thread Peter Scott
At 12:08 PM 6/30/02 -0400, Michael Turner wrote: >I appreciate everyone who wrote, but I remain confused. > >It seems to me that there is a weird short-circuit in the following code: > >$b = 1; >$b = $b++; >print $b; > >--> 1 >I expected "2" > >Whereas, > >$b = 1 >$b = ++$b; >print $b; > >--> 2 >

Object-Oriented DBMS

2002-06-30 Thread anthony
Hi, I know an RDBMS which we can use with perl, this RDBMS is MySQL. But i'm trying to find an OODBMS where we can use perl with. Any advice is appreciated Anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: what happens with $b = $b++?

2002-06-30 Thread Dave Tenen
re:"It seems that '$b = $b++;' is always a coding mistake. Nobody should use that syntax on purpose" True, True. I can't see why you would ever choose to use that to get $b to increment itself...just use "$b++" or "++$b" depending on the effect you want! >I appreciate everyone who wrote, but I

Re: what happens with $b = $b++?

2002-06-30 Thread Michael Turner
I appreciate everyone who wrote, but I remain confused. It seems to me that there is a weird short-circuit in the following code: $b = 1; $b = $b++; print $b; --> 1 I expected "2" Whereas, $b = 1 $b = ++$b; print $b; --> 2 As I expected. I translate the autoincrement ($b++) as $b + 1, but p

Re: How to check if a string is a valid english word?

2002-06-30 Thread drieux
On Saturday, June 29, 2002, at 11:07 , George Georgalis wrote: > Huh? Why not look it up in a dictionary? ... oh I guess you said that to > :) part of the problem is that there are many dictionary routines that would consider algorithm to be a legitimate word - irregardless of the co

Re: what happens with $b = $b++?

2002-06-30 Thread Dave Tenen
Try using a second variable to trace the values as it goes: $a = 0 $b = 1 $a = $b++ print "$a=", $a, " $b=", $b $a = 0 $b = 1 $a = ++$b print "$a=", $a, " $b=", $b From the Perl 5 Programmer's Notebook, Jesse Feiler, Prentice Hall, 2000: When the autoincrement operator (++) is placed after th

Re: Posting Perl Questions - was Re: Advanced Users in The Beginn ers List

2002-06-30 Thread drieux
On Saturday, June 29, 2002, at 11:26 , Timothy Johnson wrote: [..] > For those of you using Outlook (you know who you are, that's right, you in > the red shirt), [..] actually there are a Lot of folks who have a lot of really good email application - and/or have even more interesting 'adult' sty

Re: what happens with $b = $b++?

2002-06-30 Thread Connie Chan
The case for $b = $b++ is actually $b = $b; $b = $b + 1; The case for $b = ++$b is $b = $b + 1; $b = $b ; It depends on where the ++ operation's sequency to run. For evaluate this, you can try : print $b++; print " $b" ; # Result is "1 2" print ++$b; print " $b" ; # Result is "2 2" Hope

Re: what happens with $b = $b++?

2002-06-30 Thread Michael Turner
> Michael> $b = 1; $b = $b++; > Michael> Result: > Michael> $b = 1 > > $b++ is synonymous with $b = $b + 1. So, your second statement reads: > > '$b = $b = $b + 1'. > > If you replace your code with: > > '$b = 1; $b++;' or '$b = 1; $b = $b + 1', you'll get more expected > behaviour.

Re: what happens with $b = $b++?

2002-06-30 Thread Chris Ball
> "Michael" == Michael Turner <[EMAIL PROTECTED]> writes: Michael> $b = 1; $b = $b++; Michael> Result: Michael> $b = 1 $b++ is synonymous with $b = $b + 1. So, your second statement reads: '$b = $b = $b + 1'. If you replace your code with: '$b = 1; $b++;' or '$b = 1; $b = $b

what happens with $b = $b++?

2002-06-30 Thread Michael Turner
OK, here is a "real" beginners question, but interesting nonetheless: Sample code: $b = 1; $b = $b++; Result: $b = 1 Which strikes me as a little surprising. Shouldn't the result be 2? What is happening? If you respond, please CC me. Many TIA /Michael Turner -- To unsubscribe, e-mail: [

Re: Obtaining a slice of unique values from an array

2002-06-30 Thread Felix Geerinckx
on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote: > What is the most efficient (or at least AN efficient :-) way of > obtaining a slice from an array wherein the slice contains only > unique values found in the array? See perldoc -q duplicate -- felix -- To unsubscribe, e-mail: [EMAI

Obtaining a slice of unique values from an array

2002-06-30 Thread Dan Fish
What is the most efficient (or at least AN efficient :-) way of obtaining a slice from an array wherein the slice contains only unique values found in the array? I.E. if @array = (1,3,5,5,3,5,2,1) then @slice = (1,3,5,2) Thanks, -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: Advanced Users in The Beginners List

2002-06-30 Thread Felix Geerinckx
on Sun, 30 Jun 2002 00:20:55 GMT, Ronnie Livingston wrote: > > ah I see, any recommendations? > This depends on your platform, of course. gives pointers to software for Unix, Windows and Mac. I am using Xnews on Win32. -- felix -- To unsubscribe, e-mail:

Re: How to check if a string is a valid english word?

2002-06-30 Thread George Georgalis
On Sat, Jun 29, 2002 at 02:47:01PM -0700, drieux wrote: > >On Saturday, June 29, 2002, at 02:31 , Ohad Ohad wrote: >[..] > >this is not really possible - since america is the land >that brought you words like > > unix > radar > sonar > IPO > >so they are not really good at