How to get the exact path of a script

Discussion in 'Perl Misc' started by vikrant@saysnetsoft.com, Oct 22, 2005.

  1. Guest

    hi,

    i have a script example.pl currently store at location "/home/vikrant/scripts/".

    Now,what i want to do is to find the above path means where
    my script(example.pl) store or currently exists when i run
    my script(example.pl) in the following different ways:-

    1.
    >cd /home/
    >perl vikrant/scripts/example.pl


    the output i need is /home/vikrant/scripts/

    2.
    >cd /home/sameer/
    >perl /home/vikrant/scripts/example.pl


    this time the output i need is same means "/home/vikrant/scripts/".

    Please tell me how can i get the exact path of my script
    while executing it from different location.

    Thanks

    Vikrant
    , Oct 22, 2005
    #1
    1. Advertising

  2. Anno Siegel Guest

    <> wrote in comp.lang.perl.misc:
    > hi,
    >
    > i have a script example.pl currently store at location "/home/vikrant/scripts/".
    >
    > Now,what i want to do is to find the above path means where
    > my script(example.pl) store or currently exists when i run
    > my script(example.pl) in the following different ways:-


    perldoc FindBin

    Anno
    --
    If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers.
    Anno Siegel, Oct 22, 2005
    #2
    1. Advertising

  3. Guest

    hi,

    Thanks for the information.

    Regards,
    Vikrant
    , Oct 22, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wweric
    Replies:
    1
    Views:
    338
  2. Guest
    Replies:
    11
    Views:
    3,151
    Peter Seaman
    Dec 19, 2003
  3. Scott Allen
    Replies:
    0
    Views:
    2,098
    Scott Allen
    Apr 24, 2004
  4. =?Utf-8?B?U3RlcGhhbmU=?=

    Get the exact URL host name

    =?Utf-8?B?U3RlcGhhbmU=?=, Sep 19, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    467
    Juan T. Llibre
    Sep 19, 2006
  5. Akbar
    Replies:
    13
    Views:
    480
    Akbar
    Sep 17, 2003
Loading...

Share This Page