Locked.pm

Provides scalar variables that you can lock and unlock. If you try to assign to a locked variable, your program aborts.

Usage:

	use Locked;

	new Locked 'VAR' => value;	# Assign new value
					# (or)
	new Locked 'VAR';		# Retain old value

	$VAR = NEWVAL;			# Fails if $VAR is locked

	Lock($VAR);			# Locks $VAR
	Unlock($VAR);			# Unlocks $VAR

	is_Locked($VAR);		# Returns true if $VAR is locked
	

Source Code

Notes

In the new call, there's no dollar sign on the variable name.

There is no test suite yet.

Lock and the other functions are capitalized because Perl already has a built-in lock operator that does something else.

Copyright 1999 Mark-Jason Dominus.


Return to: Perl Paraphernalia | Universe of Discourse | What's new page

mjd-perl-locked@plover.com