Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    Hash::NoRef 0.03

    Download button

    No screenshots available
    Downloads: 354  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Graciliano M. P. | More programs
    Perl Artistic License / FREE
    October 14th, 2007, 03:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Hash::NoRef description

    Hash::NoRef is a HASH that store values without increase the reference count (weak references).

    Hash::NoRef is a HASH that store values without increase the reference count (weak references).

    This HASH will store it's values without increase the reference count. This can be used to store objects but without interfere in the DESTROY mechanism, since the reference in this HASH won't count.

    USAGE

    use Hash::NoRef ;

    my %hash ;
    tie(%hash , 'Hash::NoRef') ;

    ...

    ## Or getting a HASH ref tied:

    my $hash = new Hash::NoRef() ;

    {
    my $obj = new FOO() ;
    $hash->{obj} = $obj ;
    ## When we exit this block $obj will be destroied,
    ## even with it stored in $hash->{obj}
    }

    $hash->{obj} ## is undef now!

    FUNTIONS

    SvREFCNT ( REF )

    Return the reference count of a reference. If a reference is not paste it will return -1. Dead references will return 0.

    SvREFCNT_inc ( REF )

    Increase the reference count.

    SvREFCNT_dec ( REF )

    Decrease the reference count.

    EXAMPLES:

    my $var = 123 ;
    $refcnt = Hash::NoRef::SvREFCNT( $var ) ; ## returns 1

    Hash::NoRef::SvREFCNT_inc($var) ; ## adda fake reference, so, it will never die.
    Hash::NoRef::SvREFCNT_dec($var) ; ## get back to the normal reference count.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    hash values | reference count | Perl module | hash | store | values

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM