10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi friends,
I want to compare two arrays and find matched one using perl?
Also, I want to delete unmatched one.
Plz suggest me solution (1 Reply)
Discussion started by: Renesh
1 Replies
2. Shell Programming and Scripting
Hi all,
I have a log file which has logs. I am reading logs line by line into perl arrays. I want to print all the arrays elements starting from 8(word) to end of the line.
print array......array to a new file. and I have to do it in perl as res of the program in perl.
Please help me on... (9 Replies)
Discussion started by: firestar
9 Replies
3. Shell Programming and Scripting
Hi,
I have 2 arrays:
@a=qw(19190289 18381856 12780546 10626296 9337410 8850557 7740161 8101063);
@b=qw(18309897 17612870 10626296 16871843 7740161 19947571 18062861);
$len=@a;
print "<br> length of array1: $len<br>";
$len1=@b;
print "<br> length of array2: $len1<br>";
The output... (3 Replies)
Discussion started by: vanitham
3 Replies
4. Shell Programming and Scripting
Hi,
I am not that good at Perl.
But here's what I wanna do.
I want to create a hash where the keys would point to different arrays. This is what I have tried to do but in vain :(
@arr=(1,2,3);
@arr1=(3,2,1);
%hashOfLists=();
$hashOfLists{Key1}=@arr."\n";
$hashOfLists{Key2}=@arr1."\n";... (3 Replies)
Discussion started by: King Nothing
3 Replies
5. Shell Programming and Scripting
Hi all,
I am trying to compare two arrays in perl using the following code.
foreach $item (@arrayA){
push(@arrayC, $item) unless grep(/$item/, @arrayB); ... (1 Reply)
Discussion started by: chriss_58
1 Replies
6. Shell Programming and Scripting
Hi
I need some help using arrays in perl.
I have an array say var and a variable var1.
I want to check if the var1 is present in the array. How do I check that ?
my @var = 1...10;
my $var1 =5;
if ( $var1 in @var )
{
.......
}
else
{
.......
}
Something like above. Can some... (2 Replies)
Discussion started by: ammu
2 Replies
7. Shell Programming and Scripting
Hi,
I am trying to assign an array as a value to one of the array element, I mean
I have an array @KS and array @kr.
I want array @KS to hold @kr as an element.
So I am doin this
$KS=@kr;
But the value stored is number of elements in the @kr array.
Can... (2 Replies)
Discussion started by: eamani_sun
2 Replies
8. Shell Programming and Scripting
@xray =~ s/^ *//g;
@xray =~ s/ *$//g;
@xray =~ s/\s+/ /g;
Guess I have a two part question ...
First
Is there a way to make substitutions, remove leading spaces, trailing spaces, and crunch multiple spaces into a single space, to the entire array, or must the substitutions be done on on... (1 Reply)
Discussion started by: popeye
1 Replies
9. Programming
hello ppl,
i'm coding a perl script and i have the following situation:
@array1 = ("test1", "test2", "test3");
@array2 = ("something1", "something2", "something1");
$var1 = "with_one_of_the_array1_values";
$var2 = "with_one_of_the_array2_values";
what i want to do is to compare $var1... (2 Replies)
Discussion started by: crashnburn
2 Replies
10. Shell Programming and Scripting
Hi,
I have a program that searches for a particular string patten. I am however having difficulty passing the varible $i (in a loop) as the string pattern to replace. Using either perl or sed search and replace statements, I get the same kinda result. For example, using the perl:
for i in... (3 Replies)
Discussion started by: Breen
3 Replies