Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
                                                                          
    +          
    ...
    printf "I'm going to use: %s\n",$pidfile;
    
  2. or download this
    --$  perl procpid.pl
    I'm going to use: /var/tmp/procpid.pl.1974
    
  3. 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
    
  4. or download this
    $pidfile =~ s/\.pl//;