Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

/ 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?



Replies are listed 'Best First'.
Re: / operator question
by choroba (Bishop) 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 Anonymous Monk on Dec 14, 2012 at 07:27 UTC
    perlintro explains how to recognize strings and operators
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".

        Enoch was right!
        Enjoy the last years of Rome.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008770]
Approved by Old_Gray_Bear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2018-05-26 18:39 GMT
Find Nodes?
    Voting Booth?