Kevin Kleinfelter wrote:
> 
> I've read that
> 
> @a = undef;
> 
> creates an array with 1 empty element.  Why does it do so?  (I'm trying to
> learn to think like Perl, not just learn it by rote.)

Because undef is a scalar value like any other scalar value.

@a = 100;       # assign 100 to $a[0]  making @a a one element array

@a = 'string';  # assign 'string' to $a[0]  making @a a one element array

@a = undef;     # assign undef to $a[0]  making @a a one element array


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to