[ale] Perl Regexe questions

Christopher Fowler cfowler at outpostsentinel.com
Wed Jun 16 00:00:13 EDT 2004


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];



More information about the Ale mailing list