in reply to file tree to hash
use strict; use Data::Dumper; my %hash; while (<DATA>) { chomp; s/\//}{/g; eval "\$hash".substr($_,1,length)."} = undef"; } print Dumper(\%hash); __DATA__ /root/dir1/file1 /root/dir1/file2 /root/dir1/file3 /root/dir2/file1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: file tree to hash
by merlyn (Sage) on Apr 08, 2003 at 04:43 UTC |