Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by RonW (Parson)
on Aug 28, 2018 at 23:50 UTC ( #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? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-10-21 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (83 votes). Check out past polls.

    Notices?