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]
[link] [comments]
(cdxcix) 11 great CPAN modules released last week
Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12. Ali...niceperl.blogspot.com
submitted by /u/perlancar [link] [comments] |
List of new CPAN distributions – Apr 2024
dist author abstract date AI-Ollama-Client CORION Client for AI::Ollama 2024-04-05T09:15:33 Acme-CPANModules-BPOM-FoodRegistration PERLANCAR List of modules and utilities related to Food Registrati…perlancar's blog
[link] [comments]
(cdxciii) 15 great CPAN modules released last week
Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12. App...niceperl.blogspot.com
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.
A Perl implementation of the OpenTelemetry standard
Changes for 0.020 - 2024-04-25T18:54:56+01:00
- Switch LWP::UserAgent integration to wrap around that module's 'simple_request' method instead of its 'request' method. This should catch some more cases, and fix GH #13.
- Added a minimal example application. See the `examples` directory in the distribution files.
An object to manage running things in parallel processes.
Changes for 0.014 - 2024-04-25T16:08:40+01:00
- Move to Dist::Zilla
- Switch to Test2::V0
Non linear optimization routines for PDL
Changes for 0.09 - 2024-04-25
- fix compiler warnings on pointer types (#7) - thanks @YuryPakhomov for report
Hi! Asking for a wisdom here...
We have a module that modifies signal handler $SIG{__DIE__} to log information and to die afterwards. Hundreds of scripts relied on this module which worked fine in perl 5.10.1.
Recently we had the opportunity to install several Perl versions but unfortunately a large number of scripts that used to work with Perl 5.10.1 now behave differently:
- Failed in 5.14.4:
/home/dev/perl-5.14.4/bin/perl -wc
test.pl
RECEIVED SIGNAL - S_IFFIFO is not a valid Fcntl macro at /home/dev/perl-5.14.4/lib/5.14.4/File/stat.pm line 41
- Worked without changes in 5.26.3:
/home/dev/perl-5.26.3/bin/perl -wc
test.pl
test.pl
syntax OK
- Worked without changes in 5.38.2:
/home/dev/perl-5.38.2/bin/perl -wc test.pl
test.pl syntax OK
Many of the scripts can only be updated to 5.14.4 due to the huge jumps between 5.10 and 3.58; But we are stuck on that failures.
Was there an internal Perl change in 5.14 which cause the failures but works on other recent versions without any update on the scripts?
Cheerio!
submitted by /u/Longjumping_Army_525
[link] [comments]
Sanity-check calling context
Changes for 0.04
- (no code changes)
- Switched to MIT license.
- Switched README from POD to Markdown.
- Removed Travis CI.
Sort lines of text by a SortKey module
Changes for 0.001 - 2024-03-07
- First release.
Sort lines of text by a Comparer module
Changes for 0.002 - 2024-03-07
- No functional changes.
- [doc] Mention some related links.
An assortment of date-/time-related CLI utilities
Changes for 0.128 - 2024-03-07
- [clis strftime, strftimeq] Use localtime() instead of gmtime(). We can still show UTC using "TZ=UTC strftime ...".
I understand that many disagree with this statement, but it really makes it easier to build distributions for people who not monks. Wish the documentation was more detailed
submitted by /u/ReplacementSlight413
[link] [comments]
Sah schemas related to BCA (Bank Central Asia) bank
Changes for 0.002 - 2024-04-03
- Rename module/dist Sah-Schema{s,Bundle}-* following rename of Sah-Schema{s,Bundle} (for visual clarity and consistency with naming of other bundles).
search nested hashref/arrayref structures using JSONPath
Changes for 1.0.5 - 2024-04-22T16:10:46-05:00
simulating paper and pencil techniques for basic arithmetic operations
Changes for 0.01 - 2024-04
- First version, with the four basic operations, plus square-root, GCD and radix conversion. And HTML rendering