RuneK has asked for the wisdom of the Perl Monks concerning the following question:
I want to add all the files of a directory into the directory struct which is no problem, but I don't know how to access the data afterwards. The following does not work:struct directory => { name => '$', files => '@', }; struct file => { name => '$', permis => '$', };
The error I get is: Can't locate object method "task=HASH(0x400a76fc)" via package "folder" at ... So I guess the error is reference related. Anyone to give a hand? Thanks in advance, Rune P.S. Whether to use a struct or not is not up for discussion :) - Not my choice#@direc contains a list of directories foreach $dir (@direc){ foreach $fi (@{$dir->files}){ print $dir->$fi->name; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to access struct of structs
by borisz (Canon) on Aug 11, 2004 at 12:18 UTC | |
|
Re: How to access struct of structs
by reneeb (Chaplain) on Aug 11, 2004 at 12:31 UTC |