Terse answer:
Using the dot notation (so-called "sourcing") reads the lines in the specified file and executes them in your current shell. Without the dot (an assuming the name you specify isn't a shell keyword, function or alias), the PATH is searched for a file which is executable and matches the name you specified and a new process is spawned with that file as the executable / script.
Verbose answer:
When you do this:
... if "myfile" exists in the current directory, the contents are read into your interactive shell and each is executed as if you had typed it at the prompt. So, for example, if myfile contains
Code:
#!/bin/bash
date
myvariable="myvalue"
your interactive shell will try to execute "#!/bin/bash" first (which is a comment and therefore does nothing). Then the "date" command will be called (outputting the current system date and time). Finally, the value "myvalue" will be assigned to the variable "myvariable".
The last line is really helpful in understanding the difference between sourcing "myfile" and executing it. When you execute a file which contains #!/some/path as the first line, the system create a new process for /some/path, and then uses the rest of the file as standard input for that program. If /some/path is a shell like the one you happen to be using as your interactive shell then the difference between sourcing and executing the file is subtle but important!
To understand the difference you must know that one process cannot [directly] alter the memory of it's parent (at least not without the other process explicitly arranging to allow this). So when your interactive shell spawns a new shell to interpret the file, any commands which alter the memory state of the new process do not alter the memory state of the interactive shell. The assignment of "myvalue" to the variable "myvariable" is an example of this... In the following example, I'm going to assume "." is in your PATH. i.e. when you type "myfile" without the ., it will be found in the current working directory.
Code:
$ ls -l myfile
-rwxr-xr-x 1 mouse mouse 37 2011-01-17 18:04 myfile*
$ cat myfile
#!/bin/bash
date
myvariable=myvalue
$ echo "myvariable is: $myvariable"
myvariable is:
$ myfile
Mon Jan 17 18:05:02 GMT 2011
$ echo "myvariable is: $myvariable"
myvariable is:
$ . myfile
Mon Jan 17 18:05:09 GMT 2011
$ echo "myvariable is: $myvariable"
myvariable is: myvalue
Note that the first time myfile is called (without the .), the value of myvariable is not altered in your interactive shell. The second time it is.
I hope that makes things clearer.