vwbusguy, to random
@vwbusguy@mastodon.online avatar

I just had an AI help me write some necessarily regex heavy stuff and I'm not complaining about that.

vwbusguy,
@vwbusguy@mastodon.online avatar

There was some stuff I wasn't sure how to sanely do with and thought I might have to resort to a script and the AI helped me get out of the weeds with the playbook.

ovid, to random
@ovid@fosstodon.org avatar

Hey, devs. Do you use DBIx::Class::Schema::Loader? Do you also use Perl::Tidy? You can get disappointed if Perl::Tidy reformats the dbic files, so drop this in your .perltidyrc to stop that:

Ignore DBIC-generated content

--format-skipping-begin='#(<<<| DO NOT MODIFY THE FIRST PART OF THIS FILE)'
--format-skipping-end='#(>>>| DO NOT MODIFY THIS OR ANYTHING ABOVE!)'

tripleo, to random
@tripleo@fosstodon.org avatar

All you nutcases still using , what's actually wrong with it?

aka What are the sharp edges?

leonerd,
@leonerd@fosstodon.org avatar

@tripleo If you want decent integration with 3rd party stuff (google APIs, amazon, etc...) you may need to write your own client stuff as most big service providers seem to have forgotten that exists

mjgardner, (edited )

@tripleo ’s “sharp edges” are mainly early syntax and features that later experience with large and networked found dangerous, but are preserved for backward (and we do mean “backward”) compatibility.

See the details of the strict and warnings pragmas, and successively missing items in feature bundles:

https://perldoc.perl.org/strict
https://perldoc.perl.org/warnings
https://perldoc.perl.org/feature#FEATURE-BUNDLES

And the summary of policies included in : https://MetaCPAN.org/pod/Perl::Critic::PolicySummary

mjgardner,

@tripleo I would also be remiss not to mention #Perl's included perltrap manual page, which notes both the strict and warnings pragmas and also has nice lists of things for those coming from other #programming languages and tools like #AWK, #C and #CPlusPlus, #JavaScript, #sed, and #shell.

https://perldoc.perl.org/perltrap

gisgeek,
@gisgeek@floss.social avatar

@leonerd @tripleo I can only confirm this, even if currently FFI support does allow to bind to C/C++ quite easily. I find the general situation much better of other seasoned languages such as or , instead.

mjgardner,

@gisgeek I’m a little confused: are you saying that and are better than or worse regarding third-party / integrations?

/ @leonerd @tripleo

mjgardner,

@tripleo That link returns a “Not Found” page.

If you’re looking for documentation on 's bless function, you'll find it here: https://perldoc.perl.org/functions/bless

Most people are better served with an OO system rather than raw bless calls in Perl. See https://perldoc.perl.org/perlootut#PERL-OO-SYSTEMS for a discussion.

You can also investigate the currently experimental class feature that brings native OOP keywords to Perl: https://perldoc.perl.org/perlclass

Or do you have a different question?

mjgardner,

@tripleo You’re thinking of ’s “taint mode” (stop your teenage giggling), where outside data is untrusted unless it’s the extracted subpattern match in a .

It’s only enabled under certain conditions. Read about it in the perlsec manual page: https://perldoc.perl.org/perlsec#Taint-mode

mjgardner,

@tripleo BTW, I’m quite chuffed you’re taking an interest in . Enjoy the ride!

mjgardner,

@tripleo You could use 's taint mode for web inputs, but that’s a big performance-reducing hammer affecting everything outside your program: command line arguments, environment variables, locale, file input, certain system calls, etc.. It also breaks many modules, including popular web application frameworks.

There's no one-size-fits-all solution, so use whatever’s appropriate for your web input. Start with @owasp’s Top 10: https://OWASP.org/www-project-top-ten/

mjgardner,

@tripleo Like I said in https://social.sdf.org/@mjgardner/112476483573909633, the only feature built in to for untrusted data is taint mode.

