I want to search for a pattern inside files and compare the lines containing the same pattern.Firstly, I want to split the lines based on space and store them in an array and then compare. Depending on the size array @store, the multidimensional array (@list_of_arguments)should get updated. And the count variable is for the number of files in which the pattern is present.
expected output-->the lines containing the search pattern must split up based on spaces and the elements of all such arrays must sit in different multidimensional array locations for further operation.
This gives a compilation error in the syntax of the multidimensional array. Below is the small code snippet.
if ($line =~ /$string/)
{
print "$line\n";
@store = split(" ",$line);
my $size = @store;
print "$size\n";
for($l=0;$l<$size;$l++){
@list_of_arguments[$count][$size] = @store[$size];
print "@list_of_arguments\n";
}
}