Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How might I return tied scalar that does not have to be dereferenced as $$scalar?

by dada (Chaplain)
on Sep 20, 2002 at 12:12 UTC ( [id://199446]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $d = "Nov 25, 1971";
    print "\$d contains $d\n"; # "Nov 25, 1971"
    print "\$d as unixtime:", $d->to_unixtime, "\n";
    
  2. or download this
    Can't locate object method "to_unixtime" via package "Nov 25, 1971" (perhaps you forgot to load "Nov 25, 1971"?)
  3. or download this
    Datum->tieVar( (my $d), -type=>'date' );
    
    $d = "Nov 25, 1971";
    ...
    sub to_unixtime {
        return "foobar";
    }
    
  4. or download this
    $d contains Nov 25, 1971
    $d as unixtime:foobar
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-29 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found