# How many pictures you have in your rotate folder my $num_of_pics = 10; #### # How many pictures you have in your rotate folder my $num_of_pics = () = <~/Pictures/rotate/*.jpg>; #### my @all_pics = <~/Pictures/rotate/*.jpg>; print `feh --bg-center $all_pics[ rand @all_pics ]`; #### # Get a random number from your total of pictures my $pic = int(rand($num_of_pics)+1); chomp($pic);