Marvin,
Remember that you split on a regular expression, not a single character. As
such, you can split on the regex ' +', which stands for 'one or more
consecutive spaces', as opposed to ' ', which stands for 'one space'.
Here (I had to shorten your log entries to make my newsreader happy) is
what I did:
---begin sample code
#!/usr/bin/perl -w
$var1 = 'Jul 24 11:37:59.878 [13001] (v3.1.2) POP login by user "conhosvp"';
$var2 = 'Jul 4 11:37:59.932 [13002] (v3.1.2) POP login by user "icade"';
foreach $var ($var1, $var2) {
$time = (split(/ +/, $var))[2]; # Note that we split on ' +'!
print "Time was $time\n";
}
---end sample code
That work for ya?
John
--
John Fox <[EMAIL PROTECTED]>
System Administrator, InfoStructure, Ashland OR USA
---------------------------------------------------------
"What is loved endures. And Babylon 5 ... Babylon 5 endures."
--Delenn, "Rising Stars", Babylon 5
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]