ovid, to random
@ovid@fosstodon.org avatar

If any #Perl #XS 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

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 #perl

mjgardner,
@mjgardner@social.sdf.org avatar

@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 #Perl version 5.36 or later, use v5.36; will enable warnings as well as other sane defaults.

/ @perl

mjgardner, (edited )
@mjgardner@social.sdf.org avatar

@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
@mjgardner@social.sdf.org avatar

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

perl -CS -pe 's/\N{BACTRIAN CAMEL}/\N{DROMEDARY CAMEL}/gu'  
metacpan, to programming
@metacpan@fosstodon.org avatar
dave, to random
@dave@puz.fun avatar

Anyone here have experience updating a Dockerized Perl application? Specifically I am looking for help upgrading the app from 5.26 to 5.30 and how to rectify errors where some libraries (I think?) were built for Perl 5.26 and won't work under 5.30?

#Perl #ModernPerl #PerlDev #Docker #Perl5

philsplace, to random
@philsplace@mastodon.sdf.org avatar

Dropping some Perl right in the middle of some Template::Toolkit code is the best thing about TT

mjgardner,
@mjgardner@social.sdf.org avatar

@philsplace
@perl “[ languages have] two problems: First, their little language is crippled. If you need to do something the author hasn't thought of, you lose. Second: Who wants to learn another language? You already know , so why not use it?“

Cut out the middleman and use Text::Template: https://metacpan.org/pod/Text::Template

RL_Dane, to raku
@RL_Dane@fosstodon.org avatar

Lol, #perl and #raku folks, I made a funny (in bash!)

#!/usr/bin/env bash

#Smart CD - uses my ulocate script and fzf to jump to any directory found within my home directory

set -u #treat undeclared variables as errors

function warn {
echo "$" >&2
}
function swoon { # (something in between a warn and a die ;)
warn "$
"
exit 0
}
function die {
warn "$*"
exit 1
}

ferki, to KindActions
@ferki@fosstodon.org avatar

perlthanks is a shortcut for perlbug -T to "send a thank-you note instead of a bug report".

With #Perl, #gratitude is a feature.

See the docs: https://perldoc.perl.org/perlthanks#Can-you-use-perlbug-to-submit-a-thank-you-note

RogerBW, to raku
@RogerBW@emacs.ch avatar
benjamineskola, to random
@benjamineskola@hachyderm.io avatar

Started reading ‘Modern Perl’ on the train to work the other day. #Perl was the first programming language I learned, 20 years ago now, but I’ve hardly used it in probably 15 years now.

Not yet sure what I’d use it for, though. Better shell scripts? I’d normally choose Python/Ruby for that.

profoundlynerdy,
@profoundlynerdy@bitbang.social avatar

@benjamineskola There is a very new OOP system: https://ovid.github.io/articles/the-future-of-perl.html which looks good but I haven't actually used it myself.

I work Cybersecurity, I mostly use for quick one-off scans when someone asks me, "are we vulnerable to XYZ?" when XYZ has a (mis)configuration element to it.

A lot of my hobby code is using these days as I really enjoy the language's mutability.

oalders, to programming
@oalders@fosstodon.org avatar
ChristosArgyrop, to Bash
@ChristosArgyrop@mstdn.science avatar

This made my night #bash #script #perl

image/jpeg

metacpan, to programming
@metacpan@fosstodon.org avatar

What's New on CPAN, March 2024 edition.

https://www.perl.com/article/what-s-new-on-cpan-march-2024/

#perl @perl @tag@relay.fedi.buzzl #programming

ovid, to javascript
@ovid@fosstodon.org avatar

I started programming in 1982. Though I'm known as a #Perl developer, I tried to remember every other languages I've programmed in.

#BASIC, #C, 6809 Assembler, #Javascript, VBScript (and its many variants), #Java, #Prolog, #RakuLang, #Python, #Kotlin, #COBOL, Easytrieve, and probably a few others.

I wish I had gotten a job in Prolog, primarily because I loved what I could create with it. I don't love programming; I love creating.

What are you languages?

#programming #software #OpenSource

mina,
@mina@berlin.social avatar

@ovid

Basic, Pascal, C/C++, JavaScript, Tcl/Tk, Bash, Prolog quickly from my head

My favourite, though, is #Perl.

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

How's your day going?
#perl

genehack, to random
@genehack@dementedandsadbut.social avatar
ChristosArgyrop, to hpc
@ChristosArgyrop@mstdn.science avatar

One of the mainstream testing systems for high performance computing is written in @Perl

https://sourceforge.net/projects/ctsproject/

mjgardner, (edited )
@mjgardner@social.sdf.org avatar

@deflarerOfClouds has hosted development for a long time. Please continue to file bug reports there: https://GitHub.com/perltidy/perltidy/issues

You might even consider making a reasonable case to move the project’s remaining assets off . Impotently whinging about it here doesn’t change anything.

/ @ChristosArgyrop @ovid @perl

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • kavyap
  • DreamBathrooms
  • vwfavf
  • magazineikmin
  • InstantRegret
  • osvaldo12
  • Youngstown
  • ngwrru68w68
  • slotface
  • rosin
  • everett
  • tacticalgear
  • PowerRangers
  • Leos
  • thenastyranch
  • mdbf
  • cubers
  • modclub
  • GTA5RPClips
  • khanakhh
  • cisconetworking
  • ethstaker
  • Durango
  • tester
  • anitta
  • normalnudes
  • megavids
  • All magazines