techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.9K
active users

#noxp

5 posts3 participants0 posts today

#Perl @PerlWChallenge 322 Task 1: String Format
#noxp
```
perl -E '
($s,$i)=@ARGV;($o=reverse$s)=~tr/-//d;$o=~s/(.{$i})/$1-/g;$o=~s/-$//;$o=reverse$o;say"$s, $i -> $o"
' -- -A-B-CD-E 4
```

#Perl @PerlWChallenge 319 Task 2: Minimum Common
#noxp
```
perl -MList::Util=min -E '
($x,$y)=map{[split " ",$_]}@ARGV;$w{$_}++for@$x;$r=(min grep{$w{$_}}@$y)//-1;say join("; ", @ARGV)," -> $r";
' "1 2 3 4" "3 4 5 6"
```