ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> komodo-beta
komodo-beta
Re: [Komodo-beta] Komodo 4.4 debugger bug or a least bad behavior
by Howard A. Bullock other posts by this author
Jul 1 2008 8:59AM messages near this date
view in the new Beta List Site
Re: [Komodo-beta] Komodo 4.4 debugger bug or a least bad behavior | [Komodo-beta] thanks for Komodo
When I run an updated test program at the command prompt using Perl 5.8
build 822 and Perl 5.10 build 1002, I get unexpected results. So some of
this issue may be with Perl itself, but the debugger is acting very
strangely.

Use the same INI file in the original message below.

use Config::IniHash;
use strict;

my %ReadINIoptions = (case =>  'tolower');
my $INI = ReadINI ('./Perl-1.ini', \%ReadINIoptions);
my %Hash;
my %badhash;

foreach my $item (%$INI) {
    $Hash{$INI-> {$item}->{1}}++;
    print scalar($item) . "\n";
}
foreach my $key (sort keys %Hash){
    print '"' . $key . '"' . "=" . $Hash{$key} . "\n";
}

Results:
C:\Data\Scripts\ProxyLogs2> perl perl-1.pl
a
HASH(0x18f1964)
b
HASH(0x1910c0c)
""=2
"123"=1
"abc"=1
I would not have expected two occurrences of empty string keys from the
program above. Where should I go from here? 

Komodo seems to have a few issues and either Perl or the Config-IniHash
has a problem. 

-----Original Message-----
From: komodo-beta-bounces@[...].com
[mailto:komodo-beta-bounces@[...].com] On Behalf Of
Bullock, Howard A.
Sent: Tuesday, July 01, 2008 9:21 AM
To: Komodo-beta@[...].com
Subject: [Komodo-beta] Komodo 4.4 debugger bug or a least bad behavior

Please see the example code below to reproduce the problem.  When
looping through a hash using the Komodo debugger the first element is a
scalar as expected. The second time through the loop one would expect
another scalar of the key, but instead Komodo delivers the hash
represented by the key of the previous loop. Seeing is easier. Place a
breakpoint on the "print" line inside the loop.

When the break point is first hit $item is a scalar with a value of 'a'.
The next iteration $item now has a value of a hash which data is that of
the $INI-> {a}. I would have expected $item would be another scalar with
a value of 'b'. The third break now has $item as a scalar with a value
of 'b'. The fourth break is a hash for $INI-> {b}. 

Even though initially the debugger properly shows INI as a hash with two
keys, after the looping, INI now has two keys and a HASH. Placing the
cursor in the debug window changes the cursor to an hourglass. Larger
hash are never painted. Many blank lines are shown where keys would
normally appear.

#Perl-1.pl
use Config::IniHash;
use strict;

my %ReadINIoptions = (case =>  'tolower');
my $INI = ReadINI ('./Perl-1.ini', \%ReadINIoptions);
my %Hash;
my %badhash;

foreach my $item (%$INI) {
    $Hash{$INI-> {$item}->{1}}++;
    $badhash{$item}++ if ! $INI-> {$item}->{1};
    print ""; #
}

##############

# Perl-1.ini
[A]
1=abc
2=bcd
3=cde

[B]
1=123
2=234
3=345


Howard A. Bullock
Tyco Electronics
Computer Security
717-810-3584
_______________________________________________
Komodo-beta mailing list
Komodo-beta@[...].com
http://listserv.ActiveState.com/mailman/listinfo/komodo-beta
_______________________________________________
Komodo-beta mailing list
Komodo-beta@[...].com
http://listserv.ActiveState.com/mailman/listinfo/komodo-beta
Thread:
Howard A. Bullock
cholet
Howard A. Bullock
cholet
Eric Promislow
Howard A. Bullock

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved