Gangabass has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Monks.
This is first time I'm using B::Deparse so I need some help with it.
Here is code I have (I just want to check code of the $xs):
package WSD::Filter; use 5.006000; use Config; our $VERSION = '1.0'; use FindBin qw($Bin); use B::Deparse; require DynaLoader; @ISA = qw(DynaLoader); my $perlver = '508'; $perlver = '510' if($] >= 5.01); $perlver = '512' if($] >= 5.012); $perlver = '514' if($] >= 5.014); my %v0= (32=>[ '32','32_3', '32_4','32_5', '32_2'], 64=>['64_2', '64_ +3', '64_4', '64']); my $bits = 32; $bits = 64 if($Config{'archname'} =~ /x86_64/ || $Config{'archname'} = +~ /amd64/); my $libref = undef; my $file_version; my @v = @{$v0{$bits}}; while(@v && !$libref) { my $bit = shift @v; $file_version = $perlver.$bit; if (-e "$Bin/Filter$file_version.so") { $libref = DynaLoader::dl_load_file("$Bin/Filter$file_version.s +o"); sleep 1; } } my $symref = DynaLoader::dl_find_symbol($libref, 'boot_WSD__Filter'); my $xs = DynaLoader::dl_install_xsub('WSD::Filter::bootstrap', $symref +); #this is my first time I'm using B::Deparse... #what I'm doing wrong here? my $deparse = B::Deparse->new(); my $body = $deparse->coderef2text($xs); print $body; ########## &$xs('WSD::Filter'); 1;
But I have only ";" as output :-(. What's wrong with my approach?c
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [B::Deparse] Trying to find sub's code
by chromatic (Archbishop) on Jul 16, 2012 at 06:21 UTC | |
Re: [B::Deparse] Trying to find sub's code
by cavac (Parson) on Jul 16, 2012 at 06:42 UTC | |
Re: [B::Deparse] Trying to find sub's code
by bulk88 (Priest) on Jul 16, 2012 at 06:30 UTC | |
Re: [B::Deparse] Trying to find sub's code
by Anonymous Monk on Jul 16, 2012 at 06:21 UTC |
Back to
Seekers of Perl Wisdom