On Wednesday, November 6, 2002, at 08:26 AM, John Delacour wrote:
I've a feeling I'm doing something silly here, but I can't work out what it is. In the shell I can list the contents of a Mail.app account package, but perl will not recognise the package as a directory. Do I need to use some other syntax or is it simply impossible?This line has the exact same problem as your last script did - readdir() returns RELATIVE directory paths, so you need to opendir(ACC, "$dir/$acc").
#!/usr/bin/perl
$dir = "$ENV{HOME}/Library/Mail";
opendir DIR, $dir ;
for (readdir DIR) {
/@/ and push @accounts, "$dir/$_\n"
}
$acc = $accounts[0] ;
print $acc ;
### [EMAIL PROTECTED]
opendir ACC, qq~$acc~ or print "$!\n\n" ;
Anyway, the things in ~/Library/Mail aren't packages, they're just files in directories.
-Ken