oops, that a typo, sorry, I fixed that one. I realized it right after I sent the mail. The problem is it does not loop through the html page. this is what i done, and just the first value got inserted:<br> my @records;<br> my $book;<br> foreach ( $book = (shift @{$c->request->params->{book}})){<br> <br> push @records, {title => $book};<br> };<br>if, i try to put a second params, it just do nothing;<br> push @records, {title => $book, price => $c->request->params->{price}};<br> <br> <br><b><i>"Hermida, Leandro" <Leandro.Hermida@fmi.ch></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <meta content="MSHTML 6.00.2900.3020" name="GENERATOR"> <div align="left" dir="ltr"><font face="Arial" size="2"><span
class="707141916-02012007">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.</span></font></div> <div align="left" dir="ltr"><font face="Arial" size="2"><span class="707141916-02012007"></span></font> </div> <div align="left" dir="ltr"><font face="Arial" size="2"><span class="707141916-02012007">Leandro</span></font></div> <div align="left" dir="ltr"><font color="#0000ff" face="Arial" size="2"><span class="707141916-02012007"></span></font> </div><font color="#0000ff" face="Arial" size="2"></font><font color="#0000ff" face="Arial" size="2"></font><font face="Arial" size="2"></font><br> <blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right:
0px;" dir="ltr"> <div class="OutlookMessageHeader" align="left" dir="ltr" lang="en-us"> <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b> Will Smith [mailto:willbelair@yahoo.com] <br><b>Sent:</b> Tuesday, January 02, 2007 16:54<br><b>To:</b> The elegant MVC web framework<br><b>Subject:</b> Re: [Catalyst] Create multiple records<br></font><br></div> <div></div>happy new year to all of you.<br><br>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.<br><br>my $book;<br>my $record; <br>foreach $book ( @{$c->request->params->{book}}){<br> <br> push @records, {title => $book, price => $price
};<br> };<br> <br> eval{<br> $c->model('bookDB::Book')->create($_) foreach (@records);<br> };<br><br>---- this gives me the compling error: Global symbol "@records" requires explicit package name<br></blockquote>_______________________________________________<br>List: Catalyst@lists.rawmode.org<br>Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst<br>Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/<br>Dev site: http://dev.catalyst.perl.org/<br></blockquote><br><p> __________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com