in reply to cmd o/p- each line should be stored as each element in an Array?

How can this be acheived?
It can be achieved thus:
perl -ne 'chomp; push @x,$_' Your_file_name
or, more traditionally:
chomp ( my @x = <> );
What have you tried ?

        Our business is run on trust. We trust you will pay in advance.

Replies are listed 'Best First'.
Re^2: cmd o/p- each line should be stored as each element in an Array?
by G Nagasri Varma (Novice) on Dec 03, 2015 at 10:26 UTC
    chomp ( my @x = <> );
    The above one worked, but array is getting all the entire list of values. But in the index zero, why isnt first value being stored.
    o/p:
    1431037440 1431038327
    $files[0]=
    $files1=1431037440

      Is there an empty line at the beginning of your input file?

      If that's not the case, you should try to create an →SSCCE
      To filter out empty lines (or lines not containing digits), try:
      chomp ( my @x = grep{/\d/} <> );

              Our business is run on trust. We trust you will pay in advance.