in reply to Re^2: Variable interpolation of object methods
in thread Variable interpolation of object methods

are you creating a reference to this variable $gene->display_id and then deferencing it straight away with ${ } Why do you have to do this? Why doesnt perl perform variable interpolation of these types of things out of the box as it were?

Replies are listed 'Best First'.
Re^4: Variable interpolation of object methods
by BrowserUk (Patriarch) on Oct 30, 2010 at 23:55 UTC

    When the interpolation has read $gene, it stops parsing and so never sees the dereference (->).

    Whereas, inside ${ ... }, it expect any code, so it is parsed using the full Perl parser, rather than a limited parser looking only for a variable name.

    Note:That's my fits-the-evidence assumption, not definitive deep source-diving knowledge.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.