in reply to Re^4: Using an hash ref to match files with directories
in thread Using an hash ref to match files with directories

Thanks - that is a significantly improved S/N ratio.

First : Why are you doing this no-op ?

my $seq = $seq; # capture the intials ($seq) from $targetfile

So it appears that you want to use the Initials-to-hash conversion in the sub "seq_customer_dirs".

Simply replace " if ($dir=~m%$seq%){" with

if ($dir =~m|$sequser{$seq}| ){

     Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)

Replies are listed 'Best First'.
Re^6: Using an hash ref to match files with directories
by lomSpace (Scribe) on Aug 13, 2009 at 16:22 UTC
    first response:
    This captures the initials from the targetfile. Those initials
    are what I need to check for a match with the keys in
    in the hash. Once I find a match, then I can use the value to
    work on the correct dir.

    Second response:
    The idea behind the sub seq_customer_dirs is to find the customer/user dir.
    Example: When the program runs across a file with the initials "MJ",
    which is captured by $seq, it checks for eq with a hash $key.
    If there is eq, hash $key = "MJ", then the value is returned as the dir.
    In this case the $value is "Michael Jordan" and that would be returned
    to the main program as the
    directory to work on.

    LomSpace