Hi :) I'm a unix beginner and i've recently got an assignment to write up a script to print the most common IP address that made requests from a webserver.
I'm really lost in this one...and if someone could pls tell me where to start i'll be really greatful !
thanx (1 Reply)
I'm writing a KSH script that will get a file on the command line (such as input.txt), and in this file there is on number per line. The program needs to take the file, read each and determine the lowest number in the file. I currently have a while loop setup that will correctly out put every... (8 Replies)
Hi Gurus,
I've using HPUX B.11.23 U ia64 with shell = sh.
I've been having some problem get the highest number of this script.
Actually I wanted to get the highest number from this listing (TEST123 data and based on this highest number, there will be email being sent out.
For example,... (6 Replies)
Hello all,
How can I find the lowest number every 10 lines? For example i have a list
name1
-0.1
name2
2
name3
3
name4
-3
name5
1
name6
2
name7
34
name8
34 (6 Replies)
i am having a problem finding the lowest number after punching in a bunch of numbers in the .txt file but its probably the way i have the code set up.
help please! (4 Replies)
Hi,
I have a file with the following columns:
361459 447394 CHL1
290282 290282 CHL1
361459 447394 CHL1
361459 447394 CHL1
178352861 178363529 AGA
178352861 178363529 AGA
178363657 178363657 AGA
Essentially, using CHL1 as an example. For any line that has CHL1 in... (2 Replies)
Hi, I want to extract the the top 10 and lowest 10 percentile for a column of values.
For example in column 2 for this file:
JOE 1
JAY 5
JAM 6
JIL 8
JIB 4
JIH 3
JIG 2
JIT 7
JAM 9
MAR 10
The top 10 lowest will be:
JOE 1
and the top 10 highest will be: (2 Replies)
Hi there. I have a number allocation problem whereby I have 2 arrays built from 2 different sources. The arrays will just contain a listed of sorted numbers
@a
1
7
10
14
15
16
@b
1
7
10
11
14
15
16 (2 Replies)
Hi again!
I am still impressed how fast I get a solution for my topic "average specific column value awk" yesterday.
The associative arrays in awk work fine for me!
But now I have another question for the same project.
Now I have a list like this
1 -0.1
1 0
1 0.1
2 0
2 0.2
2 -0.2
How... (10 Replies)
Discussion started by: bjoern456
10 Replies
LEARN ABOUT DEBIAN
test::unit::assertion::coderef
Test::Unit::Assertion::CodeRef(3pm) User Contributed Perl Documentation Test::Unit::Assertion::CodeRef(3pm)NAME
Test::Unit::Assertion::CodeRef - A delayed evaluation assertion using a Coderef
SYNOPSIS
require Test::Unit::Assertion::CodeRef;
my $assert_eq =
Test::Unit::Assertion::CodeRef->new(sub {
$_[0] eq $_[1]
or Test::Unit::Failure->throw(-text =>
"Expected '$_[0]', got '$_[1]'
");
});
$assert_eq->do_assertion('foo', 'bar');
Although this is how you'd use Test::Unit::Assertion::CodeRef directly, it is more usually used indirectly via Test::Unit::Test::assert,
which instantiates a Test::Unit::Assertion::CodeRef when passed a Coderef as its first argument.
IMPLEMENTS
Test::Unit::Assertion::CodeRef implements the Test::Unit::Assertion interface, which means it can be plugged into the Test::Unit::TestCase
and friends' "assert" method with no ill effects.
DESCRIPTION
This class is used by the framework to allow us to do assertions in a 'functional' manner. It is typically used generated automagically in
code like:
$self->assert(sub {
$_[0] == $_[1]
or $self->fail("Expected $_[0], got $_[1]");
}, 1, 2);
(Note that if Damian Conway's Perl6 RFC for currying ever comes to pass then we'll be able to do this as:
$self->assert(^1 == ^2 || $self->fail("Expected ^1, got ^2"), 1, 2)
which will be nice...)
If you have a working B::Deparse installed with your perl installation then, if an assertion fails, you'll see a listing of the decompiled
coderef (which will be sadly devoid of comments, but should still be useful)
AUTHOR
Copyright (c) 2001 Piers Cawley <pdcawley@iterative-software.com>.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
o Test::Unit::TestCase
o Test::Unit::Assertion
perl v5.8.8 2006-09-13 Test::Unit::Assertion::CodeRef(3pm)