in reply to Parseing FTP Logs
A better way would be to use a regular expression instead of split. By grouping the fields you want, you won't need throwaway variables like $pid and $client.
If your use of braces (above) indicates your required fields, just change them to parentheses in the regex and you'll retrieve what you want. I note you seem to be nesting individual date-time components within a larger grouping: this works too and you'd capture that with an additional variable at the front of the current list: my ($full_date_time, dow, $month, $dom, ....
You say there is a variety of line formats but only show three: is that the extent of the variation?
Have a go at the regex. If you encounter further difficulties, post what you've tried and we can look at it further.
There's a fair amount of documentation on regular expressions at perldoc.perl.org - check under the Tutorials and Reference Manual sections.
-- Ken
|
|---|