Re: file open question



r_stringer66@xxxxxxxxx wrote:
> I want to write a simple perl script which checks to see if a given
> file exists if so it will do one thing and if not something else,

"perldoc -f -X" and pay particular attention to the "-e" test.

> So far I looked at perl's open function but it does not seem to return
> a boolean in order to indicate of the file was opened successfully or
> not.

Why do you think so? Did you check the documentation for the functions you
are using?
>From "perldoc -f open":
Open returns nonzero upon success, the undefined value
otherwise. [...]
To me this sounds very much like what you were looking for in your last
paragraph.

However, please notice that there is a significant difference between what
you were asking for in the first paragraph (file exists) and what you are
asking for in the last paragraph (file can be opened for whatever).

jue


.



Relevant Pages

  • Columns
    ... paragraph.The second columun starts with a new paragraph. ... Thanks for any assistance. ... I am at a dead end with this one. ... Prev by Date: ...
    (microsoft.public.word.general)
  • Re: Security implications of using open() on untrusted strings.
    ... I should actually have removed that paragraph from my posting. ... isn't the user supposed to be in control of that ... In perl the perl script author has the choice to be safe (three argument ...
    (comp.lang.python)
  • Re: How restricting CSS-style?
    ... Any other links will just act like they normally would. ... > Btw - looks like you'd better use: ... > It is after all a list of links, not a paragraph :-) ... Prev by Date: ...
    (alt.html)
  • Re: Diary of a Tumor
    ... First I thought I canceled it to add a paragraph, ... then it showed an error message. ... Araik. ... Prev by Date: ...
    (sci.med.diseases.cancer)
  • Re: Moving Between Paragraphs
    ... > but got a message however it did hi-light every paragraph in ... bayl bhgynjf jvyy unir cevinpl." ... Prev by Date: ...
    (comp.editors)