debug.pl 497 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. # Always debug
  5. BEGIN { $ENV{'DEBUG'} = 1; }
  6. # Local modules
  7. use Cwd qw(abs_path);
  8. use File::Basename qw(dirname);
  9. use lib dirname(abs_path($0));
  10. use DMX;
  11. # User config
  12. my %DIM = ();
  13. my $DELAY = 10;
  14. # App config
  15. my $DATA_DIR = DMX::dataDir();
  16. my $STATE_SOCK = $DATA_DIR . 'DEBUG.socket';
  17. # Sockets
  18. DMX::stateSocket($STATE_SOCK);
  19. DMX::stateSubscribe($STATE_SOCK);
  20. # Loop forever
  21. while (1) {
  22. DMX::readState($DELAY, undef(), undef(), undef());
  23. }