Showalter [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 12:13 PM
To: 'Tucker, Ernie'; [EMAIL PROTECTED]
Subject: RE: parsing a variable
> -Original Message-
> From: Tucker, Ernie [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 10:39 AM
> To:
> -Original Message-
> From: Tucker, Ernie [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 14, 2002 10:39 AM
> To: [EMAIL PROTECTED]
> Subject: parsing a variable
>
>
> I have a global variable name @offline. It has the following
> information
> stored i
PROTECTED]
Subject: RE: parsing a variable
Would something like this work? I tried it but it returned all 1. Any ideas
Ernest P. Tucker II
Network Technician
"The organization that can't communicate can't change, and the corporation
that can't change is dead."
--N
--
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 11:34 AM
To: [EMAIL PROTECTED]
Subject: RE: parsing a variable
Robert Hanson wrote at Fri, 14 Jun 2002 17:49:03 +0200:
> How about this?
>
> # untested
> my @mac = map {/((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9
Robert Hanson wrote at Fri, 14 Jun 2002 17:49:03 +0200:
> How about this?
>
> # untested
> my @mac = map {/((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ and $1} ( @offline );
>
> Rob
>
or perhaps a little bit more readable:
my $hexdigit = qr/[a-fA-F0-9]/;
my $hexword = qr/$hexdigit{4}/;
my $mac
e'; [EMAIL PROTECTED]
Subject: RE: parsing a variable
Here is one solution...
For each item in @offline the MAC will be captured in the variable $1.
# untested...
for ( @offline ) {
if ( /((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ ) {
print "MAC: $1\n";
}
el
e\n";
}
}
Rob
-Original Message-
From: Tucker, Ernie [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 10:39 AM
To: [EMAIL PROTECTED]
Subject: parsing a variable
I have a global variable name @offline. It has the following information
stored in the variable. What I need to do
al Message-
From: Tucker, Ernie [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 10:39 AM
To: [EMAIL PROTECTED]
Subject: parsing a variable
I have a global variable name @offline. It has the following information
stored in the variable. What I need to do is parse or split the variable and
s
I have a global variable name @offline. It has the following information
stored in the variable. What I need to do is parse or split the variable and
store the mac id in a variable . What is the proper way to do this?
Cable3/0/U0 0020.4098.43fc 944 onlineJun 13 14:09:56 0.00 32.56 5
Cab