hegaa has asked for the wisdom of the Perl Monks concerning the following question:
hi I want to transfer this code from VBS to Perl can someone help me?
Set objFS = CreateObject("Scripting.FileSystemObject") Set objRE = New RegExp objRE.Pattern = "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,4}" objRE.Global = True objRE.IgnoreCase = False objRE.MultiLine = True strFile = "file.txt" strFileContents = objFS.OpenTextFile(strFile).ReadAll Set colMatches = objRE.Execute(strFileContents) Dim Stuff, myFSO, WriteStuff, dateStamp dateStamp = Date() Set myFSO = CreateObject("Scripting.FileSystemObject") Set WriteStuff = myFSO.OpenTextFile("output.txt", 8, True) For Each objMatch In colMatches WriteStuff.WriteLine(objMatch.Value) Next
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: transfer form vbs to perl
by haukex (Archbishop) on Mar 02, 2017 at 16:46 UTC | |
|
Re: transfer form vbs to perl
by Discipulus (Canon) on Mar 03, 2017 at 08:52 UTC | |
by afoken (Chancellor) on Mar 03, 2017 at 10:23 UTC | |
|
Re: transfer form vbs to perl
by sierpinski (Chaplain) on Mar 02, 2017 at 16:32 UTC | |
|
Re: transfer form vbs to perl
by Anonymous Monk on Mar 02, 2017 at 20:05 UTC |