in reply to Re: Writing to a file
in thread Writing to a file

well that sample i gave isn't my actual data but i do need a block of paths to be replaced, also I need a solution that works in a program and not a command line call. Thanks anyways though.

Replies are listed 'Best First'.
Re^3: Writing to a file
by AnomalousMonk (Archbishop) on May 05, 2017 at 22:21 UTC

    Just for future reference, a "command line call" can usually be converted into a "program" fairly easily:

    c:\@Work\Perl\monks>perl -MO=Deparse -pe "s#\bold(?=/path/to/some/)#ne +w#g" LINE: while (defined($_ = <ARGV>)) { s[\bold(?=/path/to/some/)][new]g; } continue { die "-p destination: $!\n" unless print $_; } -e syntax OK
    See O and B::Deparse.


    Give a man a fish:  <%-{-{-{-<

Re^3: Writing to a file
by Laurent_R (Canon) on May 05, 2017 at 21:09 UTC
    Translating such a Perl one-liner into an actual program is fairly simple, and we can help you. But the real point is this: is this what you need?

      No the directories do not differ by one word some are entirely different