#!/usr/bin/perl -w # use IO::Socket; open(PID, "> pid") || die "Can't open PID file: $!"; print PID $$ ; close PID;