in reply to What?? delete chars.

I'm sure other people can point out better ways to do what you're trying to do, but I'll just point out that my data$ inside the while loop is causing $data to be set only in the scope of the while loop. Once you get out, $data goes away, and then the print $data; outside the loop is referring to a different variable, one called $data but in the outer scope.

I'll also note that $data inside the loop is getting overwritten every iteration of the loop.

Putting in use strict; and use warnings; at the top of the script would help point some of this out, as well.


Queue