This question is for someone that's more familiar with Array Element.
I need to know if the maximum array element that can be assigned is 1024 and if its so, Is there a workaround solution when the counter exceeded 1024?
When the parm_value is more than 750 we do lose parameter value and I need to find out if there is a workaround using array element since there is a limitation to it.
Our shell script is korn shell on AIX platform.
Thanks
Moderator's Comments:
Please use code tags next time for your code and data. Thanks
Last edited by vbe; 12-05-2014 at 01:42 PM..
Reason: code tags... not PARSE
Hello everyonel,
I have an array set like so
num=4
read name
arr=name
I go through while loop to assign different values to different array element from 1 to 4. when I try to access the FIRST element of the array I get the last one first. Like if I say ${arr} it will show the last element... (4 Replies)
All,
I would like to add the first 10 elements of an array. Here is how I am doing it now (only included first few add ops):
#!/usr/bin/ksh
###Grab the array values out of a file###
TOTAL=`awk '/time/' /tmp/file.out | awk '{print $4}'`
set -A times $TOTAL
SUM=$((${times} + times... (3 Replies)
I have a loop and I need to be able to unset the array element that I am currently accessing in it. I was thinking of making a counter that increments with the loop and doing unset $dirs but if I do that I am not sure if the other members of the array would get shifted down in index (meaning that... (2 Replies)
I need to remove an element from the below array variable TABLENAME.
#!/bin/ksh
set -A TABLENAME "mirf roxar keke mirs"
echo "the array is ${TABLENAME}"
If i need to remove say keke and have the final TABLENAME as below, how this could be achieved. Pls throw some light.
echo "Modified... (3 Replies)
Hi every one.. I'm new to shell scripting... I would like to assign a single array element to a variable... Is it possible to do it....
Could any body help me.... (3 Replies)
Hi, How to get previous/next element in the array perl
Example
@queue = (1, 2 ,3 , 4);
I want to get value of 1 and 2, or, 2 and 3, or 3 and 4...etc and compare to value which one is greater to do that I need to get previous and next element of array ? (1 Reply)
set -A matched #find referenced files.
for i in ${file_names_html}
do
counter_j=0
for j in ${file_names_minus_index}
do
match=`cat $i | grep... (1 Reply)
Hello forum ,
Please solve the below queery.
A sorted array which has repated elements.
A = {1,2,3,3,4,5,5,5,6,9,9}
i want to delete the duplicate elements and to genrate a new array.
i need the array sholud be like this
A = {1,2,3,4,5,6,9}.
Please write the piece of code... (4 Replies)
I am trying to take all the elements of an array and multiply them by 2, and then copy them to a new array. Here is what I have
i=0
for true in DMGLIST
do
let DMGSIZES2="${DMGSIZES}"*2
let i++
done
unset i
echo ${DMGSIZES2}
It does the calculation correctly for the first element,... (7 Replies)
Discussion started by: nextyoyoma
7 Replies
LEARN ABOUT DEBIAN
moosex::attributehelpers::trait::counter
MooseX::AttributeHelpers::Trait::Counter(3pm) User Contributed Perl Documentation MooseX::AttributeHelpers::Trait::Counter(3pm)NAME
MooseX::AttributeHelpers::Counter - simple counter attribute
SYNOPSIS
package MyHomePage;
use Moose;
use MooseX::AttributeHelpers;
has 'counter' => (
metaclass => 'Counter',
is => 'ro',
isa => 'Num',
default => sub { 0 },
provides => {
inc => 'inc_counter',
dec => 'dec_counter',
reset => 'reset_counter',
}
);
my $page = MyHomePage->new();
$page->inc_counter; # same as $page->counter($page->counter + 1);
$page->dec_counter; # same as $page->counter($page->counter - 1);
DESCRIPTION
This module provides a simple counter attribute, which can be incremented and decremeneted.
If your attribute definition does not include any of is, isa, default or provides but does use the "Counter" metaclass, then this module
applies defaults as in the "SYNOPSIS" above. This allows for a very basic counter definition:
has 'foo' => (metaclass => 'Counter');
$obj->inc_foo;
METHODS
meta
method_provider
has_method_provider
helper_type
process_options_for_provides
Run before its superclass method.
check_provides_values
Run after its superclass method.
PROVIDED METHODS
It is important to note that all those methods do in place modification of the value stored in the attribute.
set Set the counter to the specified value.
inc Increments the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount.
dec Decrements the value stored in this slot by 1. Providing an argument will cause the counter to be increased by specified amount.
reset
Resets the value stored in this slot to it's default value.
BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to
cpan-RT.
AUTHOR
Stevan Little <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2007-2009 by Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-01-02 MooseX::AttributeHelpers::Trait::Counter(3pm)