in reply to using push
Give us a complete stand alone piece of code that shows the problem. Here we haven't enough context and can't infer the line that generates the error from your code. You may like to modify this until it shows the problem:
use strict; use warnings; my @syshosts = ('This is a Workstation'); my @serialOperations; foreach my $ttt (@syshosts) { if( $ttt =~ m/(Workstation|AnalogGateway)/ ) { push @serialOperations, $ttt; } }
Add use strict; use warnings; at the start of your code. They will save you a lot of grief!
|
---|