Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

/ operator question

by dicty (Sexton)
on Dec 14, 2012 at 04:38 UTC ( #1008770=perlquestion: print w/ replies, xml ) Need Help??
dicty has asked for the wisdom of the Perl Monks concerning the following question:

In the perl code,

die(...) if -e '/noexit';

What does '/noexit' or "/" operator mean here?

Thanks,

Dicty

Comment on / operator question
Re: / operator question
by choroba (Abbot) on Dec 14, 2012 at 05:50 UTC
    Inside the single quotes, there are no operators. The / stands for itself, it is a common directory separator, so it perhaps means "Die if the file noexit exists in the topmost directory". See -X.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: / operator question
by nithins (Sexton) on Dec 14, 2012 at 06:24 UTC

    1)"/" is a root directory. 2) Suppose u lave a directory structure /home/aaa/noexit.if ur script is in the "aaa" directory and you wanted to acess "noexit" directory then "/noexit" simply means " aaa/noexit".

      "/noexit" simply means " aaa/noexit".

      No it doesn't.

      Regardless of where your script lives, that still isn't the same as the cwd. And even if it were, "/noexit" is an absolute path so it still doesn't matter where the script lives or what the cwd is, unless the process is chrooted of course.

       

      The right answer was given by choroba.

        Except for a little twist on Windows. There it's not "absolutely absolute" and it means "the file or directory named 'noexit' in the root directory of the currently selected volume".

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

Re: / operator question
by Anonymous Monk on Dec 14, 2012 at 07:27 UTC
    perlintro explains how to recognize strings and operators

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (19)
As of 2014-10-30 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls