joseph wrote:
> Hi list,
Hello,
> I'd like to ask explaination/help regarding this:
>
> 1)perl -e '%hash; for (`arp`) {($addr,$mac) = (split(/\s+/))[0,2];
> $hash{$addr}= $mac } foreach (keys %hash) { print "\t $_ => $hash{$_}\n";}'
Could be written more simply as:
arp | perl -lane'print "\t
""Jeff Peng"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
>> my($addr,$mac) = (split(/s+/))[0,2];
>
> You maybe would check your scripts carefully at first.
> Here should be:
> my($addr,$mac) = (split(/\s+/))[0,2];
>
> You have lost the '\' before 's+' in your regex.
>
my($addr,$mac) = (split(/s+/))[0,2];
You maybe would check your scripts carefully at first.
Here should be:
my($addr,$mac) = (split(/\s+/))[0,2];
You have lost the '\' before 's+' in your regex.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL P