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

Re: [MacPerl] Emulating AS-like properties in Perl



>I'd like to have something like properties from AppleScript in
>(Mac)Perl, i.e. variable values that are saved across executions of a

>script, preferably without having to use a preferences file.
>How should I go about it?

look up 'constant' in Shuck :

NAME

constant - Perl pragma to declare constants

SYNOPSIS

use constant BUFFER_SIZE => 4096;
use constant ONE_YEAR => 365.2425 * 24 * 60 * 60;
use constant PI => 4 * atan2 1, 1;
use constant DEBUGGING => 0;
use constant ORACLE => 'oracle@cs.indiana.edu';
use constant USERNAME => scalar getpwuid($<);
use constant USERINFO => getpwuid($<);

sub deg2rad { PI * $_[0] / 180 }

print "This line does nothing" unless DEBUGGING;

DESCRIPTION

This will declare a symbol to be a constant with the given scalar or list value.