Hello!
I need to make 3 arrays from the contents of $directory
.
The first one I can use:
$var = qx{ls $directory};
print $var;
However the second and third I want to grep for "Primary *" and "Secondary *"
I've used the commands:
my @primary = 0;
my @secondary = 0;
@primary = system("ls test_77 > test | grep Primary* test");
print @primary;
@secondary = system("ls test_77 > test | grep Secondary* test");
print @secondary;
BUT, it includes a zero on the output:
PrimaryCPE_Option_A.txt.test_77
PrimaryCPE_Option_B.txt.test_77
0SecondaryCPE_Option_A.txt.test_77
SecondaryCPE_Option_B.txt.test_77
0
What can it be? At first it looks like it might be the original zero, but I can change the initial value of either and it doesn't work.