exec and junk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akoos
    New Member
    • Jun 2007
    • 4

    exec and junk

    Hi ,
    I have seen a program like this
    exec { Program } ("junk", filelocation);

    What is this "junk" for ? Without this the file is not being opened?
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    Originally posted by akoos
    Hi ,
    I have seen a program like this
    exec { Program } ("junk", filelocation);

    What is this "junk" for ? Without this the file is not being opened?
    Is this supposed to be perl code? If it is, it makes no sense.

    Comment

    • akoos
      New Member
      • Jun 2007
      • 4

      #3
      Originally posted by KevinADC
      Is this supposed to be perl code? If it is, it makes no sense.
      Yes
      I will make it more clear

      exec { $browser } (junk, $file);

      where $browser is the internet browser exe location and $file is the name of the html file which is trying to be opened
      I have no idea about the "junk" thing . That is my doubt?

      Comment

      • savant
        New Member
        • Jul 2007
        • 1

        #4
        Originally posted by akoos
        Hi ,
        I have seen a program like this
        exec { Program } ("junk", filelocation);

        What is this "junk" for ? Without this the file is not being opened?
        When you exec a program with a

        Code:
        exec {'path/to/program'} @args;
        syntax, the first element of the @args list contains the process name, so you can put anything there and it would show that name in the process list. It is not essential for running a program, so the programmer put the word "junk" in there probably just so that he doesn't have to think about what to put there :)

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          DOH! Thanks savant, I'm not sure what I was thinking last night when I read this question. Your explanation is spot on.

          Comment

          Working...