Results 1 to 5 of 5

Thread: Change or rename Perl processes

  1. #1
    Join Date
    Jan 2010
    Posts
    43

    Change or rename Perl processes

    I currently have some Perl executable that runs under Windows. I wish to rename those Perl processes that are underway in the Task Manager. All of my scripts are called perl.exe and so it is difficult to distinguish if there are 5 running at the same time. Do I need a library?

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: Change or rename Perl processes

    Your scripts are interpreted/compiled/executed by a single executable: perl.exe (or wperl.exe)

    I may be wrong but for Windows, this is normal as it displays perl.exe executable program employing a process on your machine. So yes, if you run multiple scripts simultaneously, you'll have several times perl.exe in your task manager.

    I do not see how you could change that because it seems that even compiling (this is a big word) your script by Perl2Exe, you'll still like perl.exe name to display!

  3. #3
    Join Date
    Nov 2008
    Posts
    1,054

    Re: Change or rename Perl processes

    In some systems, it would give you the entire command line used to start the process, and in some OSes, you could even modify $0 to modify in real time and within the process name displayed by "ps" or equivalent! But Windows... sorry, otherwise compile your scripts with Par:: Packer for example (it works, I checked), I do not see.

    I think, you could also make it a shell embedded in an executable with a different name, and you could also make copies of perl.exe named differently...

  4. #4
    Join Date
    May 2008
    Posts
    685

    Re: Change or rename Perl processes

    To differentiate the different perl services started with perl.exe or wperl.exe, just make a copy and paste one of these executables in the bin directory of PERL and rename it again from .exe to thenameyouwant.exe. Then you run your .pl file in a DOS window with your new .exe

    ex:

    x:\perl\bin\copy of wperl.exe (copy of the original)
    x:\perl\bin\veriflan.exe (renamed)

    And run pl with your x:\perl\bin\veriflan.exe x:\script\yourscript.pl in a DOS window.

    And thus, in the taskmanager, you'll see veriflan.exe as a process and wperl.exe

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Change or rename Perl processes

    Under most variants of Unix (including Linux), you will just have to change the value of $0:
    Code:
    #!/usr/bin/perl
    use strict; 
    use warnings;
    $0 = "myprocess";
    <>;
    __END__

Similar Threads

  1. Replies: 2
    Last Post: 20-04-2012, 03:46 AM
  2. change affinity of multiple processes without going to task manager
    By levi102101 in forum Motherboard Processor & RAM
    Replies: 1
    Last Post: 19-01-2012, 02:53 AM
  3. How to do log analysis in Perl?
    By Atsushi in forum Software Development
    Replies: 5
    Last Post: 24-01-2011, 11:29 AM
  4. What is PERL and what are its uses?
    By Gadin in forum Software Development
    Replies: 10
    Last Post: 08-01-2011, 07:33 PM
  5. Invocation of the Perl
    By Botan in forum Tips & Tweaks
    Replies: 1
    Last Post: 27-09-2010, 06:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,496,435.62394 seconds with 17 queries