I keep getting compile errors.Try to put the following at the beginning of your script:
and you should get better info about what's going wrong. At a first glance, you're missing the foreach closing brace. Please note that using strict obliges you to declare all your variables before you use them, which you should appreciate as a C++ programmer :)use strict; use warnings; use diagnostics;
If each $line contains the whole stuff, you'll have hard times. You should probably split using "," as a separator, then iterate thru the elements:
Note: CODE UNTESTED!!!foreach my $line (@lines) { chomp $line; foreach my $element (split /,/ , $line) { my $extension = substr($element, -3) || ''; if ( $extension eq 'exe' ) { push @dllarray, "[$element]"; } elsif ( $extension eq 'dll' ) { push @dllarray, $element; } } }
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re: noob regexpression question
by polettix
in thread noob regexpression question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |