S
Sébastien Cottalorda
Hi all,
I use a regexp to split a network frame protocol like this.
#-------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
use constant ETX => chr( hex('03'));
use constant ACK => chr( hex('06'));
use constant NACK => chr( hex('15'));
my $endcar = ACK.'|'.NACK.'|'.ETX.'.{1}',
my $line = 'hello World'.ETX.'XHow are you today ?'.ETX.'XWell, not so
bad.'.ETX.'X';
while ($line =~ s/([^$endcar]*$endcar)//){
my $buf = $1;
print $buf."\n";
}
print "$line\n";
exit;
#--------------------------------------------------------------------
With 5.8.X version, I use to have:
hello World
How are you today ?
Well, not so bad.
Now I have :
X
X
X
hello WorldHow are you today ?Well, not so bad.
Could someone help me to solve that problem.
Thanks in advance for any help.
Cheers.
Sebastien
I use a regexp to split a network frame protocol like this.
#-------------------------------------------------------------------
#!/usr/bin/perl -w
use strict;
use constant ETX => chr( hex('03'));
use constant ACK => chr( hex('06'));
use constant NACK => chr( hex('15'));
my $endcar = ACK.'|'.NACK.'|'.ETX.'.{1}',
my $line = 'hello World'.ETX.'XHow are you today ?'.ETX.'XWell, not so
bad.'.ETX.'X';
while ($line =~ s/([^$endcar]*$endcar)//){
my $buf = $1;
print $buf."\n";
}
print "$line\n";
exit;
#--------------------------------------------------------------------
With 5.8.X version, I use to have:
hello World
How are you today ?
Well, not so bad.
Now I have :
X
X
X
hello WorldHow are you today ?Well, not so bad.
Could someone help me to solve that problem.
Thanks in advance for any help.
Cheers.
Sebastien