... while ( $line = <> ) ... #### [2012-09-14 16:55:22,498] [ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)' (com.this.perl.seems.kinda.Cool:di sconnectCORBA:154) INFO - Well this is just one line text [2012-09-14 16:55:22,498] [ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)' (com.this.perl.seems.kinda.Cool:di sconnectCORBA:154) INFO - Well this is just multiple line text With formats Like this ***** Some other text **** then some more text on another line [2012-09-14 16:55:22,498] [ACTIVE] ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)' (com.this.perl.seems.kinda.Cool:di sconnectCORBA:154) INFO - Well once again this is part starts with bracket and blah blah blah #### use strict; use warnings; my @infos; { local $/; open my $fh, '<', 'logFile.txt' or die $!; my $data = <$fh>; push @infos, $1 while $data =~ /INFO - (.+?)(\[\d{4}|\Z)/gs; } chomp @infos; print join "\n--##--\n", @infos; #### Well this is just one line text --##-- Well this is just multiple line text With formats Like this ***** Some other text **** then some more text on another line --##-- Well once again this is part starts with bracket and blah blah blah