Help for this page

Select Code to Download


  1. or download this
    foreach (@files)
    {
    ...
          $_ = map m{([^/]+)\.txt}, $_;  #Strip out of the string the path
    + and extension leaving only the filename intact
          ...
    }
    
  2. or download this
    ( my $name ) = m{ ([^/]+) \.suffix }x;
    
    ...
    
    use File::Basename;
    my $name = fileparse( $_ , qr{ \.suffix }x );