in reply to Perl Syntax/resources that we generally don't know or forget.

## remove comments: $str =~ s/(?:^|\n)[ \t]*#//gs ;
The juxtaposition leaves one to wonder, is the double ## style meant to be a comment resistant to removal?

Replies are listed 'Best First'.
Re: Re: Perl Syntax that we generally don't know or forget.
by gmpassos (Priest) on Jan 18, 2004 at 06:27 UTC
    I put this just as an example of use of (?:^|foo).

    Actually the code to remove a comment line should be:

    $str =~ s/(?:^|\n)[ \t]*#[^\r\n]*//gs ;
    Thanks for the advice. ;-P

    Graciliano M. P.
    "Creativity is the expression of the liberty".