Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Functions to Methods

by Aragorn (Curate)
on Jun 14, 2004 at 13:32 UTC ( [id://366531]=note: print w/replies, xml ) Need Help??


in reply to Functions to Methods

I can use functions to work with them. If I'd like to treat them like objects I've to change them into objects
... push @$obj, qw ( 12 19 35 37 48 98 25 ); ...
Especially to handle the object as reference to the Array looks odd (of course it's nothing else than an blessed arrayref).
First, you want to use an array as an object. You define an array class. Then you use the 'functional' interface again, which makes it ugly. Why not define a push method and call that?
$obj->push(qw ( 12 19 35 37 48 98 25 ));
The way you're doing it now is a bit halfhearted.

Arjen

Replies are listed 'Best First'.
Re^2: Functions to Methods
by neniro (Priest) on Jun 14, 2004 at 13:41 UTC
    The way you're doing it now is a bit halfhearted.

    You're right. I haven't thought it to this point. I've to wrap all possible functions to methods. I've only seen the first step and missed the whole picture.

    Thank you,
    neniro

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-19 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found