The following snippet removes the first character from all the lines in a file.
$file = "d:\\temp.txt";
open (FILE, $file) || die $!;
while (<FILE>) {
$val = substr $_, 1;
push (@lines, $val);
}
close FILE;
open (FILE, ">$file") || die $!;
seek FILE, 0, 0;
truncate $file, 0;
print FILE @lines;