Can someone please tell me what I'm doing wrong. I'm trying to use three subroutines in one lib file to calculate total, average and extend the array by adding new values from previous values divided by 2
--------------------------------------------------------------
#! /usr/bin/perl
require...
I want to match an IP address in a string and store in a variable thus :-
$string = "192.168.2.1";
while (<STDIN>) {
$_ = /\d{1,3}\.{3}\d{1,3}/;
$ip = $1;
}
is this correct?
I have an array @field = ("A H","2 H","8 S","K S",...,"Q S");
I print the top 5 elements thus -
for $k (0..4) {
print $field[$k];
print "\n";
then for each of the first 5 element, do a pattern match.
If the first element is "K S", match "S" with SAM, for "A H"
match "H" with HENRY ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.