Hopefully a nice and easy problem for the monks to solve here:
I have a variable ($string) that contains some script. The script in $string is more than one line long and the content can vary. At the start and the end of the variable are newline characters and I need to remove these. At the moment I've successfully been able to remove the newline character from the end of the string using chomp as so:
chomp $string;
Does anyone know how to remove the newline character from the start of $string? My first thought is to use regular expressions, although I wouldn't know how to write this, especially when there are likely to be other newline characters between the start and the end.
Many thanks :)