CGI – web status of system’s command.

#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser warningsToBrowser); #print header(-type=>'text/plain'); print header( -charset => 'utf-8', -refresh => '10' ); print start_html(); my $info1 = `cat /proc/mdstat`; print "...html"; print end_html();...

The Fool’s Guide to CGI.pm

No, this guide is not for fools but by a fool, who had kept wondering how CGI.pm is supposed to work and finally got a clue. So here’s how (I think) it works in simplest cases. I hope this might make some other people’s learning curve a little better....

Regular expression to match string not containing a word.

The fact that regex doesn’t support inverse matching is not entirely true. You can mimic this behavior by using negative look-arounds: 1^((?!hede).)*$ The regex above will match any string, or line without a line break, not containing the (sub) string ‘hede’.As mentioned, this is not something regex is “good” at (or should do), but...

Scroll to top