#!/bin/bash declare -x PLV_STRING function perl_v_in_use { # contrast with use of version pragma as in: # $ perl -le 'use version 0.77; print version->parse($])->normal' /usr/bin/env perl \ -e 'my $pow = 2; @qiu = split(q/[.]/=>$]);' \ -e '@qiu[1 .. @qiu] = map{sprintf(q[%u],$_/10**$pow++)} ' \ -e 'map {unpack "A4 A4",$_ * 10**3 } @qiu[1 .. $#qiu];' \ -e 'print join q[.], grep{length($_)} @qiu;' } function pviu_insurance { by_longhand="$(perl_v_in_use)" if [[ "v$by_longhand" == $(/usr/bin/env perl -e 'print $^V') ]] then return 0 else return 1 fi } function set_perl_v_in_use { if pviu_insurance then PLV_STRING=$(perl_v_in_use) else printf >&2 "WARNING: NON-SUCCESS rv \"%u\" from pviu_insurance\n" $? PLV_STRING='0_INVALID' fi }