[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: initialising number of vars in perl



my ($a,$b,$c,$n) = ("NULL") x 4;


Regards
Sumit

Gaurav Priyolkar wrote:

> Hi all,
>
> How do I assign an initial value to a number of scalar variables?
>
> my ($a, $b, $c, $n ) = 'NULL';
>
> doesn't work 'coz left side is list context.
>
> my $a, $b, $c, $n = 'NULL'
>
> assigns 'NULL' only to $n.
>
> Right now I have an array on right side in list context with lots of
> 'NULL's, but I guess there must be a cleaner way.
>
> -Gaurav
>
> --
> Ultimate file compression:   'rm -rf /'    (100% compression)
>
> ---------------------------------------------
> Find out more about this and other Linux India
> mailing lists at http://lists.linux-india.org/