Re: how to release memory from a hash table or array

2008-12-09 Thread Rob Dixon
org chen wrote: > > Thanks for the confirmation and suggestion. > > I had tried Database, it do not work well for me, since the database need > more data structure to maintain the data, it take longer time or more memory > to add or remove data and matain the index table. In some case the pure

Re: Split not acting the way I want it to

2008-12-09 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > Rob Dixon wrote: >> Mr. Shawn H. Corey wrote: >>> >>> print '', (split( /\./, $ipAddress ))[-1]; >> >> Ugly, ugly, ugly. > > OK, try: > > print substr($ipAddress,rindex($ipAddress,'.')+1); Are you really saying that you could make it even worse if you wanted to? Rob

RE: how to release memory from a hash table or array

2008-12-09 Thread org chen
Hi, Thanks for the confirmation and suggestion. I had tried Database, it do not work well for me, since the database need more data structure to maintain the data, it take longer time or more memory to add or remove data and matain the index table. In some case the pure TEXT file or array i

Re: Split not acting the way I want it to

2008-12-09 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Wed, 2008-12-10 at 03:04 +, Rob Dixon wrote: Mr. Shawn H. Corey wrote: print '', (split( /\./, $ipAddress ))[-1]; Ugly, ugly, ugly. OK, try: print substr($ipAddress,rindex($ipAddress,'.')+1); $ perl -le' use Socket; my $ipAddress = "23.34.45.56"; print unp

Re: Split not acting the way I want it to

2008-12-09 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Wed, 2008-12-10 at 03:04 +, Rob Dixon wrote: Mr. Shawn H. Corey wrote: print '', (split( /\./, $ipAddress ))[-1]; Ugly, ugly, ugly. OK, try: print substr($ipAddress,rindex($ipAddress,'.')+1); $ perl -le' my $ipAddress = "23.34.45.56"; print $ipAddress =~ /

Re: Split not acting the way I want it to

2008-12-09 Thread Mr. Shawn H. Corey
On Tue, 2008-12-09 at 22:20 -0500, Mr. Shawn H. Corey wrote: > On Wed, 2008-12-10 at 03:04 +, Rob Dixon wrote: > > Mr. Shawn H. Corey wrote: > > > > > > print '', (split( /\./, $ipAddress ))[-1]; > > > > Ugly, ugly, ugly. > > > OK, try: > > print substr($ipAddress,rindex($ipAddress,'.')+1);

Re: Split not acting the way I want it to

2008-12-09 Thread Mr. Shawn H. Corey
On Wed, 2008-12-10 at 03:04 +, Rob Dixon wrote: > Mr. Shawn H. Corey wrote: > > > > print '', (split( /\./, $ipAddress ))[-1]; > > Ugly, ugly, ugly. > OK, try: print substr($ipAddress,rindex($ipAddress,'.')+1); -- Just my 0.0002 million dollars worth, Shawn The key to success is be

Re: Split not acting the way I want it to

2008-12-09 Thread Rob Dixon
Mr. Shawn H. Corey wrote: > > print '', (split( /\./, $ipAddress ))[-1]; Ugly, ugly, ugly. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to release memory from a hash table or array

2008-12-09 Thread Rob Dixon
org chen wrote: > > I read a large file into a hash table. This hash table is used only once in > the subroutine. I am very concern the memory usage, So I plan to realse the > memory after used the hash table. The way I used is: > > my %hash = (); > > #read the large file into the hash table

Re: how to release memory from a hash table or array

2008-12-09 Thread Mr. Shawn H. Corey
On Wed, 2008-12-10 at 13:15 +1030, org chen wrote: > I read a large file into a hash table. This hash table is used only > once in the subroutine. I am very concern the memory usage, So I plan > to realse the memory after used the hash table. The way I used is: > > my %hash = (); > > #read the

how to release memory from a hash table or array

2008-12-09 Thread org chen
Dear perl users, I read a large file into a hash table. This hash table is used only once in the subroutine. I am very concern the memory usage, So I plan to realse the memory after used the hash table. The way I used is: my %hash = (); #read the large file into the hash table ... #relea

Re: Split not acting the way I want it to

2008-12-09 Thread John W. Krahn
David Shere wrote: Hello. Hello, I'm not a new perl programmer, but I feel like one today. I want to pull the last octet off of an IP address and print it to standard output. I have this so far: @octets = split(/\./, $ipAddress); print pop(@octets); Which works great. I have no oth

Re: Split not acting the way I want it to

2008-12-09 Thread Chas. Owens
On Tue, Dec 9, 2008 at 16:04, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Tue, 2008-12-09 at 15:55 -0500, David Shere wrote: >> On Tue, 2008-12-09 at 15:51 -0500, Mr. Shawn H. Corey wrote: >> > print '', (split( /\./, $ipAddress ))[-1]; >> >> Thanks. I was searching for about an hour before

