|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Why the brackets ()
Date: Mar 16 1999 3:17PM
Andrew J Davies writes:
> Hi
> Why, when I remove the () from around the $database variable do I get an
> error.
> What are the () actually doing. Without them $database == 1
> With them ($database) == "a valid database name"
> ($database) = @$row; # ????????????
$row is a reference to an array (ie a reference to each row returned
by ct_sql().
@array in scalar context (which is what $db = @$row is) returns the
number of elements in the array. Placing the () arround $database
tells perl to evaluate this assignement in list (array) context.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|