Convert-Scalar
view release on metacpan or search on metacpan
606162636465666768697071727374
- some functions now
return
the modified
scalar
, enabling a more
"functional"
style, e.g.
return
utf2,
join
""
,...;
0.03 Sun Sep 3 04:55:53 CEST 2000
- added
"utf8/utf8_on/utf8_off"
functions.
- added grow as an interface to sv_grow.
interface.
0.02 Sat Jul 15 22:37:36 CEST 2000
- added missing functions weaken and unmagic to EXPORT_OK.
This happens
when
you upload too quickly :*]
0.01 Sat Jul 15 20:15:47 CEST 2000
- original version; leftover
"garbage"
from the PApp module
697071727374757677787980818283848586878889readonly_on
scalar
Sets the readonly flag on the
scalar
.
readonly_off
scalar
Clears the readonly flag on the
scalar
.
unmagic
scalar
, type
Remove the specified magic from the
scalar
(DANGEROUS!).
weaken
scalar
Weaken a reference. (See also WeakRef).
taint
scalar
Taint the
scalar
.
tainted
scalar
returns true
when
the
scalar
is tainted, false otherwise.
untaint
scalar
Remove the tainted flag from the specified
scalar
.
140141142143144145146147148149150151152153154155156157158159160refcnt
scalar
[, newrefcnt]
Returns the current reference count of the
given
scalar
and
optionally sets it to the
given
reference count.
refcnt_inc
scalar
Increments the reference count of the
given
scalar
inplace.
refcnt_dec
scalar
Decrements the reference count of the
given
scalar
inplace. Use
"weaken"
instead
if
you understand what this function is fore.
refcnt_rv
scalar
[, newrefcnt]
Works like
"refcnt"
, but dereferences the
given
reference first.
This is useful to find the reference count of arrays or hashes,
which cannot be passed directly. Remember that taking a reference of
some object increases it's reference count, so the reference count
used by the
*_rv
-functions tend to be one higher.
refcnt_inc_rv
scalar
2122232425262728293031323334353637383940=over 4
=cut
package
Convert::Scalar;
BEGIN {
$VERSION
= 1.12;
@ISA
=
qw(Exporter)
;
@EXPORT_OK
=
qw(readonly readonly_on readonly_off weaken unmagic len grow extend extend_read readall writeall)
;
%EXPORT_TAGS
= (
taint
=> [
qw(taint untaint tainted)
],
utf8
=> [
qw(utf8 utf8_on utf8_off utf8_valid utf8_upgrade utf8_downgrade utf8_encode utf8_decode utf8_length)
],
refcnt
=> [
qw(refcnt refcnt_inc refcnt_dec refcnt_rv refcnt_inc_rv refcnt_dec_rv)
],
ok
=> [
qw(ok uok rok pok nok niok)
],
);
Exporter::export_ok_tags(
keys
%EXPORT_TAGS
);
106107108109110111112113114115116117118119120121122123124125126Sets the readonly flag on the
scalar
.
=item readonly_off scalar
Clears the readonly flag on the scalar.
=item unmagic scalar, type
Remove the specified magic from the scalar (DANGEROUS!).
=item weaken scalar
Weaken a reference. (See also L<WeakRef>).
=item taint scalar
Taint the scalar.
=item tainted scalar
returns true when the scalar is tainted, false otherwise.
186187188189190191192193194195196197198199200201202203204205206Returns the current reference count of the
given
scalar
and optionally sets it to
the
given
reference count.
=item refcnt_inc scalar
Increments the reference count of the given scalar inplace.
=item refcnt_dec scalar
Decrements the reference count of the given scalar inplace. Use C<weaken>
instead if you understand what this function is fore. Better yet: don't
use this module in this case.
=item refcnt_rv scalar[, newrefcnt]
Works like C<refcnt>, but dereferences the given reference first. This is
useful to find the reference count of arrays or hashes, which cannot be
passed directly. Remember that taking a reference of some object increases
it's reference count, so the reference count used by the C<*_rv>-functions
tend to be one higher.
149150151152153154155156157158159160161162163164165166167168169170171readonly_off (SV
*scalar
)
CODE:
SvREADONLY_off (
scalar
);
void
unmagic (SV
*scalar
, char type)
CODE:
sv_unmagic (
scalar
, type);
void
weaken (SV
*scalar
)
CODE:
sv_rvweaken (
scalar
);
void
taint (SV
*scalar
)
CODE:
SvTAINTED_on (
scalar
);
bool
tainted (SV
*scalar
)
CODE:
RETVAL = !!SvTAINTED (
scalar
);
( run in 0.335 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )