"a.c.a. serier" <a.serier at hccnet.nl> writes: > Perl has chomp() to do this. To chop (even if line is truly empty): line = line[:-1] To chomp: if line and line[-1] == '\n': line = line[:-1] You may remove the test for line if you know that it is not empty. -- François Pinard http://www.iro.umontreal.ca/~pinard