Hi,
I am not sure that I understand your problem.
In General if you want to check the existence of the key "user" in the first
hash, you can use the following
if ($dept and exists($dept->{user}){ }else{}
Hope that helps
Yaron Kahanovitch
- Original Message -
From: "Mathew Sny
That's the problem. 'user' isn't in the first hash. It's in the second hash.
The hash looks like $dept{customer}{user}. I need to skip $dept{customer} and
check for $dept{customer}{user}.
Mathew
Keep up with me and what I'm up to: http://theillien.blogspot.com
[EMAIL PROTECTED] wrote:
> Hi,
>
Hi again,
In that case can use the following:
if ($dept and exists($dept->{customer}{user}){ }else{}
Yaron Kahanovitch
- Original Message -
From: "Mathew Snyder" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: "Perl Beginners"
Sent: Sunday, May 13, 2007 10:22:53 AM (GMT+0200) Auto-
To make this even more tricky, if the user shows up in even one of the second
hashes the whole %$dept hash is affected.
We have $dept{customer}{user}
$dept{customer}{user1}
$dept{customer1}{user}
$dept{customer1{user1}
$dept{customer2}{user}
So, even though user2 i
Thanks, I found a simpler approach though. I set a variable to '1' and check it
in an if statement:
if ($check == 1) {
Perform steps
}else{
Perform other steps.
}
After I pass the hashes I need to use for "Perform steps" I set the variable to
'0' and then pass the next set of hash
yitzle schreef:
> John:
>> [m/a (?:black|grey|white) cat/]
>> Will match one of these: [...]
>> - "a cat" (please note two spaces)
>
> Correction: Will not match "a cat"
> That requires: m/a (?:black|grey|white)? cat/;
or /a (?:black|grey|white|) cat/;
(Yitzle, please note how I redacted th
Mathew Snyder wrote:
[EMAIL PROTECTED] wrote:
Mathew Snyder wrote:
A subroutine I'm working on takes two hash references. The hashes are each
actually a HoH.
timesheet(\%opsTotal, \%opsEnvTotal);
The problem I'm having is that I need to look past the first hash and into the
second for the
Rob Dixon wrote:
> Mathew Snyder wrote:
>>
>> [EMAIL PROTECTED] wrote:
>>>
>>> Mathew Snyder wrote:
A subroutine I'm working on takes two hash references. The hashes
are each
actually a HoH.
timesheet(\%opsTotal, \%opsEnvTotal);
The problem I'm having is t
On 5/13/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
snip
or /a (?:black|grey|white|) cat/;
snip
It is sad to say, but I had never thought of using a pipe at the end
to cause a submatch to be optional. That is a nifty solution. Too
much thinking inside the box for me, I guess. I would have said
On Sun, 2007-05-13 at 10:49 +0800, 小楊 wrote:
> Does anyone know the following syntax's meaning or usage?
>
> Can anyone help me to understand this syntax? Or if available, can anyone
> provide me some useful example to understand more?
>
> Thank you all that help me.
>
> The syntax is as follow:
My understanding of the problem:
You have a ref to a HoH and you need to find all of the first set of
keys that have a specific, but unspecified at coding time, second key
or value.
For key I would do something like this
my $key2 = func_to_get_key2();
for $key1 (grep { exists $store->{$key1}{$k
That's waaay over my head. The method I used works so I'll stick with that.
Thanks though. :)
Keep up with me and what I'm up to: http://theillien.blogspot.com
Chas Owens wrote:
> My understanding of the problem:
>
> You have a ref to a HoH and you need to find all of the first set of
>
Is it possible to use too many comments? I'm looking at a script I wrote and
think I may have made it less clear by trying to make it more clear.
--
Keep up with me and what I'm up to: http://theillien.blogspot.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [
Mathew Snyder 写道:
Is it possible to use too many comments? I'm looking at a script I wrote and
think I may have made it less clear by trying to make it more clear.
If you look at Spamassassin's codes,you'll find its comments are more
than codes.One thing I'm not satisfied with in perl is tha
On 5/14/07, Mathew Snyder <[EMAIL PROTECTED]> wrote:
Is it possible to use too many comments? I'm looking at a script I wrote and
think I may have made it less clear by trying to make it more clear.
Yes, it is very easy to have too many comments, especially if you are
using them in the wrong w
15 matches
Mail list logo