Re: Is item in array

2006-12-31 Thread Randal L. Schwartz
> "Mathew" == Mathew Snyder <[EMAIL PROTECTED]> writes: Mathew> Is there an easy way to determine if an item is in an array without iterating Mathew> through the array and comparing each element to the item in question? It's a *really* good idea if you're subscribed to this list to type "per

Re: What's being thrown away?

2006-12-31 Thread Mumia W.
On 12/31/2006 05:04 AM, Mathew Snyder wrote: In the following snippet of code I'm getting the "useless use of a private variable in a void context" error. It is at line 64 which is the closing brace for the for loop. for ($count; [...] It's here, in the first instance of $count. $Count is nei

Re: regex substitution question

2006-12-31 Thread Mathew Snyder
John W. Krahn wrote: > Mathew Snyder wrote: >> A script I've been working on will provide time spent on a work ticket in >> H:MM >> format. However, if the MM section is less than 10 it only shows as H:M so I >> need to append a 0 to it. So, for instance, if the output looks like this >> 9:7 I

Re: regex substitution question

2006-12-31 Thread John W. Krahn
Mathew Snyder wrote: > A script I've been working on will provide time spent on a work ticket in H:MM > format. However, if the MM section is less than 10 it only shows as H:M so I > need to append a 0 to it. So, for instance, if the output looks like this > 9:7 I > need to append the 0 to the 7

regex substitution question

2006-12-31 Thread Mathew Snyder
A script I've been working on will provide time spent on a work ticket in H:MM format. However, if the MM section is less than 10 it only shows as H:M so I need to append a 0 to it. So, for instance, if the output looks like this 9:7 I need to append the 0 to the 7 making it 9:07. The output is

Re: What's being thrown away?

2006-12-31 Thread John W. Krahn
Mathew Snyder wrote: > In the following snippet of code I'm getting the "useless use of a private > variable in a void context" error. It is at line 64 which is the closing > brace > for the for loop. > > for ($count; $count < 7; $count++) { ^^ $count is in a void context there. Eith

Re: Is item in array

2006-12-31 Thread Mathew Snyder
Dr.Ruud wrote: > Ken Foskey schreef: >> Mathew Snyder: > >>> Is there an easy way to determine if an item is in an array without >>> iterating through the array and comparing each element to the item >>> in question? >> Look up grep. > > That still involves iterating and comparing each element, b

Re: Is item in array

2006-12-31 Thread Dr.Ruud
Ken Foskey schreef: > Mathew Snyder: >> Is there an easy way to determine if an item is in an array without >> iterating through the array and comparing each element to the item >> in question? > > Look up grep. That still involves iterating and comparing each element, but now done (faster) by gr

Re: What's being thrown away?

2006-12-31 Thread Mathew Snyder
Nevermind. I replaced the for loop with a while loop and it eliminated the problem. Mathew Mathew Snyder wrote: > In the following snippet of code I'm getting the "useless use of a private > variable in a void context" error. It is at line 64 which is the closing > brace > for the for loop. >

What's being thrown away?

2006-12-31 Thread Mathew Snyder
In the following snippet of code I'm getting the "useless use of a private variable in a void context" error. It is at line 64 which is the closing brace for the for loop. for ($count; $count < 7; $count++) { if ($day == '01') { if (exists($months31{$month})){