If you're having to match lines that start with # you can avoid using an expression if you do something like this:
foreach ($lines as $line) {
if ($line{0} != '#') {
// We have a non-comment, print it.
echo $line . '<br />';
}
}
foreachlanguagesphpprogrammingsyntax
Given an array @slobber, replace all the CR-LF with CR:
foreach (@slobber) {
s/\015\012$/\n/; print;
}
dosforeachlanguagesline-endingsperlprogrammingsyntaxunix