> -----Original Message-----
> From: Mat Harris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 10:13 AM
> To: [EMAIL PROTECTED]
> Subject: variable behaviour question and including files
> 
> 
> 1){ If say something like:
> 
> my $profile = $dbh->selectrow_hashref("SELECT * FROM users WHERE
> username = '$username' AND password = '$password'");
> 
> and the SQL query doesn't return anything, will $profile be defined or
> undefined?
> }

It will be undef. It will also be undef if an error occurred, so read
perldoc DBI under fetchrow_hashref to see what to do about that.

> 
> 2){ I want to keep large chunks of html outsite my main scripts but so
> they can be accessed, and brought in just to print to STDOUT. I have
> tried keeping them in individual html files then doing 
> 
> while (<HTMLFILE>)
>       print;
> }
> 
> but I also need parts of the html to be perl scalars relying on values
> from the main script. Is this possible? You see I want to keep my main
> script as free of html as possible for portability's sake.

Your talking about templating now. There are lots of approaches to that. You
might want to start by searching CPAN for "Template".

http://search.cpan.org/search?mode=all&query=template

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to