Another alternative:
#!/usr/bin/perl
use warnings;
use strict;
my $eol = '[\n\r\x0A\x0D]';
$/ = '';
while () {
print /^(.*):$eol([^ ]*)/ ? "$1/$2\n" : $_;
}
__DATA__
$/Dev/something/something.com/blah1:
default.asp userExc 26/07/04 1:42p
[TEST-DEV]F:\content\blah\wwwroot\bla
Roman Hanousek wrote:
Hi
Hello,
I have a txt file that contains the following info:
Text start here
$/Dev/something/something.com/blah1:
default.asp userExc 26/07/04 1:42p
[TEST-DEV]F:\content\blah\wwwroot\blah1
$/Dev/something/something.com/som
Hi Roman,
Roman wrote:
> use strict;
>
> my $file = shift;
> my $line;
>
>
> open(IN, "<$file") || die "$!";
> while($line =)
> {
>$line =~ /(\$\S+):.(\S+)/is;
>
>print "match1: $1; match2: $2 \n";
> }
I would redefine the record separator for your while loop to process
each of the four re