[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] re:Can't call method



I need to change the file mod & create dates for some files,

I can't access/change the items inside the CatInfo structure?

This script generates errors like:

# Can't call method "ioFlCrDat" without a package or object reference.
File 'Saving Dates:Save That Date'; Line 24

I've browsed dozens of messages w/the same type of problem, but couldn't
see the answer.

Thanks,

Al;




<  the script  >



## transfer file mod dates

use Cwd; 
use Mac::Files;
$currDir = cwd();

$fromFldr = "$currDir:Old Backs";
$toFolder = "$currDir:New Backs";

print "$fromFldr\n";

opendir FROMS, $fromFldr; 
@fromFiles = readdir FROMS; 
closedir FROMS;

foreach $singleFrom (@fromFiles)
{
	($singleTo = $singleFrom) =~ s/.*:(.*)/$toFolder:$1/;

	$toCat = FSpGetCatInfo($singleTo);
	$fromCat = FSpGetCatInfo($singleFrom);

	$fromCre = $fromCat->ioFlCrDat;
	$fromMod = $fromCat->ioFlMdDat;

	$toCat->ioFlCrDat($fromCre);
	$toCat->ioFlMdDat($fromMod);

	FSpSetCatInfo($singleTo,$toCat);
}

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org