perl doesn't look anywhere but where you specify. For example,
- perl foo.pl looks for foo.pl in the current directory of the current drive.
- perl bar\foo.pl looks for foo.pl in subdir bar of the current directory of the current drive.
- perl \bar\foo.pl looks for foo.pl in subdir bar in the root directory of the current drive.
- perl d:foo.pl looks for foo.pl in the current directory of the specified drive.
- perl d:bar\foo.pl looks for foo.pl in subdir bar in the current directory of the specified drive.
- perl d:\bar\foo.pl looks for foo.pl in subdir bar in the root directory of the specified drive.
- perl \\host\share\bar\foo.pl looks for foo.pl in subdir bar in the specified share of the specified host.
If you want Windows to search the path for foo.pl, you'll have to ask Windows to execute foo.pl instead of perl. Some configuration may be required.