|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Comment on |
| ( #3333=superdoc: print w/ replies, xml ) | Need Help?? |
|
__FILE__ is the file name that the __FILE__ token is in, and $0 is a variable containing the name of the program, as given to the shell. They can most certainly be different - one case that comes to mind is a __FILE__ token in a library called by your program, but there are many others, particularly since you can assign to $0 (with varying effects on different OS), but you can't meaningfully assign to __FILE__. Example code: File 1 - firstfile
File 2 - filetwo
It's simplistic, but should show the basic concept.
for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";
In reply to Re: Difference between $0 and __FILE__
by pobocks
|
|