09-16-2008
Whatever the reason, an improvement (not merely a workaround!) would be to make sure you always use local variables in functions. This is a basic principle of modular coding; it helps keep code complexity down and reduces the risk that you end up with spaghetti code.
So, in other words, refactor retrieve_data() so that it receives the flow_string as an argument.
(We infer from the syntax that this is awk you are talking about.)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I have a stored procedure which has 5 out parameters. I need to call the stored procedure from the script.
When i use the following in my script,
db2 "CALL FCFM.PART_MASTER_TMP($Return_code,$Message,$Message1,$SQL,$Load_count)" >> $LOG_FILE
I am getting an error..
Please... (1 Reply)
Discussion started by: mac4rfree
1 Replies
2. Shell Programming and Scripting
Hi GUYS,
I need to trigger 3 stored procedure at the same time..
I know how to trigger the stored procedure. If anybody can tell me how to trigger 3 different process at the same time parallelly.. that would be helpful..
Thanks for your help in advance,
Magesh (1 Reply)
Discussion started by: mac4rfree
1 Replies
3. Infrastructure Monitoring
Hello,
I have a problem with package and name space.
require "/Mehran/DSGateEngineLib/general.pl";
use strict;
sub System_Status_Main_Service_Status_Intrusion_Prevention
{
my %idpstatus;
my @result;
&General_ReadHash("/var/dsg/idp/settings",\%idpstatus);
#print... (4 Replies)
Discussion started by: Zaxon
4 Replies
4. Programming
Hi ,
I have a dellimited .dat file and a sqlloader.
I want to call the sqlloader from a oracle stored procedure.
The procedure should return the result of sqlloader's execution. (3 Replies)
Discussion started by: Haque123
3 Replies
5. Shell Programming and Scripting
Hi
i want to call a oracle stored procedure from unix (using bash shell).
consider this is my oracle stored procedure with parameter
create procedure testproc(name IN varchar, age IN Number, id OUT Number )
AS
begin
id=1;
dbms_output.put.line('successfull validation')
end;... (6 Replies)
Discussion started by: barani75
6 Replies
6. Shell Programming and Scripting
Hi,
I want to create MySQL stored procedure and call the stored procedure using perl.
I tried like this:
use DBI;
my $dbh = DBI->connect ("DBI:mysql:test",
"root", "ibab",
{ RaiseError => 1, PrintError => 0});
$create_procedure =... (5 Replies)
Discussion started by: vanitham
5 Replies
7. Shell Programming and Scripting
How to call a stored procedure from shell program (1 Reply)
Discussion started by: noorm
1 Replies
8. Shell Programming and Scripting
I have written a stored procedure in oracle database, which is having a CLOB OUT parameter. How can i call this stored procedure from shell script and get the CLOB object in shell script variable? (0 Replies)
Discussion started by: vel4ever
0 Replies
9. Shell Programming and Scripting
How to call a stored procedure inside a loop
export PATH=$ORACLE_HOME/bin:$PATH
ORACLE_SID=xxxx; export ORACLE_SID ORAENV_ASK=NO
TODAY_DATE=$(date +"%Y%m%d")
LOGFILE=/var/opt/gogd/cust/scripts/${TODAY_DATE}_sap_cust_rel.log
echo 'Connected'
PARCUST=sap_cust_rel.par
sqlldr... (1 Reply)
Discussion started by: ashwanth
1 Replies
10. Shell Programming and Scripting
Hi, I am new to shell scripting and Sybase database i need a help that i try to execute a SYBASE stored procedure from a Unix shell script and wanna write the output of the SP into a Text File.somehow i try to find a solution but whwn i try to run the script i am not getting the output file with... (1 Reply)
Discussion started by: Arun619
1 Replies
LEARN ABOUT DEBIAN
perl::critic::policy::modules::prohibitexcessmaincomplexity
Perl::Critic::Policy::Modules::ProhibitExcessMainComplexUser3Contributed Perl DocuPerl::Critic::Policy::Modules::ProhibitExcessMainComplexity(3pm)
NAME
Perl::Critic::Policy::Modules::ProhibitExcessMainComplexity - Minimize complexity in code that is outside of subroutines.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
All else being equal, complicated code is more error-prone and more expensive to maintain than simpler code. The first step towards
managing complexity is to establish formal complexity metrics. One such metric is the McCabe score, which describes the number of possible
paths through a block of code. This Policy approximates the McCabe score by summing the number of conditional statements and operators
within a block of code. Research has shown that a McCabe score higher than 20 is a sign of high-risk, potentially untestable code. See
<http://en.wikipedia.org/wiki/Cyclomatic_complexity> for some discussion about the McCabe number and other complexity metrics.
Whereas Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity scores the complexity of each subroutine, this Policy scores the total
complexity of all the code that is outside of any subroutine declaration.
The usual prescription for reducing complexity is to refactor code into smaller subroutines. Mark Dominus book "Higher Order Perl" also
describes callbacks, recursion, memoization, iterators, and other techniques that help create simple and extensible Perl code.
CONFIGURATION
The maximum acceptable McCabe score can be set with the "max_mccabe"
configuration item. If the sum of all code outside any subroutine has a McCabe score higher than this number, it will generate a Policy
violation. The default is 20. An example section for a .perlcriticrc:
[Modules::ProhibitExcessMainComplexity]
max_mccabe = 30
NOTES
"Everything should be made as simple as possible, but no simpler."
-- Albert Einstein
Complexity is subjective, but formal complexity metrics are still incredibly valuable. Every problem has an inherent level of complexity,
so it is not necessarily optimal to minimize the McCabe number. So don't get offended if your code triggers this Policy. Just consider if
there might be a simpler way to get the job done.
SEE ALSO
Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.14.2 2012-06-07 Perl::Critic::Policy::Modules::ProhibitExcessMainComplexity(3pm)