Up Prev Next
From: "Chris Jack" <jackc at rabo-bank dot com>
Subject: RE: Why the brackets ()
Date: Mar 16 1999 11:16AM
The () are saying to treat the contents (i.e. $database and any other
elements you might have specified) as a list so $database gets allocated
the 0th element from the list pointed to by the reference $row. If you
don't have the brackets, the @$row gets treated as a scalar and $database
will be allocated the number of elements in that list (probably 1 in your
case). If you were selecting more than one column, this might be more
From: Andrew J Davies [SMTP:Andrew.J.Davies@aib.ie]
Sent: Monday, March 15, 1999 4:45 PM
To: SybPerl Discussion List
Subject: Why the brackets ()
Why, when I remove the () from around the $database variable do I get an
What are the () actually doing. Without them $database == 1
With them ($database) == "a valid database name"
@rows = $dbh->ct_sql("select name from sysdatabases where name like
foreach $row (@rows)
($database) = @$row; # ????????????
next if ( $database eq "master" || $database eq "model" || $database
eq "sybsystemprocs" );
Thanks for your time.