Remove the use Smart::Comments from the script and run you script with or without the -MSmart::Comments option. Using the -M<module> parameter is like putting the use <module> statement at the top of your script.
# Smart comments off $ perl my_script.pl
Also see the $ENV{Smart_Comments} variable in Smart::Comments docs. Here you should use Smart::Comments in the script as
use Smart::Comments -ENV;
and then run
$ perl my_script.pl $ Smart_Comments=0 perl my_script.pl
to run without intelligent comments and
$ Smart_Comments=1 perl my_script.pl
to run with smart comments.
Update Smart::Comments module is an initial filter. Attempting to turn it on and off at run time (for example, eval "no Smart::Comments" ) will not work. At best, you can do some configuration at compile time (say, in the BEGIN{} block BEGIN{} before loading Smart::Comments ):
use strict; use warnings; BEGIN { $ENV{Smart_Comments} = " @ARGV " =~ /
source share