I am trying to assign a constant at the top of a Perl script as follows:
use constant {
CONSTNAME => qx{readlink -e __FILE__} || __FILE__,
};
__FILE__does not interpolate inside the operator qx, which leads to a failure. How can I achieve what I want to interpolate __FILE__before calling the readlinkshell.
Please note: this is not an option to save the command inside an intermediate variable between them.
source
share