Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

OO systems and Perl 5 (Was: Recap: Future of Perl 5)

by RonW (Parson)
on Aug 28, 2018 at 23:50 UTC ( [id://1221283]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Object subclass: 'Point' instanceVariables: 'x y '
    
    ...
    init
     x := Float new.
     y := Float new.
    
  2. or download this
    p := Point new.
    p init.
    p x: 1.5.
    p y: 1.5.
    
  3. or download this
    my $p = bless {}, Point;
    $p->init;
    $p->x(1.5);
    $p->y(1.5);
    
  4. or download this
    newX: xc Y: yc
     p := Point new.
    ...
     p x: xc.
     p y: yc.
     ^p
    
  5. or download this
    Point newX: 1.5 Y: 1.5.
    
  6. or download this
    sub init
    {
    ...
        $object->init(@_);
        return $object;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://1221283]
Approved by marto
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 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found