Skip to main content



#!/usr/local/bin/perl use v5.40; use Syntax::Operator::Matches qw( matches mismatches ); use Type::Tiny; my $x = "123"; my $y; my $z = 'abc'; if ( $x matches $z ) { say "1"; } else { say "2"; } 

Coded runs and compiles fine.

perltidy error

MacBook Pro 2021:lt administrator$ perltidy matches.pl matches.pl: Begin Error Output Stream matches.pl: matches.pl: 9: if ( $x matches $z ) { matches.pl: -- ^ matches.pl: found bareword where operator expected (previous token underlined) 

.perltidyrc
# PBP .perltidyrc file # Uncomment #-st to fully emulate perltidy -pbp -l=278 # Max line width is 78 cols -i=4 # Indent level is 4 cols -ci=4 # Continuation indent is 4 cols #-st # Output to STDOUT -b # Write the file inline and create a .bak file -se # Errors to STDERR -vt=2 # Maximal vertical tightness -cti=0 # No extra indentation for closing brackets -pt=1 # Medium parenthesis tightness -bt=1 # Medium brace tightness -sbt=1 # Medium square bracket tightness -bbt=1 # Medium block brace tightness -nsfs # No space before semicolons -nolq # Don't outdent long quoted strings #-icb # Break before all operators -wbb="% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x= matches" 

spent an hour on this without luck; is there anyway to make perltidy aware of the imported matches operator?

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



Is there a way to make a readonly blessed reference that detect attempts to modify it at compile time of the script? Package Readonly , Package Const::Fast and Readonly::Tiny die at runtime

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



Hi,

I have been programming in perl for the last 25 years but things have dried up with my long term set of clients recently. I see a lot of posts on here about how there is a huge amount of perl code out there and a need for experienced perl developers ... but I am struggling to find it. I used to go to jobs.perl.org but there hasn't been much there for ages. Upwork seems to have minimal perl projects, so I am a bit stumped. I was on LinkedIn for ages but it became too much of a spammer's paradise.

I'd really appreciate some tips on how to re-expand my client base in 2024!

Rob

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




Going nuts with this regex, looking for second pair of eyesThis works and returns several files:
```
my $image_name = quotemeta('Screenshot-2024-02-23-at-1.05.14');
my $files = $wac->get_all_files_in_dir($dir . '/uploads', qr/$image_name.*\.png$/);

```

This returns no files:
```
my $image_name = quotemeta('Screenshot-2024-02-23-at-1.05.14 AM');
my $files = $wac->get_all_files_in_dir($dir . '/uploads', qr/$image_name.*\.png$/);
```

Note the space in the file name before AM.

This also returns no files:
```
my $image_name = quotemeta('Screenshot-2024-02-23-at-1.05.14\s*AM');
my $files = $wac->get_all_files_in_dir($dir . '/uploads', qr/$image_name.*\.png$/);
```

I tried with and without quotemeta and with and without /Q /E to no avail.

Is it possible the space is some kind of invisible UTF8 character? This is driving me nuts.

**UPDATE:** I jumped on regex101.com and copied and pasted in the file name from the terminal and indeed there appears to be some kind of hidden character that is not whitespace:

https://preview.redd.it/icpdpzxj1gid1.png?width=828&format=png&auto=webp&s=1f78222cdd1d45bc1c5f39d0e48d04e7c57b3f74

Did a hex dump of the string:

00000000 53 63 72 65 65 6E 73 68 - 6F 74 2D 32 30 32 34 2D Screenshot-2024-

00000010 30 32 2D 32 33 2D 61 74 - 2D 31 2E 30 35 2E 31 34 02-23-at-1.05.14

00000020 E2 80 AF 41 4D 2D 31 30 - 32 34 78 36 39 38 2E 70 ...AM-1024x698.p

00000030 6E 67 0A ng.

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