hi
this is an example of code:
use strict;
use warnings;
open FILE, "/tmp/result_2";
my $regex="\\ Starting program ver. (.*)";
my $res="Program started, version <$1> - OK.\n";
while (<FILE>) {
if ($_ =~ /($regex)/) {
print "$res";
}
}
close FILE;
This finds $regex and print... (3 Replies)
I am facing a strange error while creating posix threads:
Given below are two snippets of code, the first one works whereas the second one gives a garbage value in the output.
Snippet 1
This works:
--------------
int *threadids;
threadids = (int *) malloc (num_threads * sizeof(int));
... (4 Replies)
A file contains the following information shown below. Every ceName has 2 consecutive lines that have to be evaluated, using awk, sed, cut (any common unix tools).
Input file:
ceName: Node-1
processName: tzMgmt
Status: PROCESS_NOT_RUNNING
ceName: Node-2
processName: tzMgmt
Status:... (15 Replies)
I'm attempting to grep for lines formatted like this:
grep -e '^\\",'
Any suggestions as to why this isn't working?
---------- Post updated at 05:03 PM ---------- Previous update was at 04:17 PM ----------
This was my solution:
grep -e '^\'\",'
It's hard to read, but basically I... (4 Replies)
Hello to all,
I'm trying to separate the string "str" using a regex within match function.
The substrings that I want to separate, begin with 22, 23, 24 or 25 and followed by 12 or 14 characters. And I want to
replace 22 with MJS, 23 with UYT, 24 with WER and 25 with PIL.
For this string... (4 Replies)
hi all
I have to read a long cvs file every 4 columns with decimal "3,45" numbers.
The 9th row in this cvs is the first line I need, so it I tail -n+9.
I use sed -e 's/,/./g' to get decimal values with . delimiter.
So far no problem.
Goal is to get two maximum negative forces in ranges... (5 Replies)
hello,
i need a bit of help on how to do this effectively in bash without a lot of extra looping or massive switch/case
i have a long array of M elements and a short array of N elements, so M > N always. M is not a multiple of N.
for case 1, I want to stretch N to fit M
arrayHuge
H = (... (2 Replies)
Hello,
i have a script that i need account_number to match a name.
for exsample :
ACCOUNT_ID=(IatHG8DC7mZbdymSoOr11w KbnlG2j-KRQ0-1_Xk356s8)
and i run a loop curl requst with this the issue is that i want to know on
which account were talking about so bash will know this :
... (4 Replies)
Hello,
I'm looking at simplfying a function that flattens an array, it uses recursion and filters objects by type but this seems to be a waste of resources to me at least, using conditionals like this seems like a bad idea.
The array can be a generic type, int, string, float but not some... (2 Replies)
This may be a dupe, but the problem is not complex,it is simple issue.
I can create an array of string(s) located in positioning parameters for further processing. Works as expected.
Now I like to send / write each string , space separated words , into a file.
Of course I tried... (4 Replies)
Discussion started by: annacreek
4 Replies
LEARN ABOUT DEBIAN
je::object::array
JE::Object::Array(3pm) User Contributed Perl Documentation JE::Object::Array(3pm)NAME
JE::Object - JavaScript Array object class
SYNOPSIS
use JE;
use JE::Object::Array;
$j = new JE;
$js_array = new JE::Object::Array $j, 1, 2, 3;
$perl_arrayref = $js_array->value; # returns [1, 2, 3]
$js_array->[1]; # same as $js_array->value->[1]
"$js_array"; # returns "1,2,3"
DESCRIPTION
This module implements JavaScript Array objects.
The "@{}" (array ref) operator is overloaded and returns a tied array that you can use to modify the array object itself. The limitations
and caveats mentioned in "JE::Object/"USING AN OBJECT AS A HASH"" apply here, too.
METHODS
See JE::Types for descriptions of most of the methods. Only what is specific to JE::Object::Array is explained here.
$a = JE::Object::Array->new($global_obj, @elements)
$a = JE::Object::Array->new($global_obj, $length)
$a = JE::Object::Array->new($global_obj, @elements)
This creates a new Array object.
If the second argument is an unblessed array ref, the elements of that array become the elements of the new array object.
If there are two arguments and the second is a JE::Number, a new array is created with that number as the length.
Otherwise, all arguments starting from the second one become elements of the new array object.
$a->value
This returns a reference to an array. This is a copy of the Array object's internal array. If you want an array through which you can
modify the object, use @$a.
SEE ALSO
JE
JE::Types
JE::Object
perl v5.14.2 2012-03-18 JE::Object::Array(3pm)