@thislist = ("a/apple", "b/banana/g", "c/cherry/d/f");
print(@thislist);
foreach $myFile (@thislist) {
@myList=split( '/', $myFile);
$size = @myList;
print("$size \n");
print("@myList \n")
}
output
a/appleb/banana/gc/cherry/d/f2
a apple
3
b banana g
4
c cherry d f
tried at https://www.learn-perl.org/
Passing array into subroutine, finding max, min
No comments:
Post a Comment