Hi Kenneth,

On Tuesday 13 Apr 2010 12:35:57 CHAN, KENNETH 1 [AG/7721] wrote:
> Thanks Uri and Shlomi. The dumper works but still not getting the proper
> results, please see comment in text. Thanks.

Thanks for not top-posting. :-)

> 
> > -----Original Message-----
> > From: Uri Guttman [mailto:u...@stemsystems.com]
> > 
> > first off, learn to bottom post and edit the quoted emails. i deleted
> > tons of stuff below this.
> 
> [CHAN] Thanks for the advice. Will do it.
> 
> > your problem is that you appended a newline to the reference thereby
> > stringifying it. dumper printed that string as you asked. when you use
> > dumper you only pass it the reference you want and nothing else.
> 
> [CHAN] after taken out the newline. It shows an empty array as:
>   $VAR1 = [];
> Does it mean it's returning an empty array?
> Then what isn't the Class::Inspector->methods() not working properly?
> Any idea how do I get it to work?
> 

I can try to investigate, but that will take some time. I have no previous 
experience with Class::Inspector - at least not a direct one.

> > -----Original Message-----
> > From: Shlomi Fish [mailto:shlo...@iglu.org.il]
> > 
> > Always add "use strict;" and "use warnings;" (and correct all reported
> > problems). Not that it should matter here.
> 
> [CHAN] Thanks for the advice. Will do it.
> 
> > 1. I guess ->methods returns a single array reference instead of a
> 
> flattened
> 
> > list even in scalar context. So you should do:
> > 
> > {{{
> > my $methods = Class::Inspector->methods( 'Bio::Graphics', 'full',
> 
> 'public');
> 
> > foreach my $method (@$methods) {
> > 
> >     # Do something with $method.
> > 
> > }
> > }}}
> 
> [CHAN] What is the meaning for putting the code in the 3 curly brackets?

These are delimiters. Maybe I should try using [code]...[/code] or something. 
Hmmm....

> I tried this one by putting "print $_;" in the foreach loop and the
> output shows:

It is generally a bad idea to use $_ as a loop iterator, because it is so 
easily modified and manipulated. Just use a lexical variable such as "$method" 
in my case. I iterate over $method - not over $_.

>   __END__
> I guess it's the problem in the returned array. How can I get the
> Class::Inspector->methods() to work?
> 

I'll do my best to investigate it.

Regards,

        Shlomi Fish

> 
> 
> 
> 
> 
> ---------------------------------------------------------------------------
> ------------------------------ This e-mail message may contain privileged
> and/or confidential information, and is intended to be received only by
> persons entitled to receive such information. If you have received this
> e-mail in error, please notify the sender immediately. Please delete it
> and all attachments from any servers, hard drives or any other media.
> Other use of this e-mail by you is strictly prohibited.
> 
> 
> All e-mails and attachments sent and received are subject to monitoring,
> reading and archival by Monsanto, including its subsidiaries. The
> recipient of this e-mail is solely responsible for checking for the
> presence of "Viruses" or other "Malware". Monsanto, along with its
> subsidiaries, accepts no liability for any damage caused by any such code
> transmitted by or accompanying this e-mail or any attachment.
> --------------------------------------------------------------------------
> -------------------------------

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
What Makes Software Apps High Quality -  http://shlom.in/sw-quality

Deletionists delete Wikipedia articles that they consider lame.
Chuck Norris deletes deletionists whom he considers lame.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to