Gday, I like your code, it seems familiar :-) A few quick points:

1 I don't understand what your question is. What exactly do you want to do? Many monks will not have seen A monk in training with a problem so you will need to spell things out carefully. Usually you continue to post under that node but if there has been a significant delay (ie over a day!) a new post often helps to get your problem back on the radar screen at newest nodes.

2 When you post code the shorter the better - you can ditch all the comments. I added these for your benefit but here they just make the code look long which it is not. When I see a big chunk of code I tend to go - bzzt - failure to reduce code to short test case - jump to next node.

3 Long variable names are descriptive but once you get too long *typos* become far more common.

4 I presume that the commented out code at the end is trying to rename the files and write a text file. Here is how you might do that.
<begin_standard_disclaimer>Warning totally untested, I'm just making this up as I go.</end_standard_disclaimer>

open (FILE, ">data.txt") or die "Oops! Perl whines: $!\n"; for my $i (0..$#screenres) { rename "$base_dir/$screenres[$i]", "$base_dir/".$i."_sc.jpg" or d +ie "Rename failure, Perl moans: $!\n"; print FILE "Renamed $base_dir/$screenres[$i] to $base_dir/".$i."_ +sc.jpg\n"; # continue in the same vein as required } close FILE;

*Important note* when you open a file for writing with > you *stomp* on the old file, ie overwrite it! If you want to append to (ie add to the end of) an existing file without erasing the existing data you use >>

# opens data.txt for writing, *erases* old data.txt open (FILE, ">data.txt") # opens data.txt for appending, adds data to end of data.txt open (FILE, ">>data.txt")

Hope this helps

cheers

tachyon


In reply to Re: Seeking Wisdom........... Again by tachyon
in thread Reorganizing Files in a Directory by wiz

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.