in reply to Regex output incorrect

You could sweat over this regular expression, or, you could use File::Basename::dirname which is part of the base (you don't have to download it).
use strict; use warnings; use File::Basename; my $folder_path = '/aboutiso/corp_gov/bod/agendas/2010'; $folder_path = dirname($folder_path); print "folderpath: $folder_path\n";
Gives:
folderpath: /aboutiso/corp_gov/bod/agendas

Replies are listed 'Best First'.
Re^2: Regex output incorrect
by jakeease (Friar) on Dec 14, 2010 at 19:14 UTC

    Yup; a nice wheel, already invented.