Deleting last 12 lines of a large file

2003-01-26 Thread Sukrit
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Listers, How do i delete the last 12 (or so) lines of a large file (400+ lines) without loading the whole into memory. regards sukrit -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.8

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Rob Dixon
Sukrit wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi Listers, > How do i delete the last 12 (or so) lines of a large file (400+ lines) > without loading the whole into memory. 400 lines isn't too huge. I would say just read the file once to count the lines. Then re-read it, print

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Rob Dixon
Rob Dixon wrote: > 400 lines isn't too huge. I would say just read the file once to count > the > lines. Then re-read it, printing twenty less lines than you counted. > It's > dirty but it's quick :) Sorry, I don't know where I got 20 from! That should be $lines -= 12, of course. Rob -- To u

Re: Pairs have minimum difference

2003-01-26 Thread Nengbing Tao
Thanks! Not quite yet! Each number can appear once in each column in the end output! This would work for cases where those pair do not overlap. The problem comes in cases like @xa=(900,1000,1010,2040,2010,8000,); @xb=(899,1005,1022,2020,2000,6000,,2); I guess I have to track the vari

Rebuilding Devel Dir from Public Repository

2003-01-26 Thread John Baker
Greetings. Apologies in advance if this is the wrong list. Recently, my private development directory, containing my entire module repository, was accidentally deleted. Luckily, the public repository remained intact. Question is: How do I go about rebuilding my private repository from the publi

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Rob Dixon) writes: >Sukrit wrote: >> How do i delete the last 12 (or so) lines of a large file (400+ lines) >> without loading the whole into memory. > >400 lines isn't too huge. I would say just read the file once to count >the >lines. Then re-re

Re: used sendmail to send an attachment

2003-01-26 Thread Nilesh
I have download Sendmail module and installed. I also copied Sendmail.pm in my lib path as follows: /opt/MIMperl5/lib/5.00503/sun4-solaris/ops.pm /opt/MIMperl5/lib/5.00503/sun4-solaris/re.pm /opt/MIMperl5/lib/5.00503/sun4-solaris/Sendmail.pm /opt/MIMperl5/lib/5.00503/vars.pm /opt/MIMperl5/lib/5.005

Hide password on sign on

2003-01-26 Thread cuzican70
I do not want everyone hat clicks o m screen name to have access to my web page on email such as the cildren and my husband. how do i make it to where they have to know my password to get to my personal info.

Re: used sendmail to send an attachment

2003-01-26 Thread John Baker
>From the limited exposure I have to your lib path, it appears as if Mail/Sendmail.pm doesn't exist. "use Mail::Sendmail;" is looking for /some/path/to/Mail/Sendmail.pm ...but I don't see the Mail dir within /opt/MIMperl5/lib/5.00503/ Here's how mine looks: /usr/local/lib/perl5/site

Re: used sendmail to send an attachment

2003-01-26 Thread Johnathan Kupferer
Sendmail.pm should be at: /opt/MIMperl5/lib/5.00503/sun4-solaris/Mail/Sendmail.pm The Mail:: prefix translates into a directory, hence the message: Can't locate Mail/Sendmail.pm in @INC - Johnathan Nilesh wrote: I have download Sendmail module and installed. I also copied Sendmail.pm in my

Re: Hide password on sign on

2003-01-26 Thread Wiggins d'Anconia
[EMAIL PROTECTED] wrote: I do not want everyone hat clicks o m screen name to have access to my web page on email such as the cildren and my husband. how do i make it to where they have to know my password to get to my personal info. This has what to do with Perl? Whatever OS, web browser, or

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Rob Dixon
Peter Scott wrote: > Anyway, here's a way that doesn't require keeping more than 12 lines > in memory and doesn't require reading twice: > > $^I = ".bak"; > my @queue; > while (<>) { > push @queue, $_; > print shift @queue if @queue > 12; > } Neat. I like that :) What's the $^I variable? Is i

Re: used sendmail to send an attachment

2003-01-26 Thread R. Joseph Newton
Nilesh wrote: > ... > I also copied Sendmail.pm in my lib path ... This might be the problem right here, or it might be benignly useless. We use installers to do the work of installing files to the appropriate paths for a reason. The creators of a mofule know best how the elements interact wi

how do I get a character at position index out of a string like c++ char * string[index] ?

2003-01-26 Thread Fleur Junier
how do I get a character at position index out of a string like c++ char * string[index] ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Deleting last 12 lines of a large file

2003-01-26 Thread R. Joseph Newton
Peter Scott wrote: > I$^I = ".bak"; > my @queue; Hmmm. push (@queue, $somevar); somevar = pop(@queue); ...and double-H! Could it be that that animal Perlites refer to as an array is really a linked list? Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (R. Joseph Newton) writes: >Peter Scott wrote: > >> I$^I = ".bak"; >> my @queue; > >Hmmm. > >push (@queue, $somevar); >somevar = pop(@queue); > >...and double-H! > >Could it be that that animal Perlites refer to as an array is really a linked l

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Rob Dixon) writes: >Peter Scott wrote: >> Anyway, here's a way that doesn't require keeping more than 12 lines >> in memory and doesn't require reading twice: >> >> $^I = ".bak"; >> my @queue; >> while (<>) { >> push @queue, $_; >> print shift

Re: how do I get a character at position index out of a string like c++ char * string[index] ?

2003-01-26 Thread Wiggins d'Anconia
Fleur Junier wrote: how do I get a character at position index out of a string like c++ char * string[index] ? perldoc -f index Is this what you mean? http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Sukrit
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> Sukrit wrote: >> Hi Listers, How do i delete the last 12 (or so) lines of a >> large file (400+ lines) without loading the whole into memory. Rob> 400 lines isn't too huge. I w

Re: Pairs have minimum difference

2003-01-26 Thread R. Joseph Newton
Nengbing Tao wrote: > Thanks! > > Not quite yet! > Each number can appear once in each column in the end output! This would > work for cases where those pair do not overlap. The problem comes in cases > like > @xa=(900,1000,1010,2040,2010,8000,); > @xb=(899,1005,1022,2020,2000,6000,,2)

Re: Deleting last 12 lines of a large file

2003-01-26 Thread John Baker
s. Your friends told you to use FreeBSD for a reason, and this is it. =))) Anyway more info regarding the attack can be found at http://news.yahoo.com/news?tmpl=story2&cid=569&ncid=738&e=4&u= /nm/20030126/tc_nm/tech_microsoft_virus_dc Notice one of the things MS says: "The unfortu

this should be simpel and short to answer right?

2003-01-26 Thread Fleur Junier
how do I get a character at position index out of a string like c++ char * string[index] ? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: this should be simpel and short to answer right?

2003-01-26 Thread John Baker
it is, yes. substr(): http://www.perldoc.com/perl5.6/pod/func/substr.html "perldoc -h" is your friend. =)) jab On Sun, 26 Jan 2003, Fleur Junier wrote: > Date: Sun, 26 Jan 2003 20:06:50 +0100 > From: Fleur Junier <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: this should be simpel a

Re: Deleting last 12 lines of a large file

2003-01-26 Thread R. Joseph Newton
Sukrit wrote: > While waiting for your reply, my goals changed a bit. i got some sort > of worm (redlof if you must know) on my windows machine (with some > 11000 files affected). It tags to the end of every html file, so i > didn't want chomping of last 12 lines of files that hadn't got it :) > B

Re: how do I get a character at position index out of a string like c++ char * string[index] ?

2003-01-26 Thread R. Joseph Newton
Fleur Junier wrote: > how do I get a character at position index out of a string like c++ char > * string[index] ? my $SourceString = "Hello, World!"; my @CharArray = split //, $SourceString; foreach (@CharArray) { print "$_\n"; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Rob Dixon
Peter Scott wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Rob Dixon) writes: >> What's the $^I variable? Is it a 5.8 addition? > > No, it's a 4.0 addition (or earlier). It's how to turn on the -i > command-line switch within code. See -i in the perlrun page. Ah, my font let me d

Re: Deleting last 12 lines of a large file

2003-01-26 Thread Rob Dixon
Peter Scott wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (R. Joseph Newton) writes: >> Peter Scott wrote: >> >>> I$^I = ".bak"; >>> my @queue; >> >> Hmmm. >> >> push (@queue, $somevar); >> somevar = pop(@queue); >> >> ...and double-H! >> >> Could it be that that animal Perlites

Re: how do I get a character at position index out of a string like c++ char * string[index] ?

2003-01-26 Thread Rob Dixon
Fleur Junier wrote: > how do I get a character at position index out of a string like c++ > char > * string[index] ? The nearest equivalent is substr: my $string = 'Mozzarella'; my $i = 6; my $char = substr $string, $i, 1;# $char eq 'e' which is subtly different from C's string[i

Re: this should be simpel and short to answer right?

2003-01-26 Thread Rob Dixon
John Baker wrote: > it is, yes. substr(): > >http://www.perldoc.com/perl5.6/pod/func/substr.html > > "perldoc -h" is your friend. =)) You should get out more John :-D /R -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: this should be simpel and short to answer right?

2003-01-26 Thread Wiggins d'Anconia
Rob Dixon wrote: John Baker wrote: it is, yes. substr(): http://www.perldoc.com/perl5.6/pod/func/substr.html "perldoc -h" is your friend. =)) You should get out more John :-D What or where is this "out" you speak of? ;-)... http://danconia.org -- To unsubscribe, e-mail: [EMAIL PR

Re: Hash of Hashes of Arrays?

2003-01-26 Thread Jenda Krynicky
From: Pete Emerson <[EMAIL PROTECTED]> > push @{$hash{$city}{$station}}, $add1; > push @{$hash{$city}{$station}}, $add2; > push @{$hash{$city}{$station}}, $state; > push @{$hash{$city}{$station}}, $zip; > push @{$hash{$city}{$station}}, $phone; You can push several items into an array at once: pu