We don't receive attach files in this place?

OK, the problem is resolved for know (3 days of work). All about the
'UNIVERSAL::' I will see what it thus later.

I read this article " http://www.perl.com/pub/a/2003/06/19/treasures.html "
and I thought I really need this debug featchure so 3 files.

$$$testeAttribute.pl$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
use Module2;
use TraceCode qw(:DEFAULT);

my $zzz:traceVar;
sub xxx:traceCode()
{
    print "xxx\n";
}

xxx();
yyy();
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
$$$TraceCode.pm$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
package TraceCode;

use vars qw (@ISA @EXPORT);

require Exporter; 
push(@ISA, qw(Exporter));

use strict;
use Data::Dumper;
use Attribute::Handlers;
use constant {
    PKG    => 0,
    SYMBOL => 1,
    CODE   => 2,
    ATTR   => 3,
    DATA   => 4,
    PHASE  => 5,
};

sub UNIVERSAL::traceCode :ATTR {
    my ($symbol, $code) = @_[SYMBOL, CODE];
    my $name = *{$symbol}{PACKAGE}."::".*{$symbol}{NAME};
    
    no warnings 'redefine';
    *{$symbol} = sub {
        print "Starting: $name\n";
        my @output = $code->(@_) if wantarray;
        my $output = $code->(@_) if not wantarray;
        print "Ending: $name\n";
        return wantarray ? @output: $output;
    };
}


sub UNIVERSAL::traceVar :ATTR {
    print "traceVar\n";
}
1;
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
$$$Module2.pm$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
package Module2;
use TraceCode;

use vars qw (@ISA @EXPORT);
require Exporter; 
push(@ISA, qw(Exporter));

@EXPORT = qw(yyy);

sub yyy:traceCode() { 
    print "yyy\n";
}
1;
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


run with Perl 5.8.0 or higher testeAttribute.pl


My problem was: remove the 'UNIVERSAL::' and try it ;)

thanks
Marcos Rebelo

-----Original Message-----
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 4:40 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Need to set this code to work



> Can You help me please

Love to!
Help with what? (My Mind::Read module was never installed properly ;p)

> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to