Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: -e on windows giving error

by Rudolf (Monk)
on Nov 17, 2011 at 23:30 UTC ( #938705=note: print w/ replies, xml ) Need Help??


in reply to Re: -e on windows giving error
in thread -e on windows giving error

Oh man, thank you so much everyone! I have found my solution and learned a lot today, Im new to perlmonks and already find the community very welcoming and helpfull! thanks and best wishes, Rudy


Comment on Re^2: -e on windows giving error
Re^3: -e on windows giving error
by ikegami (Pope) on Nov 17, 2011 at 23:42 UTC

    The solution BrowserUk rarely works. It requires an absolute path when launching the script (common for some, rare for others), and then only if the absolute path starts with something of the form "D:" (extremely common).

    I've posted a more robust version here. It handles relatives paths, and even more exotic drive volume names.

      The solution BrowserUk rarely works. It requires an absolute path when launching the script

      No it does not!

      C:\Perl64\bin>p1 [0] Perl> print $0;; C:\Perl64\bin\p1.pl [0] Perl> Terminating on signal SIGINT(2) C:\Perl64\bin>.\p1.pl [0] Perl> print $0;; C:\Perl64\bin\p1.pl [0] Perl> Terminating on signal SIGINT(2) C:\Perl64\bin>cd \test C:\test>p1 [0] Perl> print $0;; C:\Perl64\bin\p1.pl

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Demonstrating that the Windows association mechanism uses absolute paths does not contradict what I said.

        >type a.pl print "$0\n" >perl a.pl a.pl >perl .\.\.\.\.\A.pL .\.\.\.\.\A.pL
Re^3: -e on windows giving error
by BrowserUk (Pope) on Nov 18, 2011 at 00:47 UTC

    If for some obscure reason you do not use file associations to invoke your scripts, and are in the habit of using tortuous relative path constructions to find them, then a simple step would sort out the mess you (probably didn't) create:

    c:\test>perl ..\tmp\..\test\..\Perl64\site\.\lib\..\..\bin\p1.pl Perl> print scalar Win32::GetFullPathName( $0 );; c:\Perl64\bin\p1.pl

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-07-12 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls