shell> cat if.pl
#! /usr/bin/env perl
use 5.010_000;
use if
qr{\A -+ smart \z}ixms ~~ @ARGV,
'Smart::Comments' => '####', '###';
#### Going to sleep for intervals:
for ( 1 .. 5 ) { ### Speeping ... [%] Done
sleep 2;
}
exit 0;
shell> ./if.pl --smart
### Going to sleep for intervals:
Speeping ........ [50%] Done
You can also get the same effect like so:
...
use if
$ENV{SMART},
'Smart::Comments' => '####', '###';
...
shell> SMART=1 ./if.pl