in reply to Constructing Context
It turns out that an array in scalar context returns something quite useful -- it's length, or it's content joined with the punctuation variable $,, depending if it is being used as a number or as a string. This is what lets if (!@a) {print "\@a is empty!"} work.No. You said the two cases are numeric @a and string @a. That's actually @a interpolated and scalar @a. You might even call interpolated-@a as an single-case only type of context except that if you or I did it we'd be wrong. Its also scalar context , it just creates a different optree.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Constructing Context
by theorbtwo (Prior) on Dec 17, 2003 at 04:41 UTC |