Hi!
I've used sed to extract a specific part from a line from a logfile. However, I would like to use perl to do the same instead, so I would appreciate some feedback.
I'm using perl on a Windows 2k3 server for this purpose right now. But it will later on also be used on a Linux-server as well.
The file is a simple text-file containing anything from 5 - 50 lines of text. A new logfile is created on a daily basis.
There's only one line somewhere in that logfile, which contain the text: .... svn: ##### ...where ##### is a unique number. So it can look like svn: 79352 or svn: 26482 etc. And it's somewhere in the middle of some of the lines, but never at the same place.
I want to extract the 5 digits to a string variable.
The code should be as short as possible.
Thanks in advance
I've used sed to extract a specific part from a line from a logfile. However, I would like to use perl to do the same instead, so I would appreciate some feedback.
I'm using perl on a Windows 2k3 server for this purpose right now. But it will later on also be used on a Linux-server as well.
The file is a simple text-file containing anything from 5 - 50 lines of text. A new logfile is created on a daily basis.
There's only one line somewhere in that logfile, which contain the text: .... svn: ##### ...where ##### is a unique number. So it can look like svn: 79352 or svn: 26482 etc. And it's somewhere in the middle of some of the lines, but never at the same place.
I want to extract the 5 digits to a string variable.
The code should be as short as possible.
Thanks in advance