- or download this
$dir= $ENV{TMPDIR} || "/tmp";
$file ||= "default";
- or download this
$size= defined $ENV{MAXSIZE} ? $ENV{MAXSIZE} : -1;
$size= -1 if ! defined $size;
- or download this
$size= def( $ENV{MAXSIZE}, -1 );
def( $size, -1 ); # void context causes $size to be modified
...
# The third argument above forces $size to be modified
# even though no void context used. An alternative is:
if( 0 < ( $size= def $ENV{MAXSIZE), -1 ) )
- or download this
sub def {
my( $val, $alt, $force )= @_;
...
$_[0]= $val if ! defined wantarray || $force;
return $val;
}