You might have heard of it or used it 25 years ago with simple scripts (and that still works!) but as I said in https://social.sdf.org/@mjgardner/112481166820565063, it breaks a lot of modern code.

It’s also no silver bullet: a taint failure is a fatal exception and it’s up to the developer to handle that gracefully.

ovid, to Lisp
@ovid@fosstodon.org avatar

, , and are three powerful programming languages that share a common feature.

Nobody knows how the hell to capitalize them.

RogerBW, to raku
@RogerBW@emacs.ch avatar
ovid, to random
@ovid@fosstodon.org avatar

If any gurus want to take a look at a small bug in some code I wrote, I'd appreciate it. https://github.com/Ovid/unset-vars/issues/1

oalders, to programming
@oalders@fosstodon.org avatar

I'm handling sponsorships for this year's Perl and Raku Conference. Please share this far and wide so that we can get as many new sponsors as possible. ❤️

https://www.perl.com/article/this-is-your-opportunity-to-sponsor-the-perl-and-raku-conference-2024/

@perl @tag@relay.fedi.buzz

sjn,
@sjn@chaos.social avatar

@oalders @perl @tag@relay.fedi.buzz

Everyone! If your #business depends on #Perl or #RakuLang please consider supporting the communities you rely on!

One good way to ensure a sustainable future for #OpenSource ecosystems like these, is to support active and fertile venues for learning and teaching these technologies.

Right now, you can help by supporting the Perl and Raku Conference, and later this year, the London Perl Workshop.

Is this relevant for you? Forward it to your manager! 💯

ovid, to random
@ovid@fosstodon.org avatar

just wrote the following code for me, complete with the comment, which is correct.

my $UNINIT = bless => {}, 'Uninitialized::Vars::Variable';
sub uninit () { $UNINIT }
sub is_uninit ($var) { $var == $UNINIT } # XXX: This is wrong

charadon, to random
@charadon@8bit.red avatar

So, I know it's sacrilege to make your own "Build System", but for fun, I decided to give it a go.

It's made up of 3 #Perl scripts:

  • build.pl: Builds the project
  • clean.pl: Cleans up artifacts
  • install.pl: Installs artifacts where they need to go in the system.

build.pl was the most complicated, but that's not saying much, it was incredibly easy to make and it's small. It even supports parallel jobs and not rebuilding an object if the source file is older than the object.

Serpent7776, to random
@Serpent7776@mastodon.social avatar

I just wasted 1hr, because I used == instead of eq and 'and' instead of && in

mjgardner,

@Serpent7776 use warnings; (or the -w switch for a one-line command) would have helped catch the first problem: https://perldoc.perl.org/warnings

You would then see “Argument "foo" isn't numeric in numeric eq (==)” along with the line number in the code and the string you were trying to compare instead of “foo”: https://perldoc.perl.org/perldiag#Argument-%22%25s%22-isn't-numeric%25s

If you have 2022’s version 5.36 or later, use v5.36; will enable warnings as well as other sane defaults.

/ @perl

mjgardner, (edited )

@Serpent7776 I’m sorry to hear about the warnings lost in the output.

Since you’ve got #Perl v5.38.2, write use v5.38; and in addition to strict and warnings you enable the following niceties from https://perldoc.perl.org/feature :

bitwise
current_sub
evalbytes
fc
isa
module_true
postderef_qq
say
signatures
state
unicode_eval
unicode_strings

You’ll also disable these footgun “features”:

bareword_filehandles
indirect
multidimensional
switch

Give it a whirl!

/ @perl

RogerBW, to raku
@RogerBW@emacs.ch avatar
mjgardner, to perl

@perl Remember folks, #Perl's #camel is a dromedary 🐪, not a Bactrian 🐫:

perl -CS -pe 's/\N{BACTRIAN CAMEL}/\N{DROMEDARY CAMEL}/gu'  
  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • Durango
  • megavids
  • InstantRegret
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • osvaldo12
  • modclub
  • normalnudes
  • provamag3
  • tester
  • anitta
  • Leos
  • lostlight
  • All magazines