lanzaroto <[EMAIL PROTECTED]> wrote:
Le dim 09/11/2003 � 20:02, drieux a �crit :
> On Sunday, Nov 9, 2003, at 09:24 US/Pacific, lanzaroto wrote:
> > Le dim 09/11/2003 � 17:44, drieux a �crit :
> >
> >> On Sunday, Nov 9, 2003, at 08:08 US/Pacific, lanzaroto wrote:
> >>
> >>>
> >>> while({$id, $nom, $prenom, $email} =
> >>> $STH->fetchrow_array){
> >>>
> >>> $REQ->Tr,
> >>> $REQ->td('$id'),
> >>> $REQ->td('$nom'),
> >>> $REQ->td('$prenom'),
> >>> $REQ->td('$email'),
> >>> $REQ->$id++;
> >>> }
> >>> ),
> >>
> >> is this the 'while' at or near line 90?
> >
> > yes
>
> is there a reason that you have them in the form
>
> '$var'
>
> vice say
>
> $var
>
> eg:
>
> $REQ->td($id),
>
> since the single tick will prevent 'expansion' and hence pass
> a literal string there?
No , but before this mail I made a lot of tests.
>
> There is also the odd bit that you doing an interative loop
> in the middle of a print statement. Hence I would split that up
> into three print statements
>
> stuff before the while loop,
> the while loop printing
> stuff after the while loop.
OK,it's a good idea but I am not sur to understand all you write me, I
am doing this script to learn howw to it
Normaly This script is going to be the admin of mysql base of a
website,
>
> attached below find some play code, and IF you can help me
> with how i would be able to do a
>
> print "some stuff here", while(...){....}, "some other stuff";
>
> then you clearly will have coolness.
>
Thank you but I prefere do it by myself, to understand what I am doing,
the target is to improve myself in Perl CGI
Thank you
Lanzaroto
> ---
>
> my $req = Foobar::foobar();
>
> $req->fill_foobar(junk_me());
>
> while ( my ( $id, $thing, $third, $forth) = $req->fetch())
> {
> print "$id, $thing, $third, $forth \n";
> #"\t$id, $thing, $third, $forth \n";
>
> };
>
>
> sub junk_me {
> [
> [qw/a b c d/],
> [qw/e f g h/],
> [qw/i j k l/],
> [qw/bob ted carol alice/]
> ];
> }
>
> package Foobar;
>
> #------------------------
> #
> sub foobar {
>
> my $hash = {};
> bless $hash, "Foobar";
>
> } # end of foobar
>
> #------------------------
> #
> sub fill_foobar
> {
> my ($me, $array_oh_array) = @_;
>
> $me->{max} = @$array_oh_array;
> $me->{count} = 0;
> $me->{stuff} = $array_oh_array;
>
> } # end of fill_foobar
>
> #------------------------
> #
> sub fetch
> {
> my ($me) = @_;
>
> my @array;
> if ($me->{count} < $me->{max} )
> {
> @array = @{${$me->{stuff}}[$me->{count}++]};
>
> } else
> {
> $me->{count} = 0;
>
> }
>
> return @array;
>
> } # end of fetch
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi there,
I don't have any answer to Lanzaroto to question (sorry), but I'm curious about
drieux's code. In your code, there's a package and a group of subroutines. When you
call the Foobar::foobar(), are you only doing foobar subroutine? And, do you have to
do Foobar::foobar() and not foobar() alone? Thanks.
Angela
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard