SYNOPSIS

DESCRIPTION

Scalar::Util
contains a selection of subroutines that people have expressed
would be nice to have in the perl core, but the usage would not really be high
enough to warrant the use of a keyword, and the size so small such that being
individual extensions would be wasteful.

By default Scalar::Util
does not export any subroutines.

FUNCTIONS FOR REFERENCES

The following functions all perform some useful activity on reference values.

weaken

weaken($ref);

The lvalue $ref
will be turned into a weak reference. This means that it
will not hold a reference count on the object it references. Also when the
reference count on that object reaches zero, the reference will be set to
undef. This function mutates the lvalue passed as its argument and returns no
value.

This is useful for keeping copies of references, but you don't want to prevent
the object being DESTROY-ed at its usual time.

This will indeed remove all references to destroyed objects, but the remaining
references to objects will be strong, causing the remaining objects to never be
destroyed because there is now always a strong reference to them in the @object
array.

unweaken

unweaken($ref);

Since version 1.36.

The lvalue REF
will be turned from a weak reference back into a normal
(strong) reference again. This function mutates the lvalue passed as its
argument and returns no value. This undoes the action performed by
weaken.

This function is slightly neater and more convenient than the
otherwise-equivalent code

DIAGNOSTICS

The version of perl that you are using does not implement weak references, to
use isweak or weaken you will need to use a newer release of perl.

Vstrings are not implemented in the version of perl

The version of perl that you are using does not implement Vstrings, to use
isvstring you will need to use a newer release of perl.

NAME
is only available with the XS version of Scalar::Util

Scalar::Util
contains both perl and C implementations of many of its
functions so that those without access to a C compiler may still use it.
However some of the functions are only available when a C compiler was
available to compile the XS version of the extension.

Copyright (c) 1999 Tuomas J. Lukka <lukka@iki.fi>. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as perl itself.

Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
Copyright (C) 2014 cPanel Inc. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.