Hi,
I am new to perl and I have the following query please help here.
I have following array variables declaration
Code:
@pld1 = qw(00 01 02 03 04 05);
@pld2 = qw(10 11 12 13 14 15);
for(my $k=1;$k<=2;$k++)
{
//I want here to use @pld1 if $k is 1
// and @pld2 if $k is 2. How to do that ????
//I have user defined function 'send' below
send(@pld$k);
}
but the above function giving syntax error. how to substitute $k so that I send @pld1 when $k is 1 and @pld2 when $k is 2.
Thanks
Moderator's Comments:
Please view this code tag video for how to use code tags when posting code and data.
why do inode indices starts from 1 unlike array indexes which starts from 0
its a question from "the design of unix operating system" of maurice j bach
id be glad if i get to know the answer quickly
:) (0 Replies)
brothers why inode index starts from 1 unlike array inex which starts from 0
its a question from the design of unix operating system of maurice j.bach
i need to know the answer urgently...someone help please (1 Reply)
I come across the problems when assigning the array in the script below . How to use the array with the 'string index' correctly ? When I assign a new string index , the array elements that are previously assigned are all changed .:eek::eek::eek:
$ array=211
$ echo ${array}
211
$... (4 Replies)
hi folks
i am facing problom while trying to access sql variable as array index ina unix shell script....script goes as below..
#!/bin/ksh
MAX=3
for elem in alpha beeta gaama
do
arr=$elem
((x=x+1))
Done
SQL_SERVER='servername'
/apps/sun5/utils/sqsh -S $SQL_SERVER -U user -P pwd -b -h... (1 Reply)
Hi,
I'm just trying to use a dynamic index for some array elements that I'm accessing within a loop. Specifically, I want to access an array at variable position $counter and then also at location $counter + 1 and $counter + 2 (the second and third array positions after it) but I keep getting... (0 Replies)
I am trying to reformat the table by filling any missing rows. The final table will have consecutive IDs in the first column. My problem is the index of the associate array in the awk script.
infile:
S01 36407 53706 88540
S02 69343 87098 87316
S03 50133 59721 107923... (4 Replies)
I am trying to assign indexes to an associative array in a for loop but I have to use an eval command to make it work, this doesn't seem correct I don't have to do this with regular arrays
For example, the following assignment fails without the eval command:
#! /bin/bash
read -d "\0" -a... (19 Replies)
Hello,
I have a complicated situational find and replace that I wrote in bash because I didn't know how to do everything in awk. The code works but is very slow, as expected.
To create my modified file, I am looping through an array that was populated earlier and making some replacements at... (6 Replies)
Discussion started by: LMHmedchem
6 Replies
LEARN ABOUT DEBIAN
extutils::xspp::node::function
ExtUtils::XSpp::Node::Function(3pm) User Contributed Perl Documentation ExtUtils::XSpp::Node::Function(3pm)NAME
ExtUtils::XSpp::Node::Function - Node representing a function
DESCRIPTION
An ExtUtils::XSpp::Node subclass representing a single function declaration such as
int foo();
More importantly, ExtUtils::XSpp::Node::Method inherits from this class, so all in here equally applies to method nodes.
METHODS
new
Creates a new "ExtUtils::XSpp::Node::Function".
Named parameters: "cpp_name" indicating the C++ name of the function, "perl_name" indicating the Perl name of the function (defaults to the
same as "cpp_name"), "arguments" can be a reference to an array of "ExtUtils::XSpp::Node::Argument" objects and finally "ret_type"
indicates the (C++) return type of the function.
Additionally, there are several optional decorators for a function declaration (see ExtUtils::XSpp for a list). These can be passed to the
constructor as "code", "cleanup", "postcall", and "catch". "catch" is special in that it must be a reference to an array of class names.
resolve_typemaps
Fetches the ExtUtils::XSpp::Typemap object for the return type and the arguments from the typemap registry and stores a reference to those
objects.
resolve_exceptions
Fetches the ExtUtils::XSpp::Exception object for the %catch directives associated with this function.
add_exception_handlers
Adds a list of exception names to the list of exception handlers. This is mainly called by a class' "add_methods" method. If the function
is hard-wired to have no exception handlers, any extra handlers from the class are ignored.
print_declaration
Returns a string with a C++ method declaration for the node.
perl_function_name
Returns the name of the Perl function to generate.
is_method
Returns whether the object at hand is a method. Hard-wired to be false for "ExtUtils::XSpp::Node::Function" object, but overridden in the
ExtUtils::XSpp::Node::Method sub-class.
has_argument_with_length
Returns true if the function has any argument that uses the XS length feature.
ACCESSORS
cpp_name
Returns the C++ name of the function.
perl_name
Returns the Perl name of the function (defaults to same as C++).
set_perl_name
Sets the Perl name of the function.
arguments
Returns the internal array reference of ExtUtils::XSpp::Node::Argument objects that represent the function arguments.
ret_type
Returns the C++ return type.
code
Returns the %code decorator if any.
set_code
Sets the implementation for the method call (equivalent to using %code); takes the code as an array reference containing the lines.
cleanup
Returns the %cleanup decorator if any.
postcall
Returns the %postcall decorator if any.
catch
Returns the set of exception types that were associated with the function via %catch. (array reference)
set_static
Sets the "static"-ness attribute of the function. Can be either undef (i.e. not static), "package_static", or "class_static".
package_static
Returns whether the function is package static. A package static function can be invoked as:
My::Package::Function( ... );
class_static
Returns whether the function is class static. A class static function can be invoked as:
My::Package->Function( ... );
perl v5.14.2 2011-12-20 ExtUtils::XSpp::Node::Function(3pm)