Where did you declare @records?  I can't see that in your code below but
"my $record" could have been a typo and should read "my @records".  You
get that error in Perl when you try to use a variable that is not
declared (under use strict;) or the declared variable is then used
outside of its lexical scope.
 
Leandro
 



________________________________

        From: Will Smith [mailto:[EMAIL PROTECTED] 
        Sent: Tuesday, January 02, 2007 16:54
        To: The elegant MVC web framework
        Subject: Re: [Catalyst] Create multiple records
        
        
        happy new year to all of you.
        
        thanks all for your support. Back to the question, (which I
guess, will irritate some catalyst/perl gurus - but please be patient
for learners), I've been able to add multiple records with "PRE"
assigned values. But that's not my purpose. I need to add multiple rows
that have the same name on the html. I tried several ways, but none was
good.
        
        my $book;
        my $record; 
        foreach $book ( @{$c->request->params->{book}}){
          
            push  @records, {title => $book, price => $price };
            };
           
               eval{
                  $c->model('bookDB::Book')->create($_) foreach
(@records);
               };
        
        ---- this gives me the compling error: Global symbol "@records"
requires explicit package name
        

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to