Re: Split not acting the way I want it to

2008-12-09 Thread Mr. Shawn H. Corey
On Tue, 2008-12-09 at 15:55 -0500, David Shere wrote: > On Tue, 2008-12-09 at 15:51 -0500, Mr. Shawn H. Corey wrote: > > print '', (split( /\./, $ipAddress ))[-1]; > > Thanks. I was searching for about an hour before I posted here; I found > an answer online a few minutes later: > > http://www.p

Re: Split not acting the way I want it to

2008-12-09 Thread David Shere
On Tue, 2008-12-09 at 15:51 -0500, Mr. Shawn H. Corey wrote: > print '', (split( /\./, $ipAddress ))[-1]; Thanks. I was searching for about an hour before I posted here; I found an answer online a few minutes later: http://www.perlmonks.org/?node_id=299283 Curious: What's the '', for? Scalar

Re: Split not acting the way I want it to

2008-12-09 Thread Mr. Shawn H. Corey
On Tue, 2008-12-09 at 15:35 -0500, David Shere wrote: > Hello. I'm not a new perl programmer, but I feel like one today. I > want to pull the last octet off of an IP address and print it to > standard output. I have this so far: > >@octets = split(/\./, $ipAddress); >print pop(@octets);

Split not acting the way I want it to

2008-12-09 Thread David Shere
Hello. I'm not a new perl programmer, but I feel like one today. I want to pull the last octet off of an IP address and print it to standard output. I have this so far: @octets = split(/\./, $ipAddress); print pop(@octets); Which works great. I have no other use for @octets, so I should

Re: Help with String/Array manipulation

2008-12-09 Thread John W. Krahn
sanju.shah wrote: I am looking for some suggestions on any advanced functions Perl might have that i might be missing. Basically, I have an array with column widths. Next I have a string. I would like to extract the number of characters based on the column- widths in the array. I have already tr

Re: piece of Perl code needed for tracking clicks

2008-12-09 Thread Terry Grant
Mark Tarver wrote: Hi, I have a very simple request. I want to know how many people click on a link. So what I want is a piece of Perl that writes this to a file. It can just be a tally mark like ! placed in the file. I cannot place anything on the target page because it does not belong to m

Re: lawyer --- new to coding

2008-12-09 Thread late_rabbit
that is a great idea for a beginner to try - thank you Deviloper wrote: > Hey, If you are "looking" for a not so hard but very interessting project, > then write a tool that lookup the internet (via regex and google see > cpan.org) for the latest news/lawsuites of your profession in law. You coul

Re: lawyer --- new to coding

2008-12-09 Thread late_rabbit
thx Jeff Jeff Pang wrote: > > Message du 08/12/08 16:12 > > De : "late_rabbit" > > A : beginners@perl.org > > Copie à : > > Objet : lawyer --- new to coding > > > > > > > I'm hoping for interesting beginner projects that may also have > > application to my work as a lawyer. > > > > > Welcome to Pe

piece of Perl code needed for tracking clicks

2008-12-09 Thread Mark Tarver
Hi, I have a very simple request. I want to know how many people click on a link. So what I want is a piece of Perl that writes this to a file. It can just be a tally mark like ! placed in the file. I cannot place anything on the target page because it does not belong to me. Code gratefully r

Re: Help with String/Array manipulation

2008-12-09 Thread Rob Dixon
sanju.shah wrote: > > I am looking for some suggestions on any advanced functions Perl might > have that i might be missing. > > Basically, I have an array with column widths. Next I have a string. I > would like to extract the number of characters based on the column- > widths in the array. I hav

Re: Help with String/Array manipulation

2008-12-09 Thread Chas. Owens
On Mon, Dec 8, 2008 at 13:54, sanju.shah <[EMAIL PROTECTED]> wrote: > I am looking for some suggestions on any advanced functions Perl might > have that i might be missing. > > Basically, I have an array with column widths. Next I have a string. I > would like to extract the number of characters ba

Help with String/Array manipulation

2008-12-09 Thread sanju.shah
I am looking for some suggestions on any advanced functions Perl might have that i might be missing. Basically, I have an array with column widths. Next I have a string. I would like to extract the number of characters based on the column- widths in the array. I have already tried using substr but

Re: XS

2008-12-09 Thread Patrick Dupre
Thank, But I nned help. I will work more to make a short example, but it seems clear that something has changed between version 5.8.8 and version 5.10.0 I built up a cpp+ class which includes an array. When I try to access to this array with a method, I get a segmentation fault. Is it because p

Re: XS

2008-12-09 Thread Dermot
2008/12/9 Patrick Dupre <[EMAIL PROTECTED]>: > Hello, > > Since I upgrade my PC from perl 5.8.8 to 5.10.0, my application fails. > I do not understand what is going on, memory leak ? > Segmentation fault. > I noticed warning which did not happen before: > > Please specify prototyping behavior for F