[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] [OT] Perl Question
- Subject: [ale] [OT] Perl Question
- From: esoteric at 3times25.net (Geoffrey)
- Date: Thu, 03 Jul 2003 15:53:56 -0400
Geoffrey wrote:
>
>
> Jonathan Glass wrote:
>
>> If I have an array
>> $array[0]="2003-07-03 14:30:37 128.61.131.173 00:e0:29:84:a6:7e
>> BaoTweezers"
>> $array[1]="2003-07-03 14:30:37 128.61.131.94 00:e0:29:84:a6:7e
>> BaoTweezers"
>>
>> How can I pull out parts of this string? In other languages I'd use a
>> trim feature. The real trick is , the date and time stamp need to be
>> one variable. Then IP, MAC and Name need to be different variables.
>> Any direction is greatly appreciated.
>
>
> ($date, $time, $ip, $mac, $name) = split /\s/, $array[0];
>
> $date_time = $date . " " . $time;
My apologies for my carlessness, that should be:
use strict;
my ($date, $time, $ip, $mac, $name) = split /\s/, $array[0];
my $date_time = $date . " " . $time;
--
Until later: Geoffrey esoteric at 3times25.net
The latest, most widespread virus? Microsoft end user agreement.
Think about it...
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale