[ale] [OT] Perl Question

Geoffrey esoteric at 3times25.net
Thu Jul 3 15:53:56 EDT 2003


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





More information about the Ale mailing list