readdir (DIR, "../doc/application_notes/alint_pro_getting_started/") or die "Can't open directory with images$!";#opendir foreach('*.png') { copy('*png','../release/strb/*.pmg') or die "Can't copy images for html$!"; #copy img; } closedir DIR; - Please specify the question by clicking edit - aleksandr barakin
- From the wording of the question is not entirely clear what the problem is. Any error? - Nick Volynkin β¦
|
1 answer
#!/usr/local/bin/perl use File::Copy; use strict; my $src = "1"; # ΠΊΠ°ΡΠ°Π»ΠΎΠ³-ΠΈΡΡΠΎΡΠ½ΠΈΠΊ "./1" my $dst = "2"; # ΠΊΠ°ΡΠ°Π»ΠΎΠ³-ΠΏΡΠΈΠ΅ΠΌΠ½ΠΈΠΊ "./2" opendir(my $dh, $src) || die "Can't opendir $src: $!"; my @file = grep { /.+\.png$/ && -f "$src/$_" } readdir($dh); closedir $dh; map { copy("$src/$_","$dst/$_") or die "Copy failed: $!"; } @file; /.+\.png$/:) - PinkTux- There is such a thing :) Corrected. - Majestio
|