in reply to Re: Re: reading data ...
in thread reading data ...

For Ionizer, to "un"obfuscate this a little, here's a step by step approach that basically does the same thing in a different way:
my @data = (); while (<DATA>) { # read one line chomp; # remove end-of-line character(s) s/\"//g; # remove double quotes if present push @data, [ $_ ]; # Create an anonymous array # *reference* with the current # line, and push that reference # onto the @data array. }
I was trying to explain the obfuscated statement made by jdporter, but it was too involved.

HTH.

Replies are listed 'Best First'.
Re: Re: Re: Re: reading data ...
by jdporter (Paladin) on Dec 18, 2002 at 16:14 UTC
    Thanks. Now I'll make a few comments and corrections.   my @data = (); That assignment isn't necessary. Arrays start out empty!      s/\"//g; That backwhack isn't necessary. Quote marks are literal in any quoted string that uses some other delimiter.      push @data, [ $_ ]; That isn't equivalent and won't work for the OP's purpose.
    You still need to split the string on commas.
    You could do it this way:
    my @a = split /,/; push @data, \@a;

    jdporter
    ...porque es dificil estar guapo y blanco.

      Thanks for the corrections!

      One question:
      push @data, [ $_ ]; That isn't equivalent and won't work for the OP's purpose. You still need to split the string on commas.
      Wasn't the OP looking for a solution that would put each *record* from <DATA> into an anonymous array reference, and then put that anonymous array ref into the @data array? If that is the goal, then why would you need to split the record on comma's?