in reply to renaming the file using perl

If I'm guessing your intentions correctly, you have some basic problems with your print statments. First, it looks like your print statements are trying to concatenate strings inside the quotation marks. This won't work. Your print statement should be something like this:

print "***rename $dir/$file", "$dir/$prefix$suffix\n"

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re^2: renaming the file using perl
by finddata (Sexton) on Mar 16, 2017 at 06:12 UTC
    by using the line which provided i got output as follows: rename /home/sa/dcms_html_output/DCMS_DEMO/de_top/Block_DV/Block_DV.co +nfig, /home/sa/dcms_html_output/DCMS_DEMO/de_top/Block_DV/DCMS_DEMO_d +e_top_Block_DV_1
    expected should be as follows:
    /home/sa/dcms_html_output/DCMS_DEMO/de_top/Block_DV/Block_DV.config, / +home/sa/dcms_html_output/DCMS_DEMO/de_top/Block_DV/DCMS_DEMO_de_top_B +lock_DV.config

      Your code is very hard to follow. Can I suggest you please:

      • Place comments in your code to help explain what you are trying to accomplish and what you think each chunk of code is doing
      • Use variable names in place of your long string concatenations to make it more readable
      • Use in-line comment for each variable name to help explain what the variable represents

      This will not only help us help you, it will help you understand your own code better. When you are new at programming, it's very difficult to keep track of what you are trying to do and it is easy to get lost. Comments and liberal use of variables will help you out a great deal.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks