Skip to Content
Perl for Web Site Management
book

Perl for Web Site Management

by John Callender
October 2001
Beginner
528 pages
15h 20m
English
O'Reilly Media, Inc.
Content preview from Perl for Web Site Management

The Dot Slash Thing

The next step is to try running the script by entering its name at the Unix command prompt. You may be able to do this by just entering the name of the script (hello.plx) all by itself. Or you may need to precede its name by a period and a forward slash (./). What decides this is whether the dot (.), which you will recall is a shortcut for the current working directory (meaning the directory you are currently in), is in your command path.

The command path is just a list of directories that the shell looks in to find the command whose name you entered. On a DOS system, the current working directory is in your command path by default, but not so under Unix.

If the current working directory isn’t in your command path, entering hello.plx by itself at the shell prompt will not work because the Unix shell will not be able to find the script, even though it’s right there. Instead, you’ll have to enter ./hello.plx, with that initial dot slash (./) telling the Unix shell to look in the current working directory for the command whose name you’re typing in.

Tip

Having to explicitly enter the ./ before your program’s name can actually be a good thing because it makes it less likely that you will accidentally run a different program with the same name in some other directory that is in your command path.

You can check to see if the current working directory is in your command path with the printenv command, as follows:

[jbc@andros jbc]$ printenv PATH /usr/local/bin:/bin:/usr/bin:/usr/sbin:. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Web Client Programming with Perl

Web Client Programming with Perl

Clinton Wong
Embedding Perl in HTML with Mason

Embedding Perl in HTML with Mason

Ken Williams, Dave Rolsky

Publisher Resources

ISBN: 1565926471Catalog PageErrata