in reply to Re: Looking for some insight on Tie::File
in thread Looking for some insight on Tie::File

I'll ask straight up... why in the name of all things good are you advising to use symbolic references? After I read that, I found it hard to identify how this even answers the OP's question. There's no explanation of deref'ing a hash reference, and your use of local our ... seems way off as well.

I very rarely take issue with posts here, but unless you wrote the code that OP has displayed, what you're saying is pretty bad advice.

Replies are listed 'Best First'.
Re^3: Looking for some insight on Tie::File
by Anonymous Monk on Jan 09, 2016 at 00:49 UTC

    I'll ask straight up... why in the name of all things good are you advising to use symbolic references? After I read that, I found it hard to identify how this even answers the OP's question.

    Try it and you will see, it lets the OP use @array instead of $ref

      My bad... I'll re-state... "an unbounded, unconfined and completely dangerous assignment to a variable namespace that has global symbolic table access. This clobberes the symtab, which is *always* a bad idea, unless you *really* know what you're doing". No matter how you word it, it's very bad advice.

      Update: The people answering questions should *always* ensure their responses work properly without issue under the strict and warnings pragmas, and thereafter, advise the OP to do so as well.

        My bad... I'll re-state... "an unbounded, unconfined and completely dangerous assignment to a variable namespace that has global symbolic table access. This clobberes the symtab, which is *always* a bad idea, unless you *really* know what you're doing". No matter how you word it, it's very bad advice.

        The re-statement is also wrong

        It neither unbounded nor unconfined, its limited to the subs the OP has ... or the file

        It also isn't completely dangerous

        Nor is it "an assignment to a variable namespace that has global symbollic table access"

        It overrides one single symbol exactly, with lexical scoping (ie safe), temporarily

        You're wrong, learn from it

        Update: The people answering questions should *always* ensure their responses work properly without issue under the strict and warnings pragmas, and thereafter, advise the OP to do so as well.

        This guys answer does work under both strict and warnings

        Al so, there is no such requirement for posting on perlmonks