The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

Flip::Flop - Set a switch in your script to zero after a run with the switch set to one.

Synopsis

Some where near the top of your program you might have some variables (illustrated below by uploadToCloud) that select the actions the code is to perform on the next run from your IDE:

 my $doUpload = Flip::Flop::uploadToCloud(1);

 ...

 if ($doUpload)
  {...
   Flip::Flop::uploadToCloud();
  }

If the upload succeeds, your program source code will be modified to read:

  my $doUpload = Flip::Flop::uploadToCloud(0);

so that the next time you run your program from your IDE this lengthy operation will not be performed unless you explicitly re-request it.

If the run does not succeed the switch will be left unchanged. The switch will only be reset if your program requests the reset and exits explicitly or implicitly with exit(0).

You can have as many such switches as desired.

If your program forks, then only the process in which Perl was started will update the Flip::Flop switches.

This capability will only be useful to you if you are using an editor that detects changes made independently to the file currently being edited. If you do use such an editor this technique is surprisingly useful for simplifying, standardizing, streamlining and supporting your edit/run cycle.

Installation

This module is written in 100% Pure Perl and, thus, it is easy to read, use, modify and install.

Standard Module::Build process for building and installing modules:

  sudo cpan install Flip::Flop

Author

philiprbrenan\@gmail.com

http://www.appaapps.com

Copyright

Copyright (c) 2016-2018 Philip R Brenan.

This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.

END