in reply to Push the each group item into array

It sounds like you want something like:

my $InputFile = "sample_log_file.txt"; open my $IN, '<', $InputFile or die "cannot open $each_file for writin +g: $!"; undef $/; # undef by default if localized my @all_metrics = <$IN> =~ /[^>]+/g; print Dumper( \@all_metrics ); close $IN;

Replies are listed 'Best First'.
Re^2: Push the each group item into array
by senthil_v (Sexton) on Jun 07, 2011 at 06:48 UTC

    Thanks for code.

    it really works here. i got output here. but i need made some modification before put pattern as ur pattern /^>+/. because i need to read the first and last line of text file. because i add manually added '>' symbol in first and last line. In ur code i could not able put pattern

    $line =~ s{^(RTRV)}{\>$1}gsi;

    $line =~ s{(\"\s+)(;)}{$1\>$2}gsi;