PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at mbay dot net>
Subject: don't quite understand
Date: Sep 11 1998 2:17PM

pang khong lin writes:
 > hi all, newcomer to SybPerl,
 > 
 > $dbh->{"AttributeName'} = value;
 > 
 > don't quite understand the above statement. The attribute name is 
 > suppose to show the status of the connection, but why it seem as if the 
 > attribute name is SET to the 'value'? Is the statement suppose to return 
 > certain value? Let say the :-
 > 
 > if ($dbh->{"ROW_COUNT") = 1)  {
 >    print " add record succeeded";
 >    ...
 > }
 > 
 > is the statement valid? Is this the right way to manipulate the 
 > connection specific attribute ?

Yes and no.

If you had run perl with the -w flag, you would have gotten a warning
on that statement:

Found = in conditional, should be == at ttt.pl line 3.

In perl a single '=' sign is an assignement. What you wanted to use is 
'==' (equality).

You should get a good book on perl to help you understand how it all works.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com