in reply to number of elements in array ref wtf

Why do I get '1' instead of 2? When looping throught the elements of @$full_buf I get two lines of text, so I should also get '2' in $nr_els but I get '1'.

Without having run the code, a quick guess: Are you sure $full_buf->[0] isn't just a single string with two lines in it? Use Data::Dump (or Data::Dumper with $Data::Dumper::Useqq=1;) to find out... (Basic debugging checklist)

Replies are listed 'Best First'.
Re^2: number of elements in array ref wtf
by natxo (Scribe) on Jul 13, 2017 at 19:20 UTC
    yes, spot on. Sorry for the noise.

      Hi,

      This 'noise' may point some other sufferer in the right direction in future.

      No need to apologize.

      J.C.