RE: Getting file name from a path

2007-04-13 Thread Jerry Kassebaum
Often I need to extract the file name from a path. Typically I do something like following. Any better ways I could do this? #path test $current_file = "c:/somedir/test.ps"; @split_path = split("/",$current_file); $current_file = @split_path[-1]; print $current_file; However, I'm pretty sure

Re: RES: Getting file name from a path

2007-04-13 Thread Andy_Bach
> Often I need to extract the file name from a path. $current_file = "c:/somedir/test.ps"; @split_path = split("/",$current_file); $current_file = @split_path[-1]; print $current_file; You want to use the '$' sigil here, not '@' (you're refering to just one element, not the whole array): $cur

RE: Getting file name from a path

2007-04-13 Thread Adam R. Frielink
print $2; :) fabrício s. martins -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de John Townsend Enviada em: sexta-feira, 13 de abril de 2007 17:53 Para: [EMAIL PROTE

RE: Getting file name from a path

2007-04-13 Thread Tobias Hoellrich
ECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Townsend Sent: Friday, April 13, 2007 2:53 PM To: [EMAIL PROTECTED] Subject: Getting file name from a path Often I need to extract the file name from a path. Typically I do something like following. Any better ways I could do this? #path

RES: Getting file name from a path

2007-04-13 Thread Fabricio Soares Martins - Site CBN - SGR
17:53 Para: [EMAIL PROTECTED] Assunto: Getting file name from a path Often I need to extract the file name from a path. Typically I do something like following. Any better ways I could do this? #path test $current_file = "c:/somedir/test.ps"; @split_path = split("/",

Getting file name from a path

2007-04-13 Thread John Townsend
Often I need to extract the file name from a path. Typically I do something like following. Any better ways I could do this? #path test $current_file = "c:/somedir/test.ps"; @split_path = split("/",$current_file); $current_file = @split_path[-1]; print $current_file; However, I'm pretty sure I