The following module was proposed for inclusion in the Module List: modid: Object::Hybrid DSLIP: bdpOp description: promote Perl primitives to hybrid objects userid: METADOO (Alexandr Kononoff) chapterid: 6 (Data_Type_Utilities) communities:
similar: autobox rationale: In Perl objects and primitives are different things. Hybrid object is a special case of Perl object that can be seen and treated as both primitive and object at the same time. In general case, it is a violation of object encapsulation to access object's underlying bless()ed primitive directly (at least outside of class's methods), but in special case of hybrid objects it is perfectly ok to do so - no violation of encapsulation takes place. The Object::Hybrid implements default hybrid class and exports promote() function that bless()es Perl's primitives (hash, scalar, array, or filehandle) into either default or user-specified (custom) hybrid class to make them hybrid objects. enteredby: METADOO (Alexandr Kononoff) enteredon: Fri Mar 29 02:02:20 2013 GMT The resulting entry would be: Object:: ::Hybrid bdpOp promote Perl primitives to hybrid objects METADOO Thanks for registering, -- The PAUSE PS: The following links are only valid for module list maintainers: Registration form with editing capabilities: https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=67c00000_72bc8f6940691ff7&SUBMIT_pause99_add_mod_preview=1 Immediate (one click) registration: https://pause.perl.org/pause/authenquery?ACTION=add_mod&USERID=67c00000_72bc8f6940691ff7&SUBMIT_pause99_add_mod_insertit=1 Peek at the current permissions: https://pause.perl.org/pause/authenquery?pause99_peek_perms_by=me&pause99_peek_perms_query=Object%3A%3AHybrid