Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Difference between $0 and __FILE__by pobocks (Chaplain) |
on Sep 26, 2012 at 04:45 UTC ( [id://995699]=note: 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 Section
Seekers of Perl Wisdom
|
|