Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
menherahair (menherahair@eientei.org)'s status on Tuesday, 18-Feb-2025 15:53:38 JST menherahair
so @obsoletion now pulls the names to shitpost with from some source files. to avoid duplicates I process them with a perl script and create the one final normalized file. this way I can throw whatever at it without vetting the source files and it'll work out.
the script just loops over them:
```
for my $file (@ARGV) {
open my $fh, '<', $file;
...
}
```
*before* it did that it'd just use whatever's in the /bin/ and /sbin/ on my box using bash globbing. to mimic this behavior I created a source file with contents of these and threw it in the mix, but this lacks the malicious spirit it would emit at me earlier so I wanted to hack something similar back in.
Perl can open refs to variables as filehandles, so I thought I'd just throw an array with globs in there in the script:
```
our $doxme = $ENV{DOXME};
for my $file (@ARGV,
$doxme? [glob('/sbin/* /bin/*')]: undef) {
open my $fh, '<', $file;
...
}
```
alas
>Can't open 'ARRAY(0x6339b212f430)' for reading: 'No such file or directory' at utils/mknames.pl line 19
Perl can open refs to *scalars*. It won't magic an array into a structured file for reading :marimaricry:
after converting it it does what I wanted it to:
```
for my $file (@ARGV,
$doxme? \(join "\n", glob('/sbin/* /bin/*')): undef) {
open my $fh, '<', $file;
...
}
```
https://menhera.hair/git/obsoletion/commit/572bcc1074a4f90b18f80468ff63ebd59f46c1c4.html