in reply to Re: Uploading Time (getting last element of a variable)
in thread Uploading Time

Since he is working on a file upload to a webserver, the slash could be either way, it depends on how the client sends it. But this should work for either
$file="C:/aplle/index.htm"; $file=~ s/.*[\/\\]//; # delete everything(!) upto the last / or \ print $file;
P.S. Why did you use (.| )* instead of .* ?

Replies are listed 'Best First'.
Re: Re: Re: Uploading Time (getting last element of a variable)
by thatguy (Parson) on Jun 13, 2002 at 23:52 UTC
    no reason other than just not having used said .*

    technically, i should not have used that at all, but I thought I would throw another perspective in. and it does work, just as long as the input data never changes, etc (it's what drives my archaic website)
    -phill

      technically, i should not have used that at all

      Not true. In this case, you want the greediness. .* really is what you mean.