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

Hi NetWallah!
I meant "seq_user_base". The source and target directories are:
$root and the perl system call immediately following it.
  • Comment on Re^2: Using an hash ref to match files with directories

Replies are listed 'Best First'.
Re^3: Using an hash ref to match files with directories
by NetWallah (Canon) on Aug 11, 2009 at 05:53 UTC
    Unfortunately, your telepathic transmissions have a very poor signal-to-noise ratio, and even with reception tuned to the highest sensitivity, I am regrettably unable to decode them.

    Please describe your problem better, and also let us know the results of following the suggestions you have received.

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

      NetWallah,
      I need to copy files from one dir to another. The directories are on two
      separate machines across a file share. The files names start with initials
      followed by an underscore, then some other characters. I need to put
      these files into their respective customer dir.

      The customer dir name is the first and last name of the
      customer. Example: Michael Jackson. So, in order to copy
      a file/s that belong to Michael Jackson I need to match
      his initials with his name. That is where the %sequser
      hash comes in. It creates a mapping between the initials and name.

      My idea is to match the initials of the customer, the values in the hash,
      with the initials at the beginning of the file. Then I will know which user
      dir to copy the file.

      I hope that I have significantly decreased the signal-to-noise ratio.

      LomSpace
        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)

        And do you have a plan of action ready for the day when Marvin Jones and Mary Johnson join the late Mr. Jackson on your customer list?