my $dir1=$0;
but it gives me the directory with the file , for example c:\perl\exmp.pl and I need only c:\perl\.Thank you.
janitored by ybiC: Retitle from less-than-descriptive "the corrent location" for better site searching, and minor format tweaks for legibility.
In reply to How to obtain current working directory by Nelly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |