in reply to Is it possible to split a hash key?

Is it possible to split a hash key?

No, split operates on scalars. It can, however, operate on a scalar returned by keys. They're not special.

Replies are listed 'Best First'.
Re^2: Is it possible to split a hash key?
by mjscott2702 (Pilgrim) on Jul 29, 2007 at 23:57 UTC
    All hash keys are scalars. And all arrays are arrays of scalars (multi-dimensional arrays have a degree of indirection behind the scenes).

    Looking at perldoc -f keys, you get the following:

    keys HASH
    Returns a list consisting of all the keys of the named hash. (In scalar context, returns the number of keys.)

    So in summary, of course you can split a hash key, and do everything else with it than you can a scalar.