[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Perl Regexe questions
Non module method:
$target =~ s(^.*/)();
On Tue, 2004-06-15 at 21:24, Fletch wrote:
> >>>>> "Keith" == Keith R Watson <keith.watson at gtri.gatech.edu> writes:
>
> [...]
>
> Keith> use File::Basename;
>
> Keith> my ($other_way, undef, undef) = fileparse($full_path,);
>
> Keith> print ($other_way, "\n");
>
> Actually my $name = basename( $full_path ) would probably be better
> (not to mention the undefs are extraneous as any extra list elements
> would just be dropped; a more succinct way would have been
>
> my $path = ( fileparse( $full_path ) )[0];