[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] words words words



2000-05-19-13:38:35 Ronald J Kimball:
> You can't consider only the prefix, you have to consider the suffix (if
> any) as well.
> 
> $x           # scalar variable
> @x           # array variable
> %x           # hash variable
> $x[0]        # scalar element of array variable
> $x{y}        # scalar element of hash variable
> @x[0,1]      # list of elements of array variable
> @x{qw/y z/}  # list of elements of hash variable

Nicely summarized! And when cast in this clear fashion, it becomes
obvious (to me, anyway) that Perl is missing some natural bits that
fit right in:

  %x[0,1]      # (0, $x[0], 1, $x[1])
  %x{qw/y z/}  # ('y', $x{y}, 'z', $x{z})

which could then be assigned to other hashes, using in option=>value
parameter lists, etc.

I don't think p5p really needs more flames at this precise moment,
but if it ever starts showing signs of freezing over I now know how
to warm it right up again:-).

-Bennett

PGP signature