in reply to Re: Compressing a text file using count of continous characters
in thread Compressing a text file using count of continous characters
sub encode { $_ = shift; s/((\D)\2+)/length($1).$2/eg; $_ } sub decode { $_ = shift; s/(\d+)(\D)/$2 x $1/eg; $_ }
|
|---|