I need store each element in the first column where are the privileges in keys and value in the file, i did this but I do not understand.
it's content in my file "file-privilege"
-rw-rw-r--. file-privilege
-rw-rw-r--. file-selinux
-rwxrwxrwx. funcion-split-join.pl
-rwxrwxr-x. hash2.pl
-rw-rw-r--. hash3.pl
-rwxrwxr-x. hash.pl
-rwxrwxr-x. inthashfile.pl
-rw-rw-r--. ls
-rwx------. probando.pl
the code in perl.
%pr_file = ();
open(WHO, "file-privilege");
while (<WHO>) {
($privilege, $file) = split ;
push( @{$pr_file{$privilege}}, $file );
}
this output.
-rwx------. = ARRAY(0x83bb7f0)
-rw-rw-r--. = ARRAY(0x83a06f8)
-rwxrwxr-x. = ARRAY(0x83bb780)
-rwxrwxrwx. = ARRAY(0x83bb750)
I need:
key = value
-rw-rw-r--. = file-privilege
etc...
any idea?