Sponsored Content
Special Forums UNIX and Linux Applications Infrastructure Monitoring diffrence between method call and function call in perl Post 302302003 by KevinADC on Sunday 29th of March 2009 06:05:34 PM
Old 03-29-2009
Its worth nothing that the below elsif condition will never be evaluated:

Code:
   elsif ($idpstatus{'ENABLE_IPS'} eq 'off'){
      $result[0] = 'off';
   }

I leave it up to you to figure out why that is.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl function call tracking

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)
Discussion started by: thumper
1 Replies

2. Shell Programming and Scripting

function call

can I call a function in bash script just as in C++ while do function() done function() thanks, Steffen (3 Replies)
Discussion started by: forever_49ers
3 Replies

3. Shell Programming and Scripting

Recursive method call getting terminated ???

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)
Discussion started by: tipsy
3 Replies

4. Programming

Help with a function call

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)
Discussion started by: Stevhp
6 Replies

5. Shell Programming and Scripting

call function

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)
Discussion started by: Jamil Qadir
4 Replies

6. Shell Programming and Scripting

function call

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)
Discussion started by: kamel.seg
2 Replies

7. Shell Programming and Scripting

Function Call

Hi, I have a string corresponding to a function. How I can call that function without if statement? Thanks in advance. (4 Replies)
Discussion started by: Zaxon
4 Replies

8. Shell Programming and Scripting

Function call

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)
Discussion started by: kojo
12 Replies

9. Emergency UNIX and Linux Support

Perl error: Can't call method "value" on an undefined value

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)
Discussion started by: vpundit
2 Replies

10. Shell Programming and Scripting

How to Call a Function

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)
Discussion started by: nanthagopal
2 Replies
TAP::Parser::SourceHandler(3pm) 			 Perl Programmers Reference Guide			   TAP::Parser::SourceHandler(3pm)

NAME
TAP::Parser::SourceHandler - Base class for different TAP source handlers VERSION
Version 3.23 SYNOPSIS
# abstract class - don't use directly! # see TAP::Parser::IteratorFactory for general usage # must be sub-classed for use package MySourceHandler; use base qw( TAP::Parser::SourceHandler ); sub can_handle { return $confidence_level } sub make_iterator { return $iterator } # see example below for more details DESCRIPTION
This is an abstract base class for TAP::Parser::Source handlers / handlers. A "TAP::Parser::SourceHandler" does whatever is necessary to produce & capture a stream of TAP from the raw source, and package it up in a TAP::Parser::Iterator for the parser to consume. "SourceHandlers" must implement the source detection & handling interface used by TAP::Parser::IteratorFactory. At 2 methods, the interface is pretty simple: "can_handle" and "make_source". Unless you're writing a new TAP::Parser::SourceHandler, a plugin, or subclassing TAP::Parser, you probably won't need to use this module directly. METHODS
Class Methods "can_handle" Abstract method. my $vote = $class->can_handle( $source ); $source is a TAP::Parser::Source. Returns a number between 0 & 1 reflecting how confidently the raw source can be handled. For example, 0 means the source cannot handle it, 0.5 means it may be able to, and 1 means it definitely can. See "detect_source" in TAP::Parser::IteratorFactory for details on how this is used. "make_iterator" Abstract method. my $iterator = $class->make_iterator( $source ); $source is a TAP::Parser::Source. Returns a new TAP::Parser::Iterator object for use by the TAP::Parser. "croak"s on error. SUBCLASSING
Please see "SUBCLASSING" in TAP::Parser for a subclassing overview, and any of the subclasses that ship with this module as an example. What follows is a quick overview. Start by familiarizing yourself with TAP::Parser::Source and TAP::Parser::IteratorFactory. TAP::Parser::SourceHandler::RawTAP is the easiest sub-class to use an an example. It's important to point out that if you want your subclass to be automatically used by TAP::Parser you'll have to and make sure it gets loaded somehow. If you're using prove you can write an App::Prove plugin. If you're using TAP::Parser or TAP::Harness directly (e.g. through a custom script, ExtUtils::MakeMaker, or Module::Build) you can use the "config" option which will cause "load_sources" in TAP::Parser::IteratorFactory to load your subclass). Don't forget to register your class with "register_handler" in TAP::Parser::IteratorFactory. Example package MySourceHandler; use strict; use vars '@ISA'; # compat with older perls use MySourceHandler; # see TAP::Parser::SourceHandler use TAP::Parser::IteratorFactory; @ISA = qw( TAP::Parser::SourceHandler ); TAP::Parser::IteratorFactory->register_handler( __PACKAGE__ ); sub can_handle { my ( $class, $src ) = @_; my $meta = $src->meta; my $config = $src->config_for( $class ); if ($config->{accept_all}) { return 1.0; } elsif (my $file = $meta->{file}) { return 0.0 unless $file->{exists}; return 1.0 if $file->{lc_ext} eq '.tap'; return 0.9 if $file->{shebang} && $file->{shebang} =~ /^#!.+tap/; return 0.5 if $file->{text}; return 0.1 if $file->{binary}; } elsif ($meta->{scalar}) { return 0.8 if $$raw_source_ref =~ /d..d/; return 0.6 if $meta->{has_newlines}; } elsif ($meta->{array}) { return 0.8 if $meta->{size} < 5; return 0.6 if $raw_source_ref->[0] =~ /foo/; return 0.5; } elsif ($meta->{hash}) { return 0.6 if $raw_source_ref->{foo}; return 0.2; } return 0; } sub make_iterator { my ($class, $source) = @_; # this is where you manipulate the source and # capture the stream of TAP in an iterator # either pick a TAP::Parser::Iterator::* or write your own... my $iterator = TAP::Parser::Iterator::Array->new([ 'foo', 'bar' ]); return $iterator; } 1; AUTHORS
TAPx Developers. Source detection stuff added by Steve Purkis SEE ALSO
TAP::Object, TAP::Parser, TAP::Parser::Source, TAP::Parser::Iterator, TAP::Parser::IteratorFactory, TAP::Parser::SourceHandler::Executable, TAP::Parser::SourceHandler::Perl, TAP::Parser::SourceHandler::File, TAP::Parser::SourceHandler::Handle, TAP::Parser::SourceHandler::RawTAP perl v5.16.2 2012-10-25 TAP::Parser::SourceHandler(3pm)
All times are GMT -4. The time now is 01:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy