in reply to Re: Determining if self is already running under WinNT/2000
in thread Determining if self is already running under WinNT/2000

The Win32::Mutex does work on my release of perl. I will have to readup on what this module does, Thanks!!! I am still interested in gaining access to the command line arguments of perl. The information has to be in there somewhere because the NT Resource Kit utilities tlist.exe lists it... C:>tlist.exe 2084 CMD.EXE Command Prompt c:\bin\perl.exe c:\src\prg.pl
  • Comment on Re: Re: Determining if self is already running under WinNT/2000

Replies are listed 'Best First'.
Re: Re: Re: Determining if self is already running under WinNT/2000
by PodMaster (Abbot) on Feb 07, 2003 at 05:19 UTC
      Here is the version info...

      C:\SRC\perl>c:/activeperl/bin/perl.exe -version

      This is perl, v5.6.1 built for MSWin32-x86-multi-thread
      (with 1 registered patch, see perl -V for more detail)

      Copyright 1987-2001, Larry Wall

      Binary build 633 provided by ActiveState Corp.
      http://www.ActiveState.com
      Built 21:33:05 Jun 17 2002

        Win32::Mutex works ok for using the same version perl as you?

        #! perl -slw use strict; use Win32::Mutex; #! backslashes are prohibited in mutex names (my $name = $0) =~ tr[\\][/]; my $mtx = Win32::Mutex->open($name); die "$0 is already running" if $mtx; $mtx = Win32::Mutex::->new(1,$name) or die $^E; print "process id: $$"; sleep 1000; __END__ c:\test>perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread Binary build 633 provided by ActiveState Corp. http://www.ActiveState. +com ... c:\test>mutex process id: 200 ^C c:\test>^C c:\test>start /b mutex c:\test>process id: 218 mutex C:\test\mutex.pl is already running at C:\test\mutex.pl line 7. c:\test>kill 218 c:\test>mutex process id: 271 ^C c:\test>^C

        Examine what is said, not who speaks.

        The 7th Rule of perl club is -- pearl clubs are easily damaged. Use a diamond club instead.