http://qs321.pair.com?node_id=1233689


in reply to Re^2: processing file content as string vs array
in thread processing file content as string vs array

You could try setting the Input Record Separator to '@user_info_end':

... # set the Input Record Separator $/ = '@user_info_end'; while ( my $file_content = <FILE> ) { # remove the Input Record Separator chomp $file_content; if ( $file_content =~ /\@user_info_start.*\n)(?s:(.*))/i ) { $user_info = $2; } ... } ...