I am really having trouble making any sense of your code.

I started by re-organizing your first statements with spacing
and some print statements:

use strict; use warnings; my $footprint_im = 'jpg gif png tiff tif'; $footprint_im .= ' '.uc $footprint_im; $footprint_im =~ s/ /\$\|/g; print "footprint_im = $footprint_im\n\n"; # footprint_im = jpg$|gif$|png$|tiff$|tif$|JPG$|GIF$|PNG$|TIFF$|TIF my $footprint_iv = '^vid.+ 3gp mp4 avi'; $footprint_iv .= ' '.uc $footprint_iv; $footprint_iv =~ s/ /\$\|/g; print "footprint_iv = $footprint_iv\n\n"; # footprint_iv = ^vid.+$|3gp$|mp4$|avi$|^VID.+$|3GP$|MP4$|AVI my $footprint_lnk = 'lnk'; $footprint_lnk .= ' '.uc $footprint_lnk; $footprint_lnk =~ s/ /\$\|/g; print "footprint_lnk = $footprint_lnk\n\n"; # footprint_lnk = lnk$|LNK
I am very confused about where @input comes from?

A statement like this: for($i = 1 ; $i <= @ff ;$i++){} means to iterate to the number of elements in the ff array. WHAT?

Perhaps start by explaining what you are trying to do. Then get some code to compile with use warnings; use strict;

Update: Perhaps:

my @image_files = grep{/\.jpg$|\.gif$|\.tiff$|\.tif$/i}readdir $target +_dir; my @video_files = grep{/^VID.+|\.3gp$|\.mp4$|\.avi$/i}readdir $target_ +dir;
Oh, I am a bit dubious about the "begins with VID" idea.

In reply to Re: Strange result on array by Marshall
in thread Strange result on array by solocazzimiei

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.