Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: creating associative arrays

On Dec 11,  7:45pm, Akos Szalkai wrote:
} I am trying to fill an associative array from a file.  If the name of
} the file is fixed, e.g. array.txt then the following works:
} : ${(AA)dict::=$(<array.txt)}
} However, if the filename is given in a parameter then the command:
} : ${(AA)dict::=$(<${filename})}
} gives the error
} zsh: bad set of key/value pairs for associative array.

This is a side-effect of the bug that was fixed in zsh-workers/16215.
That was about a week after the 4.0.4 release; the above works in the
latest 4.1.0-dev.  I haven't committed that patch on the 4.0 branch yet.

[Unrelated admin note:  My ISP is playing games with me again, so any
mail directed to schaefer@xxxxxxxxxxxxxxxxxxxxxxx or to any other third-
or greater-level domain in brasslantern.com, will bounce.  Mail sent to
schaefer@xxxxxxxxxxxxxxxx will get through.]

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

Messages sorted by: Reverse Date, Date, Thread, Author