Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[gray]#!/usr/bin/perl -w[/gray]
[url=http://perldoc.perl.org/functions/use.html][black][b]use[/b][/black][/url] [green]strict[/green][red];[/red]
[url=http://perldoc.perl.org/functions/my.html][black][b]my[/b][/black][/url] [blue]$prev_mtime[/blue]=[fuchsia]0[/fuchsia][red];[/red]
[black][b]my[/b][/black] [blue]$sleeptime[/blue]=[fuchsia]3600[/fuchsia][red];[/red]
[black][b]my[/b][/black] [blue]$email[/blue]=[red]'[/red][purple]someone@example.com[/purple][red]'[/red][red];[/red]
[black][b]my[/b][/black] [blue]$filename[/blue]=[red]'[/red][purple]/some/log.log[/purple][red]'[/red][red];[/red]
[olive][b]while[/b][/olive] [red]([/red][red])[/red] [red]{[/red]
[black][b]my[/b][/black] [red]([/red][blue]$dev[/blue],[blue]$ino[/blue],[blue]$mode[/blue],[blue]$nlink[/blue],[blue]$uid[/blue],[blue]$gid[/blue],[blue]$rdev[/blue],[blue]$size[/blue],[blue]$atime[/blue],[blue]$mtime[/blue],[blue]$ctime[/blue],[blue]$blksize[/blue],[blue]$blocks[/blue][red])[/red] = [url=http://perldoc.perl.org/functions/stat.html][black][b]stat[/b][/black][/url][red]([/red][blue]$filename[/blue][red])[/red][red];[/red]
[olive][b]if[/b][/olive] [red]([/red][blue]$mtime[/blue] == [blue]$prev_mtime[/blue][red])[/red] [red]{[/red]
[url=http://perldoc.perl.org/functions/system.html][black][b]system[/b][/black][/url][red]([/red][red]'[/red][purple]echo | mailx -s "log file has stalled, last modified [/purple][red]'[/red] . [url=http://perldoc.perl.org/functions/localtime.html][black][b]localtime[/b][/black][/url][red]([/red][blue]$mtime[/blue][red])[/red] . [red]'[/red][purple]" [/purple][red]'[/red] . [blue]$email[/blue][red])[/red][red];[/red]
[red]}[/red]
[blue]$prev_mtime[/blue] = [blue]$mtime[/blue] [red];[/red]
[url=http://perldoc.perl.org/functions/sleep.html][black][b]sleep[/b][/black][/url][red]([/red][blue]$sleeptime[/blue][red])[/red][red];[/red]
[red]}[/red]