RE: Files manipulation

2007-03-27 Thread José Pedro Silva Pinto
time consuming) José Pedro Silva Pinto -Original Message- From: Rodrigo Tavares [mailto:[EMAIL PROTECTED] Sent: terça-feira, 27 de Março de 2007 15:57 To: beginners@perl.org Subject: Files manipulation Hello, What's the more fast ? 1) perl -pi -e 's/foo/bar/g' file.t

Re: Files manipulation

2007-03-27 Thread Tom Phoenix
On 3/27/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote: What's the more fast ? 1) perl -pi -e 's/foo/bar/g' file.txt 2) open the file and make modifications What happens when you time both programs? It may be that the answer for me with my data on my hardware is different than the answer for

Files manipulation

2007-03-27 Thread Rodrigo Tavares
Hello, What's the more fast ? 1) perl -pi -e 's/foo/bar/g' file.txt 2) open the file and make modifications In C/C++ manipulation of files are operations very weighed. Slow perfomace. Best regards, Rodrigo Faria Tavares __ Fale com seus ami

Re: Hex files manipulation problem

2003-07-13 Thread Rob Dixon
Rafaqat Ali Chaudhary wrote: > Got another problem: > > Following line of code fails if directory contains more than 1400 > or so files: > > 1. my @filelist = glob("input/switch1*.evt"); > > Any help will be highly appreciated. > The following code will do the same thing. use strict; use warn

Re: Hex files manipulation problem

2003-07-12 Thread John W. Krahn
Rafaqat Ali Chaudhary wrote: > > Got another problem: > > Following line of code fails if directory contains more than 1400 or so > files: > > 1. my @filelist = glob("input/switch1*.evt"); > > Any help will be highly appreciated. On some versions of Perl the glob operator uses the shell (csh A

RE: Hex files manipulation problem

2003-07-12 Thread Rafaqat Ali Chaudhary
PROTECTED] Sent: Sunday, July 13, 2003 03:57 To: 'John W. Krahn'; [EMAIL PROTECTED] Subject: RE: Hex files manipulation problem That's Great. Using binmode has solved my problem. Yes the data files were created at a big-endian SPARC machine and were FTPed to a little-endian Int

RE: Hex files manipulation problem

2003-07-12 Thread Rafaqat Ali Chaudhary
ECTED] Sent: Sunday, July 13, 2003 03:41 To: [EMAIL PROTECTED] Subject: Re: Hex files manipulation problem Rafaqat Ali Chaudhary wrote: > > Following is the code: > > 1.open(FILE, "< $l_file") || > 2.die "Unable to open data file ($l_file)";

Re: Hex files manipulation problem

2003-07-12 Thread John W. Krahn
Rafaqat Ali Chaudhary wrote: > > Following is the code: > > 1.open(FILE, "< $l_file") || > 2.die "Unable to open data file ($l_file)"; You should include the $! variable in your error message so you know why the error occurred. To make this code portable across different platform

RE: Hex files manipulation problem

2003-07-12 Thread Rafaqat Ali Chaudhary
at Linux 7 and Windows 2000 Advance Server. Rafaqat Ali Chaudhary -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Sunday, July 13, 2003 03:32 To: [EMAIL PROTECTED] Subject: Re: Hex files manipulation problem Rafaqat Ali Chaudhary wrote: > Hi every body, > > I&

Re: Hex files manipulation problem

2003-07-12 Thread Rob Dixon
Rafaqat Ali Chaudhary wrote: > Hi every body, > > I've got here a script which extracts event logs from Hexadecimal > files by parsing them for a certain pattern set. The script runs > fine on Solaris 8 (running on a SUN box) but fails on Linux or a > Windows box. Hi. Look at all that John mentio

Re: Hex files manipulation problem

2003-07-12 Thread John W. Krahn
Rafaqat Ali Chaudhary wrote: > > Hi every body, Hello, > I've got here a script which extracts event logs from Hexadecimal files > by parsing them for a certain pattern set. The script runs fine on > Solaris 8 (running on a SUN box) but fails How does it fail? What does it do when it fails? A

Hex files manipulation problem

2003-07-12 Thread Rafaqat Ali Chaudhary
Hi every body, I've got here a script which extracts event logs from Hexadecimal files by parsing them for a certain pattern set. The script runs fine on Solaris 8 (running on a SUN box) but fails on Linux or a Windows box. Somebody please guide me in this regard. Thanks in advance. Rafaqat Ali