|
-
Feb 10th, 2000, 09:35 AM
#1
Thread Starter
Member
sorry, the perl forum i frequent shut down so im hoping i can get some help here.
my question is how do i escape the backslash "\" character?
im trying to get the name of the script thats running by spitting $0
$0 holds "C:\~robbie\bbs\test.pl"
@a=split(/\\/, $0); #this does NOT work!
any help would be appreciated
also if someone could suggest a good perl forum...
-
Feb 10th, 2000, 09:50 PM
#2
Junior Member
There is an easy way of getting the running script:
first, the $0 variable holds the script and the current executing directory. To make this variable actually tell you what the script name is, just add the following code:
($basename = $0) =~ s%.*/%%;
($dirname = $0) =~ s%/[^/]*$%%;
clear now?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|