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

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
  • Comment on Re^2: cmd o/p- each line should be stored as each element in an Array?

Replies are listed 'Best First'.
Re^3: cmd o/p- each line should be stored as each element in an Array?
by soonix (Chancellor) on Dec 03, 2015 at 12:48 UTC

    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
Re^3: cmd o/p- each line should be stored as each element in an Array?
by NetWallah (Canon) on Dec 03, 2015 at 21:55 UTC
    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.