Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    $newdir =~ s/$oldroot_regex/$newroot/
        or warn "Can't find pattern '$oldroot_regex' in dir string '$newdi
    +r'";
    print "newdir now: '$newdir'\n\n";
    
  2. or download this
        Oldroot will be used as the pattern; It is 'c:\top'
        newdir was: 'c:\top\dir\file'
    ...
        Escaped pattern is 'c\:\\top'
        newdir was: 'c:\top\dir\file'
        newdir now: 'c:\newtop\dir\file'