Search Results

Search: Posts Made By: ahmed_zaher
18,263
Posted By bartus11
@array = (1..10); print "number not found\n" if...
@array = (1..10);
print "number not found\n" if ! grep (/11/, @array);
3,305
Posted By radoulov
Could you post an example? I mean, the exact code...
Could you post an example? I mean, the exact code you run.

This is supposed to be a readable version:


use warnings;
use strict;

my @arrys = (
[ qw( 44 44 44 44 ) ],
[ qw( 55 55 55...
3,305
Posted By radoulov
The code is written in Perl, but it uses a...
The code is written in Perl, but it uses a features of version 5.10.

Put this code in a script and try it:

#! /usr/bin/perl

use warnings;
use strict;

my @array1 = qw(44 44 44 44);
my...
3,305
Posted By radoulov
perl -E' @array1 = qw(44 44 44 44); ...
perl -E'
@array1 = qw(44 44 44 44);
@array2 = qw(55 55 55 55 55 55 56);

do {
%_ = ();
@_{@$_} = ();
say "@$_ -> ", keys %_ > 1 ? "KO" : "OK"
} for \@array1,...
12,292
Posted By k_manimuthu
# That can be done by hashes concept @Array1 =...
# That can be done by hashes concept
@Array1 = qw(Fa0/0 Fa0/1 Fa0/2 Fa0/3);
@Array2 = qw(Fa0/1 Fa0/2 Fa0/3 Fa0/4);
# process two array , increment the values and store into hash
$hash{$_}++ for...
1,624
Posted By m.d.ludwig
The "4" is coming from: Change the print to:...
The "4" is coming from:

Change the print to:
print "<($line_output)>";to confirm. You should see:
<snip>
sh run | in distribute<(4)>
distribute-list 55 out FastEthernet0/1<(4)>...
11,466
Posted By pludi
As for the autosplit.ix error: how did you...
As for the autosplit.ix error: how did you install the module, and what Perl distribution do you use? ActiveState?

The timeout probably means that the device didn't answer after a certain period...
11,466
Posted By pludi
The answer is quite simple: single quotes, unlike...
The answer is quite simple: single quotes, unlike double quotes, won't interpolate the content of the variable, but take the string as is. See perldoc perlop...
3,822
Posted By
Serial0[/0]*([[:space:]]|$) will match Serial0 or...
Serial0[/0]*([[:space:]]|$) will match Serial0 or Serial0/0 or Serial0/0/0
3,822
Posted By Aia
Instead of Tunnel.* which will match any length...
Instead of Tunnel.* which will match any length and type of characters afterward, you could use
Tunnel[0-9]

It is all about matching, instead of not matching, therefore you have to make...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 06:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy