Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はファイルの完全なパスを持っています。完全なパスを削除して出力として hai/hello/home/something/file.txt取得するにはどうすればよいですか?file.txt
hai/hello/home/something/file.txt
file.txt
grepでそれを行う方法は?
#!/usr/bin/perl use File::Spec; use File::Basename; $n="hai/hello/home/something/file.txt"; my $m = basename $n; print "$m";