Skip to main content



I have an input string that has "comments" in it that are in the form of: everything after a ; is considered a comment. I want to remove all comments from the string and get the raw text out. This is a pretty simple regexp replace except for the fact that ; characters are valid non-comments inside of double quoted strings.

How can I improve the remove_comments() function to handle quoted strings with semi-colons in them correctly?

```perl use v5.36;

my $str = 'Raw data ; This is a full-line comment More data ; comment after it Some data "and a quoted string; this is NOT a comment"';

my $clean = remove_comments($str);

print "Before:\n$str\n\nAfter:\n$clean\n";

sub remove_comments { my $in = shift();

$in =~ s/;.*//g; # Remove everything after the ; to EOL return $in; 

} ```

submitted by /u/scottchiefbaker
[link] [comments]



Hi,

im looking to put my website written in perl that currently runs locally inside apache out on the internet.

I dont want to host myself, and i dont have lots of spare time to config or money to spend for a vps.

Does anyone have experiences and can recommend a webhoster for maybe 10-15 bucks a month where i can just get a simple interface with ssh, where i can put an index.cgi somewhere(dont care if its in cgi-bin or public_html or something else,

i want something where i can just checkout my git repo thta contains index.cgi in its root and just works.

Thank you in advance!

submitted by /u/throwawaybambo
[link] [comments]



Thanks to a pile of new data added and old data cleaned up (most of that work done by Philippe Bruhat and Aristotle Pagaltzis) and some help from Copilot on the Javascript, there's a lot of new, interesting information on my Perl Steering Council web page - https://psc.perlhacks.com/

submitted by /u/davorg
[link] [comments]




submitted by /u/niceperl
[link] [comments]



List of new CPAN distributions – Apr 2024 submitted by /u/perlancar
[link] [comments]




submitted by /u/niceperl
[link] [comments]


Mo utilities for email.

Changes for 0.02 - 2024-04-26T23:02:53+02:00

  • Add tests for error parameters.
  • Rewrite the tests so that the functional tests are first and then the errors.