in reply to blessed object containing reference to hash

Hi,

First, a quick note: you do not need to do any of the Exporter stuff at the top. You probably want connect called like:

Excel::Tabbed->connect('file'); # or connect Excel::Tabbed 'file';

In either case, you are calling connect through the package Excel::Tabbed. So, you do not want to export it.

What you are doing is ok, but could be cleaned up a bit:

.... my ($self,$args) = @_; # Should that be @args, not $args my $find = $self->{where}; $find->{name} = 'test'; # You didn't need the {} around find.

So this looks fine. Are you having problems? You don't describe how it is not working.

Ted Young

($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)

Replies are listed 'Best First'.
Re^2: blessed object containing reference to hash
by Limbic~Region (Chancellor) on Jan 04, 2005 at 16:21 UTC
    TedYoung,
    Your statement: First, a quick note: you do not need to do any of the Exporter stuff at the top without an explanation might be a little confusing. The following is more to benefit others than you - even then it is an oversimplification.

    Exporter is a useful tool that allows subroutines defined in another namespace to become part of your namespace when you use that module. There are issues to be concerned with like which ones to export by default, name collisions, etc. When using OO however, it is not necessary to export any subroutines that will be used as methods on that object.

    Of course there is a lot more to the story and spending time RTFMing helps turn the scary black magic into ordinary perl-fu.

    Cheers - L~R

Re^2: blessed object containing reference to hash
by arcnon (Monk) on Jan 04, 2005 at 16:24 UTC
    well I guess I am retarded... removed the brackets around find and it works. wonder how I missed that one. I am using
    Excel::Tabbed->connect('file');
    the reason for the export I was trying to
    use Excel::Tabbed; my $thingy = connect('file');
    thanks for you assistance.

      I thought that you might be shooting for connect('file'). That won't work, because you won't be handed a package name as your first param. The most common approach is Excel::Tabbed->connect('file');

      Ted Young

      ($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
        it only took about 40 minutes for me to figure that one out. But I am sure Ill remember next time : )