Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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.

Arjen


Comment on Re: Functions to Methods
Select or Download Code
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
Node Status?
node history
Node Type: note [id://366531]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-12-21 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (100 votes), past polls