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
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.
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
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
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
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
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
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
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
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
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
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]]
>
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
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
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)
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
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
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
--
> 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
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
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
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
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 ";
'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
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
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
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
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
> 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 . "_" . $
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
30 matches
Mail list logo