ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> modperl
modperl
Re: Perl Section...
by darren chamberlain other posts by this author
Apr 20 2000 1:44PM messages near this date
Re: Perl Section... | Re: Perl Section...
w trillich (will@pinncomp.net) said something to this effect:
>  > while($domain = $sth->fetchrow_array)
>  >   {
>  >     $PerlConfig .= <<"CONFIG";
>  > <VirtualHost $ipAddr>
>  >     ServerName www.$domain
>  >     ServerAdmin webmaster@$domain
>  >     ServerAlias $domain
>  >     DocumentRoot $baseDir/www.$domain/htdocs/
>  > </VirtualHost>
>  > 
>  > CONFIG
>  >   }
>  
>  doesn't $sth->fetchrow_array() return a reference to an 
>  array, instead of a simple scalar?
>  	$row = $sth->fetchrow_array;
>  	foreach $col ( @$row ) { ... }
>  ?

fetchrow_array returns a list. fetchrow_arrayref returns a list ref.
if you call fetchrow_array and are expecting one results ('select foo
from bar') you can assign it a scalar.

darren

-- 
To do nothing is to be nothing.
Thread:
Geoffrey Young
w trillich
darren chamberlain
Bryan J. Opfer

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved