Hello bezi1r,
Typically, the monks are generally nice. But, give them something more like what have you tried or where does the code fail. You will likely receive better help.
Try replacing the following bits in the code.
while ($$buffref =~ s/^(.*)\n//) {
print "$1";
}
With this.
while ($$buffref =~ s/([^\n]+)\n//) {
print "$1\n";
$$buffref =~ s/^\n//;
}
This works too, another way.
while ( (my $pos = index($$buffref, "\n")) >= 0 ) {
print substr($$buffref, 0, $pos + 1);
substr($$buffref, 0, $pos + 1, '');
}
Good luck.
|