TATMWTDIThere are too many ways to do it#19

pack()

sub pack01 {
  @c = unpack('c*',$_[0]);
  @p = grep($c[$_] == 46, 0..$#c);
  pop @p;
  while (defined($c = pop @p)) {
    splice(@c,$c,1,);
  }
  pack('c*',@c);
}
Copyright © 2005 Shlomi Fish