in reply to Why do I get this error?

edit

$" is a special variable defining how array elements are separated within a string interpolation. Its set by default, if its missing now then YOU must have set it to undef before. See $LIST_SEPARATOR in perlvar

some more thoughts

Do you use strict and warnings?

Why do you iterate so complicated instead of using a foreach $elem (@array) ... etc ?

Why a string interpolation instead of join "\t", @$elem ?

Cheers Rolf

( addicted to the Perl Programming Language)

Replies are listed 'Best First'.
Re^2: Why do I get this error?
by Anonymous Monk on May 12, 2014 at 00:49 UTC
    But I have a Array of Arrays there...
    How can I use join?
    Also, if you use foreach, doesn't it mean that you lose the order of elements? Or not?
      > But I have a Array of Arrays there...

      $elem is an array ref, you can also call it $a_ref or whatever explains best the content ($a_row for instance)

      > How can I use join?

      like shown, did you notice the @ in front of @$elem, it dereferences the array ref.

      > Also, if you use foreach, doesn't it mean that you lose the order of elements?

      Nope! Try it out...

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        Thank you for your help! Unfortunatelly it doesn't work, it still says the same thing! Actually, this code worked just fine, but I wanted to implement the "use strict" mode and added "my" etc and now I get this stupid error... The printing is done, but the warning remains (as it was before)...
      And regarding the $", I didn't do anything, it's actually first time I come across this thing...I don't know what I am supposed to do to be honest!
        > I didn't do anything,

        Well someone did cause Perl doesn't without being told so.

        It's a global variable, who knows where it happens in your code.

        Thats why we preach to always localize any change to special vars.

        Cheers Rolf

        ( addicted to the Perl Programming Language)

        PS: It's late, good night! :)