>> my @str_start = qw ( 1 0 28 27 34 );
>> my @str_length = qw ( 8 9 10 9 2 );
>> my @search_key = qw (FILETYPE.ZIP RBZ RBZ Bytes Errors);
>>Since search_key is used in a regular expression it might be better to
>>create one.
>> my $search_key = qr/FILETYPE.ZIP|RBZ|RBZ|Bytes|Errors/;
But will qr execute search of regular expressions strings in that order?
>> open (MODEMLOG, "/opt/cleo/envoy/log/calenvoy.$MonthDay" ) or die
("Can
>> not open MODEMLOG");
>>You should include the $! variable in the error message so you know why
it failed.
Thank you - I will do that.
>> my @search_out = qw( \@env_start \@env_end \@env_files
\@env_bytes \@env_errors );
>>Here You are using qw() so this is the same as:
>> my @search_out = ('\@env_start', '\@env_end', '\@env_files','
\@env_bytes', '\@env_errors');
>> for ($i = 0; $i < @search_key; $i++)
>> {
>> ${search_out[$i]} = grep (/$search_key[$i]/,@modem_log);
>>You are assigning a list to a scalar here which is probably not what you
>>want. Also, why you are overwriting the current values in the
>>@search_out array?
My intention was to use search_out[$i] as reference to an array that
contain outcome of a search using the grep command e.g. reference to start
times (env_start array) or to end times (env_end) and soon. Is this usage
wrong???
>> for ($j = 0; $j < ${search_out[0]}; $j++)
>> {
>> ${search_out[$i]} = substr ($search_out[$i][$j],$str_start
>> [$j].$str_length[$j]);
>> }
>> }
>>
>> for ($i = 0; $i < @env_errors; $i++)
>> ^^^^^^^^^^^
>>Where did this come from?
This was intended to be one of the arrays created by grep - ing the string
Errors from the Modem Log.
Thanks for your help - Satya
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]