Forum Moderators: coopster & phranque

Message Too Old, No Replies

Remove directory from SCRIPT_NAME

         

branmh

1:40 pm on Sep 22, 2003 (gmt 0)

10+ Year Member



is there a way to remove all the directories for the ENV: SCRIPT_NAME? I just would like the filename of the script.

sugarkane

12:49 pm on Sep 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use a regex - something along the lines of

$script_name =~s@^.*/@@;

will remove everything up to and including the last /, effectively leaving just the script name.