[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] Object Oriented Perl question



>>>>> "Richard" == Richard Lowe <richlowe [at] btinternet.com> writes:

    Richard> Can anyone point me at any documentation that explains
    Richard> how to use an object, with an array of objects in it.

After looking at perlobj(1p) and perltoot(1p), my immediate reaction
is "`info python-tut' is your friend."  That's probably not very
helpful.[1]

    Richard> so i end up with a call like

    Richard> $blum->bar()[1]->name("fred");

Break it up into temp variables

@t = $blum->bar()
$u = $t[1]
$u->name("fred")

If that doesn't work your class defs are hosed.

Recombine with full parentheses, and then start removing "redundant"
parenthese until it breaks again.


Footnotes: 
[1]  It does explain why the various deb{conf,helper,...} packages are
so buggy.  You can't tell the difference between Perl code and random
strings without running it.

-- 
University of Tsukuba                Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Institute of Policy and Planning Sciences       Tel/fax: +81 (298) 53-5091
_________________  _________________  _________________  _________________
What are those straight lines for?  "XEmacs rules."
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.