Re: Unblessed reference problem

2012-05-21 Thread sono-io
On May 20, 2012, at 8:28 AM, Shlomi Fish wrote: > The problem is that «$self->animals» returns an (unblessed) array reference > and > not the list of individual animals, so you should do something like: > > for my $animal (@{ $self->animals }) { Thanks, Shlomi. That did it. Moose is a

Re: Unblessed reference problem

2012-05-20 Thread Chris Nehren
On Sun, May 20, 2012 at 21:44:29 -0400 , John SJ Anderson wrote: > On Sunday, May 20, 2012 at 9:28 PM, Peter Scott wrote: > > On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > > > Note that I think I saw a way to return the flattened array in Moose, > > > but I don't remember the specifics.

Re: Unblessed reference problem

2012-05-20 Thread John SJ Anderson
On Sunday, May 20, 2012 at 9:28 PM, Peter Scott wrote: > On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > > Note that I think I saw a way to return the flattened array in Moose, > > but I don't remember the specifics. > > > > > auto_deref => 1 > … which is semi-deprecated/recommende

Re: Unblessed reference problem

2012-05-20 Thread Peter Scott
On Sun, 20 May 2012 18:28:10 +0300, Shlomi Fish wrote: > Note that I think I saw a way to return the flattened array in Moose, > but I don't remember the specifics. auto_deref => 1 -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.asp

Re: Unblessed reference problem

2012-05-20 Thread Shlomi Fish
Hi Marc, On Sat, 19 May 2012 20:09:00 -0700 sono...@fannullone.us wrote: > I'm trying the following code from Programming Perl, but I'm get the > error "Can't call method "type" on unblessed reference at untitled text 10 > line 23". I've checked the errata page, but there's nothing liste

Unblessed reference problem

2012-05-19 Thread sono-io
I'm trying the following code from Programming Perl, but I'm get the error "Can't call method "type" on unblessed reference at untitled text 10 line 23". I've checked the errata page, but there's nothing listed for it. Searching on the error message brings up pages about unblessed refe

Re: Benchmarking a sort with array reference problem

2005-01-21 Thread John W. Krahn
Edward Wijaya wrote: Hi, Hello, I am trying to benchmark these two sorting algorithms. However running the script below: $ perl thiscode.pl gives: Can't use an undefined value as an ARRAY reference at radix.pl line 23. However the code execute smoothly with the normal usage. Only when I use 'cmpthe

Benchmarking a sort with array reference problem

2005-01-21 Thread Edward Wijaya
Hi, I am trying to benchmark these two sorting algorithms. However running the script below: $ perl thiscode.pl gives: Can't use an undefined value as an ARRAY reference at radix.pl line 23. However the code execute smoothly with the normal usage. Only when I use 'cmpthese' the problem occur. Any i

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
David, this appears to be exactly what i was looking for, and i thank you with infinite groveling *g*. the reason i wanted something like this is because i like to name my variables and cgi parameters the same as my database fields - $school_id = school_id (cgi parameter) = school_id (mysql field

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
Excellent info! -Original Message- From: david [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 1:59 PM To: [EMAIL PROTECTED] Subject: RE: reference problem (i think) Joe Mecklin wrote: > Dan, > > here is the output with your additions. > > BEFORE :: ID - 101

RE: reference problem (i think)

2003-01-13 Thread david
Joe Mecklin wrote: > Dan, > > here is the output with your additions. > > BEFORE :: ID - 101 > NM - Arapaho Elementary > AD - 1300 Cypress Dr. > > # this is the call to clear_input in ISD.pm > $fields = school_id, school_name, school_address > @field = school_id school_name school_address

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
ELDS => "school_id, school_name, school_address"); > > Print "AFTER :: ID - $school_id \n NM - $school_name \n AD - > $school_address \n"; > > exit; > > > > > > > -Original Message- > From: Joe Mecklin [mailto:[EMAIL PROTECTED]] >

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
version? If it can see the real version then it's a ref issue if not it's an all variables issue. Knowing that will help narrow the problem down. Dan -Original Message- From: Joe Mecklin [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 1:20 PM To: [EMAIL PROTECTED] Subje

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
ot > #&ISD::clear_input(FIELDS => "school_id, school_name, school_address"); > > Print "AFTER :: ID - $school_id \n NM - $school_name \n AD - > $school_address \n"; > > exit; > > > > > > > -Original Message- > From: J

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
e, school_address"); Print "AFTER :: ID - $school_id \n NM - $school_name \n AD - $school_address \n"; exit; -Original Message- From: Joe Mecklin [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 12:34 PM To: Dan Muey Subject: RE: reference problem (i think)

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
script I sent? What does it output? -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 12:17 PM To: [EMAIL PROTECTED] Subject: Re: reference problem (i think) Hi Joe I got a bit lost amongst all those 'print' statements, but

Re: reference problem (i think)

2003-01-13 Thread Rob Dixon
Hi Joe I got a bit lost amongst all those 'print' statements, but what you need to know is this: $current_field = 'school_id'; ${$current_field} = 1234;# same as $school_id = 1234 HTH, Rob "Joe Mecklin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTE

Re: reference problem (i think)

2003-01-13 Thread Rob Dixon
Hi Joe I got a bit lost amongst all those 'print' statements, but what you need to know is this: $current_field = 'school_id'; ${$current_field} = 1234;# same as $school_id = 1234 HTH, Rob "Joe Mecklin" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTE

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
-- > From: Joe Mecklin [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 13, 2003 11:44 AM > To: [EMAIL PROTECTED] > Subject: RE: reference problem (i think) > > > thanks Dan, but no go. here is the current incarnation, based on your > suggestion: > > sub cl

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
d you get that from? ( It could be totally legit I've just never seen it. ) Dan -Original Message- From: Joe Mecklin [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 12:05 PM To: [EMAIL PROTECTED] Subject: RE: reference problem (i think) yes, the variables exist in the cal

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
may be better as -$$f- instead of .$$f. just incase >it's trying to use a var named $f. instead of $f. > > Dan > -Original Message- > From: Joe Mecklin [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 13, 2003 11:44 AM > To: [EMAIL PROTECTED] > Subject: RE: re

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
hat you get. Also print "\$f = $f = .$$f." may be better as -$$f- instead of .$$f. just incase it's trying to use a var named $f. instead of $f. Dan -Original Message- From: Joe Mecklin [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 11:44 AM To: [EMAIL PROTECTED

RE: reference problem (i think)

2003-01-13 Thread Joe Mecklin
thanks Dan, but no go. here is the current incarnation, based on your suggestion: sub clear_input { no strict 'refs'; my %options = @_; my $fields = $options{FIELDS}; my (@field) = split /, /, $fields; print "\$fields = $fields "; print "\@field = @field ";

RE: reference problem (i think)

2003-01-13 Thread Dan Muey
's a way. Dan -Original Message- From: Joe Mecklin [mailto:[EMAIL PROTECTED]] Sent: Monday, January 13, 2003 11:00 AM To: [EMAIL PROTECTED] Subject: reference problem (i think) i'm building a routine in a module (ISD.pm) that will clear a list of variables (set them to "&q

reference problem (i think)

2003-01-13 Thread Joe Mecklin
i'm building a routine in a module (ISD.pm) that will clear a list of variables (set them to ""), with the intent of expanding the functionality further in the future. when called, the sub is passed a list of strings that are variable names without the leading "$". my goal is to append the "$" to

Re: Hash Reference Problem

2002-10-15 Thread Michael Fowler
On Tue, Oct 15, 2002 at 10:54:14AM -0400, Chris Benco wrote: > my $From = $Document->GetFirstItem('From')->{Text} or (); > > This appears to work. When I run a test the program recovers seemingly > flawlessly. My problem is that the script still dies at some point. When > I come in the next da

Re: Hash Reference Problem

2002-10-15 Thread Jenda Krynicky
From: "Chris Benco" <[EMAIL PROTECTED]> > Having problems when this script hits a hash that is undefined. This > happens when it does a look-up for a field in a notes database and it > is blank. Read on Perl Monks to give it the ability to use another > value when this happens

Hash Reference Problem

2002-10-15 Thread Chris Benco
Having problems when this script hits a hash that is undefined. This happens when it does a look-up for a field in a notes database and it is blank. Read on Perl Monks to give it the ability to use another value when this happens to keep the script form halting. The example they give was someth

RE: Reference problem

2002-01-06 Thread ss004b3324
> Robert Thompson wrote: > #!/usr/bin/perl > > @one_list = qw(1 2 3 4); > @two_list = qw(5 6 7 8); > @three_list = qw(9 10 11 12); > @four_list = qw(13 14 15 16); > > foreach my $array (qw(one two three four)) { > foreach my $num ( @{$array}_list ) { <== Break here > print $array . "_" . $

Reference problem

2002-01-05 Thread Robert Thompson
Hello list, I am attempting to use some references for variable names in some loops, and am having problems. Below is some test code for what I am attempting to accomplish. #!/usr/bin/perl @one_list = qw(1 2 3 4); @two_list = qw(5 6 7 8); @three_list = qw(9 10 11 12); @four_list = qw(1