On Fri, 29 Sep 2000, Nathan Wiger wrote:
> > > Should result in C<@out> being exactly equivalent to C<@in>.
> >
> > It cannot, of course, since the order of hash keys obtained by flattening
> > the hash is not necessarily the same as when you built the hash.
>
> Actually, it does. Remember, a hash is just a list. unheader just
> returns an ordered list of the headers. So this:
>
> @out = header unheader @in;
>
> Will always result in identity because it's actually the same as:
>
> @temp = unheader @in;
> @out = header @temp;
>
> It's only once you assign to a hash explicitly that everything gets out
> of whack.
D'oh! Yes, of course.
For some reason I got carried away with the hash thing. You were doing
@out = header (@temp = unheader @in);
and I thought you were doing
@out = header (%temp = unheader @in);
If you just take unheader's output and feed it to header, the order will
be the same. Thanks for bearing with me ;)
Cheers,
Philip
--
Philip Newton <[EMAIL PROTECTED]>