Hi Jonathan:

Running your script through the normal debugger does not cause a crash:

-----------------------------------------------------------------------
cat foo.pl
#!/ops/tools/bin/perl

use strict;
use PDL;
use PDL::NiceSlice;

my %h;
my $PDL_value = zeroes(3,1);
$h{'keyval'} = $PDL_value;

my $dbg;

perl -d foo.pl
  DB<1> b 11
  DB<2> c
main::(foo.pl:11):      my $dbg;
  DB<2> p %h
keyval
[
 [0 0 0]
]
-----------------------------------------------------------------------

Not sure how the ptkdb handles this differently.

I'm using:

uname -a
Linux jay 2.6.17.4 #1 SMP Fri Jul 14 09:14:49 MDT 2006 i686 i686 i386 GNU/Linux

perl -v

This is perl, v5.8.7 built for i686-linux-thread-multi

Regards,

  Doug Hunt

[EMAIL PROTECTED]
Software Engineer III
UCAR - COSMIC, Tel. (303) 497-2611

On Wed, 21 Mar 2007, Jonathan Epstein wrote:

I posted this on Perlmonks as:
  http://perlmonks.org/index.pl?node_id=605598

But I think that the expertise to solve this problem resides on this PDL list 
instead.

----------------------

Please consider the following mini-script, which concerns the placement of a 
PDL value inside a vanilla Perl hash:

use strict;
use PDL;
use PDL::NiceSlice;

my %h;
my $PDL_value = zeroes(3,1);
$h{'keyval'} = $PDL_value;

my $dbg;

========================
Now, if we run this as "perl -d:ptkdb sample.pl" and:
   * set a breakpoint at the final line ("my $dbg;") and run to the breakpoint
   * place "%h" in "Enter Expr:"
The debugger will crash, yielding the error message: Hash given as a pdl - but 
not {PDL} key! at c:/Perl/site/lib/Devel/ptkdb.pm line 2619.

It turns out that the message "Hash given as a pdl - but not {PDL} key!" (not 
surprisingly) comes from within PDL itself, not ptkdb. Is there an effective workaround 
for this problem which makes it possible to debug code with hashes which contain PDL 
objects?

TIA ...

Jonathan


Jonathan Epstein                                [EMAIL PROTECTED]
Head, Unit on Biologic Computation              (301)402-4563
Office of the Scientific Director               Bldg 31, Room 2A47
Nat. Inst. of Child Health & Human Development  31 Center Drive
National Institutes of Health                   Bethesda, MD 20892

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to