in reply to Inserting values into an array

Question is not clear.

With the assumption, i suggest push().

my @data; $/=""; while(<>) { $data=$_; push (@data, $data); print "@data\n"; }

Prasad

Replies are listed 'Best First'.
Re^2: Inserting values into an array
by Fletch (Bishop) on Jun 01, 2005 at 14:13 UTC

    That's great . . . if you want to copy each paragraph into a useless variable (that won't pass use strict, BTW) and print the entire accumulated contents so far for each paragraph you read.

    --
    We're looking for people in ATL

      Fletch, i know that it is useless variable, i just changed his coding by just including push statement. The OP may use that useless variable later in useful way, which we don't know.

      my @data; $/ = ''; while (<>){ push @data, $_; } print "@data";

      Prasad

        As you say you don't know, so don't cargo cult from their broken code. Give the simplest answer that works (but no simpler).

        --
        We're looking for people in ATL