sub relpath($) { my $file = shift; my $newfile = ""; $file =~ s/\n//g; # remove new lines my @peices = split /\//, $file; for (my $i = 0; $i <= $#peices; $i++) { if ($peices[$i + 1] eq "..") { last; } if ($peices[$i] ne ".") { $newfile .= "/$peices[$i]"; } } $newfile =~ s/\/\//\//g; return $newfile; }
In reply to Re: How do I change .. to the real filename?
by dcardamo
in thread How do I change .. to the real filename?
by dcardamo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |