in reply to Dynamic creation of hashes

What do you mean by "not working"? It works quite fine for me.

use Data::Dumper; print Dumper \%hash_mnt; __END__ $VAR1 = { '/proc/bus/usb' => [ ['usbfs'], [undef] ], '/sys' => [ ['none'], [undef] ], '/' => [ ['/dev/hda1'], [undef] ], '/dev/pts' => [ ['none'], [undef] ], '/tmp' => [ ['/dev/hda5'], [undef] ], '/proc' => [ ['proc'], [undef] ], '/home' => [ ['/dev/hda6'], [undef] ] };

Do you mean that this structure is not what you wanted? It seems most sensible that you'd want a hash of arrays instead of the hash of arrays of arrays. Maybe like so?

foreach $mount(@Mounts){ ($mnt_key,$mnt_val,$mnt_acc)=(split(/\s+/,$mount))[2,0,6]; $hash_mnt{$mnt_key} = [ mnt_val, $mnt_acc ]; } use Data::Dumper; print Dumper \%hash_mnt; __END__ $VAR1 = { '/proc/bus/usb' => [ 'usbfs', undef ], '/sys' => [ 'none', undef ], '/' => [ '/dev/hda1', undef ], '/dev/pts' => [ 'none', undef ], '/tmp' => [ '/dev/hda5', undef ], '/proc' => [ 'proc', undef ], '/home' => [ '/dev/hda6', undef ] };

Makeshifts last the longest.