in reply to signal-width+magic

Other than that I'd rather quit my job than have to maintain code written like that, I have one comment. The following:
unless ($G) { if (!($P) && $shifted =~ /\w/) { @files = split /,/, $shifted; foreach (@files) { warn "You asked me to eat \"$_\" and I\'m going to taste it and s +ee if its real.\n" if $D; die "You fed me \"$_\" and I couldnt find it or couldnt touch it +because...\n $!\n (...because of this error, i'm going to stop)\n +" unless -e $_; die "You fed me \"$_\" and I couldnt find it or couldnt touch it +because...\n It\'s a directory, not a file.\n (try this):\n\nls $ +_ | perl -pe \'s/^/$0 $_\\//;' > shx && sh -x shx\n\n" if -d $_; warn "Yep, tastes like a file.\n" if $D; eat($_); } } elsif ($P) { smoke(); } elsif ($s) { subliminal_meaning($s); } elsif ($m) { individual_meaning($m); } else { die "$usage"; } } else { if (!($P) && $shifted =~ /\w/) { @files = split /,/, $shifted; foreach (@files) { warn "You asked me to eat \"$_\" and I\'m going to taste it and s +ee if its real.\n" if $D; die "You fed me \"$_\" and I couldnt find it or couldnt touch it +because...\n $!\n (...because of this error, i'm going to stop)\n +" unless -e $_; die "You fed me \"$_\" and I couldnt find it or couldnt touch it +because...\n It\'s a directory, not a file.\n (try this):\n\nls $ +_ | perl -pe \'s/^/$0 $_\\//;' > shx && sh -x shx\n\n" if -d $_; warn "Yep, tastes like a file.\n" if $D; imagine($_); } } elsif ($P) { plumbing(); } elsif ($s) { subliminal_meaning($s); } elsif ($m) { individual_meaning($m); } else { die "$usage"; } }
would be better written as
if (!($P) && $shifted =~ /\w/) { @files = split /,/, $shifted; foreach (@files) { warn "You asked me to eat \"$_\" and I\'m going to taste it and s +ee if its real.\n" if $D; die "You fed me \"$_\" and I couldnt find it or couldnt touch it +because...\n $!\n (...because of this error, i'm going to stop)\n +" unless -e $_; die "You fed me \"$_\" and I couldnt find it or couldnt touch it +because...\n It\'s a directory, not a file.\n (try this):\n\nls $ +_ | perl -pe \'s/^/$0 $_\\//;' > shx && sh -x shx\n\n" if -d $_; warn "Yep, tastes like a file.\n" if $D; if ($G) { imagine($_); } else { eat($_); } } } elsif ($P) { if ($G) { plumbing(); } else { smoke(); } } elsif ($s) { subliminal_meaning($s); } elsif ($m) { individual_meaning($m); } else { die "$usage"; }
Similarly,
foreach(sort keys %switches) { ${$_}= "$switches{$_}"; print " * \$$_ is switched \"$switches{$_}\"" if $D; if ($switches{$_} eq '1') { print " (ON)" if $D; } if ($switches{$_} eq '0') { print " (OFF)" if $D; } print "\n" if $D; }
is probably better written as
foreach(sort keys %switches) { ${$_}= "$switches{$_}"; if ($D) { print " * \$$_ is switched \"$switches{$_}\""; if ($switches{$_} eq '1') { print " (ON)"; } if ($switches{$_} eq '0') { print " (OFF)"; } print "\n"; } }
Also, in...
$G ? ( $extra = " ***GAPS***" ) : ( $extra = " >>>SIGNALS<<<" ); $S ? ( $H ? print "WIDTH\tCOUNT\tSPOON$extra\n" : 0 ) : ( $H ? print "WIDTH\tCOUNT$extra\n" : 0 );
you seem to be missing the point of the trinary operator. Yes you could use it like a shorthand 'if', but its job is to select between to choices of data rather than code. I wouldn't mention it except you've got a textbook case for its usage here!
$extra = $G ? " ***GAPS***" : " >>>SIGNALS<<<"; $H and print $S ? "WIDTH\tCOUNT\tSPOON$extra\n") : "WIDTH\tCOUNT$extra\n";
Based on that, I'm wondering if you've got a bug (a missing print) here:
$S ? "$_\t$seen{$_}{count}\t$seen{$_}{spoon}\n" : print "$_\t$seen +{$_}{count}\n";
I also think you've got way too much useless use of quotes (e.g. "$usage"), and unnecessary backwhacking of quotes.