It uses part of Aristotle's idea with the reference to the first grouped part of the regular expression ($1).my @values; while (<>) { my $line = $_; my @elements = split( /\s/, $line ); for ( @elements ) { if ( /(-I.:.*)/ ) { push (@values, $1) }; } } for ( @values ) { print "$_\n" };
In reply to Re: Transforming only parts of input
by GhodMode
in thread Transforming only parts of input
by amoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |