Skip to main content



Hi,

I don't get why this produces a syntax error:

my %r = map { "a$_" => 1 } qw(q w);

yet this works:

my %r = map { "a" . $_ => 1 } qw(q w);

What is going on here?

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




Let me explain my goal.

Let's say I have a file with a set of paths to files:

/usr/lib32/libssl.so

/usr/lib32/libz.so

...

and so on.

What's an easy way in perl to turn that input into:

/usr/lib32/libssl.so /usr/lib32/libssl.so

/usr/lib32/libz.so /usr/lib32/libz.so

...

Basically duplicate every string to the same line, delimited by a space?

Thanks for any assistance. I use perl's regex regularly for substitutions and the like (instead of using sed) and I prefer PCRE to sed. That said, not familiar with a way to do this.

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









The Perl Data Language (PDL) has its own Advent Calendar apart from the Perl Advent Calendar.

PDL Advent site (calendar view)

RSS feed

submitted by /u/briandfoy
[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.