Reading the filename

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #31
    OK, well, that is all the help I can give you.

    Comment

    • ramesh54
      New Member
      • Jul 2008
      • 37

      #32
      Hi Kevin,

      At last was able to make the code work well.

      I had split the file name in this form

      d124_${t1}_SF_t ${s1}_r${s2}_s$ {s3}_m${s4}_${s 5}grad.txt instead of defining as $f1 directly. Also in the rename function, the code with variables works only with double quotes(") not doesn't work with single quotes. Same is the case with open function. It is really surprising!

      Thanks for all the help provided and I really appreciate this forum for the quick responses.

      Ramesh

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #33
        Originally posted by ramesh54
        Hi Kevin,

        At last was able to make the code work well.

        I had split the file name in this form

        d124_${t1}_SF_t ${s1}_r${s2}_s$ {s3}_m${s4}_${s 5}grad.txt instead of defining as $f1 directly. Also in the rename function, the code with variables works only with double quotes(") not doesn't work with single quotes. Same is the case with open function. It is really surprising!

        Thanks for all the help provided and I really appreciate this forum for the quick responses.

        Ramesh

        My apology. I did not notice the single-quotes. You must use double-quotes when there are scalars in the string. Perl will not interpolate scalars inside of single-quotes. This is a very basic concept of perl and is generally one of the first things you learn.

        Comment

        Working...