in reply to Re^4: Benefits of everything is an object? Or new sigils?
in thread Benefits of everything is an object? Or new sigils?

You've been poluting your namespaces all the time until you suddenly decided what used to be an array should now be an object. You've been thinking "within the chains of the old functions", not me. You are the one who decided the @employees should be an array, not an object.

Jenda
Enoch was right!
Enjoy the last years of Rome.

  • Comment on Re^5: Benefits of everything is an object? Or new sigils?

Replies are listed 'Best First'.
Re^6: Benefits of everything is an object? Or new sigils?
by LanX (Saint) on Mar 02, 2010 at 13:56 UTC
    > You are the one who decided the @employees should be an array, not an object.

    Exactly what I'm saying, I took a wrong decision between two options, because I can't foresee the future. (I'm not as gifted as you are ;)

    In other languages this "error" is easily corrected without excessive use of extra code and symbols because these two options are unified into one...

    ... so why not simplifying the interface in Perl?

    Cheers Rolf

      If all you have is a hack, then definitely your decision process is simplified. No matter whether you want to hammer down a nail or screw a wood screw ... all you have is that hack. So you can't make a wrong decision.

      The decision did not affect just the sigil, it affected the layout of the code! Stuff you would write as a method if you chose to use an object got implemented as a top level function or an unnamed block, ... It's not just what sigil you use for the thing, it's how you treat it.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

        > It's not just what sigil you use for the thing, it's how you treat it.

        I can always treat $arr_ref as a normal array, e.g. with push @$arr_ref as long as I think it's just an array. And after tying its still valid code...

        The way you treat it is up to you, Perl has it all, and I'm tolerant.

        I'm just complaining about overcomplicated interfaces.

        Cheers Rolf