Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Strange result on array

by Marshall (Canon)
on Mar 31, 2021 at 03:32 UTC ( [id://11130624]=note: print w/replies, xml ) Need Help??


in reply to Strange result on array

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130624]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2024-04-25 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found