- or download this
#!/usr/bin/perl -w
+
...
printf "I'm going to use: %s\n",$pidfile;
- or download this
--$ perl procpid.pl
I'm going to use: /var/tmp/procpid.pl.1974
- or download this
use FileHandle; # Add this with the rest of the uses
:
...
print $fh "$$"; # Or whatever you want to write
undef $fh; #automatically closes the file
- or download this
$pidfile =~ s/\.pl//;