Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Tie::AssignWrapper

by japhy (Canon)
on Sep 24, 2000 at 03:16 UTC ( [id://33808]=CUFP: print w/replies, xml ) Need Help??

This is a module, but it's so damn tiny, it's a snippet. There's an example of its use in the POD.
package Tie::AssignWrapper; sub TIESCALAR { bless \( $::{"$_[1]::"}{new}->(@_[1..$#_]) ), $_[0] } sub FETCH { ${ $_[0] } } sub STORE { (${ $_[0] })->AWstore($_[1]) } sub DESTROY { (${ $_[0] })->DESTROY } 1; __END__ =head1 NAME Tie::AssignWrapper - catch assignments to objects =head1 SYNOPSIS use Some::Module; use Tie::AssignWrapper; tie $obj, Tie::AssignWrapper => Some::Module => @args; print $obj->value; $obj = "new value"; print $obj->value; =head1 DESCRIPTION This module intercepts the assignment operator, and passes off the assignment to the module beneath it. It calls the C<AWstore> method (so make sure that's what you call it). =head1 AUTHOR Jeff "japhy" Pinyan CPAN ID: PINYAN japhy@pobox.com =cut

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://33808]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2025-03-17 18:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (56 votes). Check out past polls.