Okay, so I’ve stated earlier that when I feel like I’m reading some well-organized reference documentation, I don’t feel inclined to take notes. But, alas, now I feel that if I don’t take notes, my notes will not be an accurate reflection of the things I learn and the things I do, so here I am taking notes on Perl, even though I don’t feel inclined to do so.
You can assign subroutines to variables in Perl. Suppose you do so, and then you want to execute the subroutine in that variable. How do you do that? Use this syntax.
&{\&{$action}}();
20190104/DuckDuckGo perl execute function defined as variable
20190104/https://stackoverflow.com/questions/1915616/how-can-i-elegantly-call-a-perl-subroutine-whose-name-is-held-in-a-variable
Suppose you call a command using the backticks syntax to capture its
standard output, but you also want to get its exit status. How do you
do that? Simple, just use the $?
variable. Note that you may need
to use $? >> 8
to get the true exit status.
20190104/DuckDuckGo perl backticks exit code
20190104/https://stackoverflow.com/questions/7819197/getting-the-return-value-of-a-command-executed-using-backticks-in-perl