G'day subhash1198,

Welcome to the monastery.

[For future reference, don't mark your questions to be dealt with ASAP, urgently or anything like that. Questions are answered fairly quickly. Suggesting that we drop what we're doing and rush to your aid won't work. At best, your question will answered just as quickly as it would have been anyway; at worst, you will annoy people who'll delay answering or not answer at all.]

"This script outputs Images/test.tif."

I can't see anything in your posted code that would output "Images/test.tif". Have you posted the code you're running (or perhaps an old version)?

$number appears to be formatted in way that might produce "001":

$ perl -le 'print sprintf("%0*d", 3, 1)' 001

If that's the right variable, then you'll need something in your code that looks like:

print ".../$number/..."

If you're expecting another variable to hold "001", please tell us.

If you're concatenating variables to generate your output, check those variables individually, e.g.

print "number='$number'; tiffpath='$tiffpath'; ...";

Use similar print statements elsewhere to check variables hold the values you're expecting.

-- Ken


In reply to Re: Traverse directory backwards based on file by kcott
in thread Traverse directory backwards based on file by subhash1198

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.