Perl Scripting: Check If a File Exists

Posted by suvi under Programming

It’s not often that I write about Perl Scripting on Unix Tutorial, but that’s just because I don’t script in Perl this much on a regular basis. Today, however, I’d like to share one of the building blocks – a really basic piece of functionality which you’ll find really useful in almost any Perl script.

How to check if a file exists in Perl

First of all, we need to create one file for our experiments:

ubuntu$ touch /tmp/file.try

Read more at UNIX Tutorial

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word