Assuming the following code
sub foo {
dosomething {...}
else { foo }
is the number of times foo has been called kept track of internally and how could I access that count? (1 Reply)
Hello people,
Need help !!! What am I doing wrong here ?
I am writing a function to recursively list the files under a folder and it's sub-folders. Problem is once it list the files under the innermost folder, it terminates. What do I need to do so that it returns and list files under the... (3 Replies)
Hi, Can anyone help me figure out the problem I'm having with a function call?
I have a header file, which sets an enum:
typedef enum {INFO, WARNING, FATAL} Levels;
int log_event (Levels, char *fmt, ...);
..then the function is called this way:
log_event(INFO, "Message text");
... (6 Replies)
I have a function check_ok in my abc.sh. which return me 1 or 0 . I want to call this fuction through other shell script. this shell also send two parameter to calling function.
Can you please tell me how. I am very new in unix.
#!/bin/bash
date_equal()
{
sqlplus -silent... (4 Replies)
hi,
can any one help me to correct this function call.
awk -F "," '{ {first=$1; sec=$2; tro=$3;quat=$4 }
if (tro == "")
{
$3 = search "$file2" "$first" "$file3"
{print $1","$2","$3","$4} }
else
{print $1","$2","$3 $4}}' $file1 > $file
search ()
{ (2 Replies)
Hi foiks
i am unable to find what is wrong in my code
mu functionality is to exit from shell when i give 99 but it is not calling function ext
Could you please correct me.
read option
if ;
then
ext
else
echo "out"
fi
function ext
{
echo "tested 99 and exit... (12 Replies)
Hi,
I am running a perl script to automate a process and I keep running into a error can't find the "value"
Can't call method "value" on an undefined value at process_file.pl line 44.
file is CVS
cell is ifdfdxrfmp.ksh
Here is the script I have also attached it as well:
... (2 Replies)
Hi
I have created a function in a Shell Script test.sh
function fnTest()
{
echo "My first Method
}
I have called this function in my test.sh
cat abc.txt | grep "test"
echo " test"
fnTest
But while running the shell script i got the following error:
... (2 Replies)
Perl::Critic::Policy::Modules::ProhibitConditionalUseStaUsernContributed Perl DoPerl::Critic::Policy::Modules::ProhibitConditionalUseStatements(3)NAME
Perl::Critic::Policy::Modules::ProhibitConditionalUseStatements - Avoid putting conditional logic around compile-time includes.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Modules included via "use" are loaded at compile-time. Placing conditional logic around the "use" statement has no effect on whether the
module will be loaded. Doing so can also serve to confuse the reader as to the author's original intent.
If you need to conditionally load a module you should be using "require" instead.
This policy will catch the following forms of conditional "use" statements:
# if-elsif-else
if ($a == 1) { use Module; }
if ($a == 1) { } elsif ($a == 2) { use Module; }
if ($a == 1) { } else { use Module; }
# for/foreach
for (1..$a) { use Module; }
foreach (@a) { use Module; }
# while
while ($a == 1) { use Module; }
# unless
unless ($a == 1) { use Module; }
# until
until ($a == 1) { use Module; }
# do-condition
do { use Module; } if $a == 1;
do { use Module; } while $a == 1;
do { use Module; } unless $a == 1;
do { use Module; } until $a == 1;
# operator-do
$a == 1 || do { use Module; };
$a == 1 && do { use Module; };
$a == 1 or do { use Module; };
$a == 1 and do { use Module; };
# non-string eval
eval { use Module; };
Including a module via "use" in bare blocks, standalone do blocks, or string evals is allowed.
# bare block
{ use Module; }
# do
do { use Module; }
# string eval
eval "use Module";
CONFIGURATION
This Policy is not configurable except for the standard options.
AUTHOR
Peter Guzis <pguzis@cpan.org>
COPYRIGHT
Copyright (c) 2010-2011 Peter Guzis. 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.16.3 2014-06-09 Perl::Critic::Policy::Modules::ProhibitConditionalUseStatements(3)