in reply to Process display

By the way,
print $2 if /.*(\bco_java_)(\w+\n)/
is less efficient and less readable than
print $1 if /\bco_java_(\w+\n)/

Replies are listed 'Best First'.
Re^2: Process display
by Anonymous Monk on Oct 20, 2005 at 20:21 UTC
    Hi, Thanks for the quick response everyone. The ps -ef output is like below juserl 8593596 1 0 Oct 15 - 0:43 co_java_for03 - AIX juserl 23107 1 0 Oct 15 ? 1:15 co_java_burl9 - HPUX I think both these outputs looks same, but how perl interprets it I am not sure. Thanks, dbadmin
      if that's true, the code you presented would work. Is the path to Perl correct? Are there trailing spaces in the output?
        Hi, Thanks for all replies. I think the path also is correct, otherwise I need to get some error. When I execute the code I am not getting any output at all. The only difference which I find in the ps -ef output is the "?" in HPUX and "-" in AIX
        juserl 8593596 1 0 Oct 15 - 0:43 co_java_for03
        juserl 23107 1 0 Oct 15 ? 1:15 co_java_burl9
        I need the output of the perl script to be
        for03 burl9