The output in @xlinks will be as below:use strict; use warnings; my ($xlink,@xlinkpaths); my $stream = "streamname"; my @xlinks = (`cmd to get xlinks`) ; foreach $xlink (@xlinks) { @xlinkpaths = } my @exclpaths = ( "wefwfewf/fewfff/", "btrtbrtb/gbrgbrg/rttty/", );
1)Format Querry: How to get the text after "/./" in the line that starts with "incl -s" into array @xlinkpaths. The final @xlinkpaths should look likeincl -s streamname /./abc/def xlink /./abc/def from streamname incl -s streamname /./xyz/qwen/defs/asd xlink /./xyzz/qwen/defs/asd from streamname
2) Appending to already existing array Querry: How to add them to the already existing array @exclpaths, so that the final @exclpaths should look like@xlinkpaths = ( "abc/def/", "xyzz/qwen/defs/asd", );
my @exclpaths = ( "abc/def/", "xyzz/qwen/defs/asd", "wefwfewf/fewfff/", "btrtbrtb/gbrgbrg/rttty/", );
In reply to Perl: Split/format the output and append it to an array by sravs448
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |