On Wed, Apr 23, 2008 at 8:56 AM, <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I need to delete some lines in file using Perl. The requirement is that
> I have one file which contains following lines.
>
> Element * checkdout
> Element * latest.
snip
You should read
http://perldoc.perl.org/perlfaq5
On Wed, Apr 23, 2008 at 8:56 PM, <[EMAIL PROTECTED]> wrote:
> Hi All,
>
>
>
> I need to delete some lines in file using Perl. The requirement is that
> I have one file which contains following lines.
>
Please submit your question to "[EMAIL PROTECTED]".
--
J. Peng - QQMail Operation Team
eM
Hi All,
I need to delete some lines in file using Perl. The requirement is that
I have one file which contains following lines.
Element * checkdout
Element * latest.
And now I want to delete these lines using Perl script.
Please help.
Regards,
Irfan
On Jul 16, Martijn van Exel said:
>I'm trying to get a line count for a number of files. Is sysread() the
>preferred (fastest, most efficient) way to go (snippet 1) or should I
>read the file into an array and count the array instead (something like
>snippet 2, untested)?
Do NOT read a file
Don't do the "put a file into an array" trick if you're not VERY sure the
file is small.
It's generally concidered bad programming practice and a recipe for disaster
if you dont control the input.
having said that, i'd like to note that there's also a memory penalty for
using an array over a stri
As sysread() doesn't use buffers, it's probably more efficient to use normal
reads. Also, splitting lines by yourself (i.e. in Perl) won't be as efficient
as in C implementation. Thus I recommend to use
open(FILEH, "database/$_") or die "$!";
my @tempfile = ;
close FILEH;
my $lines = scalar @te
;
}
> -Original Message-
> From: Martijn van Exel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 8:55 AM
> To: [EMAIL PROTECTED]
> Subject: # of lines in file
>
>
> Subscribers,
>
> I'm trying to get a line count for a number of files. Is
>
Subscribers,
I'm trying to get a line count for a number of files. Is sysread() the
preferred (fastest, most efficient) way to go (snippet 1) or should I
read the file into an array and count the array instead (something like
snippet 2, untested)?
Thanks for your insights.
$_ contains the f