Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Functions to Methods

by Aragorn (Curate)
on Jun 14, 2004 at 13:32 UTC ( #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.


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,

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2022-10-02 07:23 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (8 votes). Check out past polls.