Replacement problem

From: prasanna bhat mavinkuli (boss_bhat_at_yahoo.co.in)
Date: 03/02/05


Date: 2 Mar 2005 07:02:57 -0800

Hi all,

 Iam wet behind the ears as for as Perl is concerned. I have got
a problem, well its a real puzzle for a fresher like me.
In my code i just want to create a source directory structure in
a target directory. I am finding all the subdirectories in the
source directory and creating it in the target directory during run
time. And i am failing to do so because directory name
contains(+,- etc). So its a metacharacter problem. Also I want to
retain the directory names as it is. So here is the piece of
code, but i have initialized values for the arrays to illustrate,

@stor_array=("/dir+a/dir2","/dir+a/dir2/lost+found/","/dir+a/dir2/kallu+mat","/dir+a/dir2/kallu+mat","/dir+a/dir2/kallu+ma-jon");

$dir="dir+a";
$temp="target";
foreach (@stor_array){
        s/$dir/$temp\/Files\//;
        print $_ ,"\n";
        }
Please somebody help me to achieve the replacement.

thanks in advance
Prasanna Bhat Mavinkuli



Relevant Pages

  • Re: Importing javax.faces.context.FacesContext for Glassfish
    ... correct?), you still have to copy the JSPs and HTMLs to web/, the JARs to web/WEB-INF/lib, then drop to web/ and jar the whole thing into a WAR file for deployment to your app server. ... I usually use web/ as the source directory for web artifacts, src/ as the top of the source tree, build/ as the target of the build, and dist/ as the target directory to build the WAR file. ...
    (comp.lang.java.help)
  • Re: Replacement problem
    ... prasanna bhat mavinkuli wrote: ... > source directory and creating it in the target directory during run ...
    (comp.lang.perl.misc)
  • File.renameTo(File)
    ... I'm running 1.5 version of java and I'm simply attempting to move a file from a ... source directory to a target directory. ... It seems the renameTo works fewer times than it does. ...
    (comp.lang.java.programmer)
  • Re: Copy folder and paste to another folder
    ... I am trying to do the same thing except my source directory changes with ... Dim fso As Object ... The directory gets copied except I get a Type mismatch error and my ...
    (microsoft.public.excel.programming)