JSAWS has asked for the wisdom of the Perl Monks concerning the following question:
foreach $a (@NewPicList) { chomp($a); $a =~ s/^\s+//; if (grep(/$a\s+$/, @OldPicList)) { } else { push @NewPicFolders, "$a"; } } foreach $b (@NewPicFolders) { open (RD, "ls -l /dir1/dir2/dir3/'$b' |"); binmode RD, ':encoding(UTF-8)'; while (<RD>) { push @user_dir, $_; } close(RD); s{^\s+|\s+$}{}g foreach @user_dir; foreach $fileline (@user_dir) { @filenames = split(/\s+/,$fileline, 9); unless (@filenames[8] eq "") { $filenames[8] =~ s/\s+/_/g; push @PicList, "$filenames[8]\n"; } } print "PICLIST: @PicList"; open(FH, '>', "/dir1/dir2/dir3/$b.folder") or die $!; print FH "@PicList"; close FH; @PicList = (); @user_dir = (); @filenames = (); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why can't I figure this out?????
by Corion (Patriarch) on Aug 31, 2022 at 11:40 UTC | |
by NERDVANA (Priest) on Aug 31, 2022 at 21:51 UTC | |
by JSAWS (Novice) on Aug 31, 2022 at 11:44 UTC | |
by Corion (Patriarch) on Aug 31, 2022 at 11:45 UTC | |
by JSAWS (Novice) on Aug 31, 2022 at 12:30 UTC | |
|
Re: Why can't I figure this out?????
by hv (Prior) on Aug 31, 2022 at 12:46 UTC | |
|
Re: Why can't I figure this out?????
by JSAWS (Novice) on Aug 31, 2022 at 11:41 UTC |