Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

thanks for reply. Let me explain what happened in detail: I need to transfer a simulation package from one internal network to another internal network in company. Though both networks use linux, there are some differences between them, such as tools setting etc.

here is a piece of code from one script (I did some substitution to make things simple):

(1) use FindBin; (2) use lib $FindBin::Bin; (3) use dbPrjPath; ## company internal package (4) my $dir = dbPrjPath::prjPath(); #find project path (5) my $prog = $FindBin::Script; (6) exec("$prog @ARGV");

above is the code. suppose code above is prog1. In line (4) a new project path is got. In this new project path there is a same script named prog1. The total code will get new project path and run the script in that path with the same script name "prog1" as line (6) indicates, i.e, runs B/prog1. This works well in original system, but in the other system, code in line (6) always runs A/prog1 so it is a infinite loop, which is a strange thing to me.

In order to trace it, I insert a code as this between line (5) and (6) as (5.5) system("which $prog") and it shows B/prog1. I then inserted some debug info to make sure exec("$prog") runs itself. This confused me. so What happened? I confused...

In reply to Re^2: confused path by skyworld_chen
in thread confused path by skyworld_chen

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (11)
    As of 2018-07-16 12:49 GMT
    Find Nodes?
      Voting Booth?
      It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

      Results (334 votes). Check out past polls.