Re: how to replace @ inside of { }

2008-03-28 Thread Richard Lee
Gunnar Hjalmarsson wrote: Richard Lee wrote: I finally understood, sub do_it { my $XXXid = shift; print "\$XXXid is $XXXid\n"; for (@_) { if ( exists $_->{ ABC_XXX_m }{ XXX_id } && $_->{ ABC_XXX_m }{ XXX_id } eq "$XXXid" ) { my $sdf = $_; fo

Re: diff says memory exhausted need help with perl

2008-03-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: I've got two similar large files with one word per line and they're sorted. Each file has a few words not in the other. I typically identify the unique words in the file using diff,grep,cut. When the files are too big (2Gig) diff dies with "memory exhausted". I want to s

Re: how to replace @ inside of { }

2008-03-28 Thread Gunnar Hjalmarsson
Richard Lee wrote: I finally understood, sub do_it { my $XXXid = shift; print "\$XXXid is $XXXid\n"; for (@_) { if ( exists $_->{ ABC_XXX_m }{ XXX_id } && $_->{ ABC_XXX_m }{ XXX_id } eq "$XXXid" ) { my $sdf = $_; for (sort keys %{$sdf->{ ABC

Re: diff says memory exhausted need help with perl

2008-03-28 Thread Lawrence Statton
If you're using Gnu diff (i.e. the diff that comes with most Linuces) --speed-large-files might help you, without having to jump through a perl hoop. --L -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to replace @ inside of { }

2008-03-28 Thread Richard Lee
Richard Lee wrote: Gunnar Hjalmarsson wrote: Rob Dixon wrote: Richard Lee wrote: Gunnar Hjalmarsson wrote: C:\home>type test.pl use Data::Dumper; my %HoA = ( something => [ qw/val1 val2 val3 and so forth/ ], something2 => [ qw/vala valb valc and so forth/ ], something3 => [ qw/v

diff says memory exhausted need help with perl

2008-03-28 Thread tc314
I've got two similar large files with one word per line and they're sorted. Each file has a few words not in the other. I typically identify the unique words in the file using diff,grep,cut. When the files are too big (2Gig) diff dies with "memory exhausted". I want to search for the unique words

Re: Handling OLD files

2008-03-28 Thread anders
Thanks everyone for the help mvh Anders -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: how to replace @ inside of { }

2008-03-28 Thread Richard Lee
Gunnar Hjalmarsson wrote: Richard Lee wrote: Just one more question, what is the difference between, ${$score{ "fred" } } and ${$score}{"fred"} are they the samething? No, they are not. The first assumes a hash named %score, e.g. my %score = ( fred => \ 5 ); where the value of the

Re: how to replace @ inside of { }

2008-03-28 Thread Gunnar Hjalmarsson
Richard Lee wrote: Just one more question, what is the difference between, ${$score{ "fred" } } and ${$score}{"fred"} are they the samething? No, they are not. The first assumes a hash named %score, e.g. my %score = ( fred => \ 5 ); where the value of the key 'fred' is a scalar refe

Re: how to replace @ inside of { }

2008-03-28 Thread Richard Lee
Just one more question, what is the difference between, ${$score{ "fred" } } and ${$score}{"fred"} are they the samething? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Install CPAN module in shared hosting

2008-03-28 Thread Rob Coops
Most likely this module will need a C/C++ compiler which for obvious reasons will not be present on your hosting providers machine. The best option is to ask your provider for assistance with installing this. Most of the time the hosting provider will not give you any trouble and will simply insta

Install CPAN module in shared hosting

2008-03-28 Thread anthony brooke
Hello, I like to install CPAN modulike like AI::Prolog, I have the Cpanel that have CPAN module installer, but my shared hosting does not allow some modules to be installed like this AI::Prolog, what can I do ? Should I install it in my computer first and then copy the PM files to my web host

Re: Geting the Host from URL in cgi script

2008-03-28 Thread Gunnar Hjalmarsson
Gunnar Hjalmarsson wrote: sivasakthi wrote: I have passed the one URL to cgi script , and i have retrieve the values by using the param method.. the example url is following , http://172.16.2.30:2004/block/blocked.cgi?url=google.com&target=gambling now i wanted to retrieve the host of http://1

Re: Handling OLD files

2008-03-28 Thread Santosh Patil`
below peace of code u list of files, sorted according the date "" @lfiles = grep {stat($_)->mtime() < $date} @files; On Fri, Mar 28, 2008 at 5:08 PM, Robert (bloo) < [EMAIL PROTECTED]> wrote: > Sandy wrote: > > On Mar 27, 1:40 pm, [EMAIL PROTECT

Re: Handling OLD files

2008-03-28 Thread Robert (bloo)
Sandy wrote: On Mar 27, 1:40 pm, [EMAIL PROTECTED] (Anders) wrote: I am looking for a way of moving files older than a date, I am need this in a script for moving/erase old files from a production machine Try using File::Find http://search.cpan.org/~nwclark/perl-5.8.7/lib/File/Find.pm

Re: Geting the Host from URL in cgi script

2008-03-28 Thread Gunnar Hjalmarsson
sivasakthi wrote: I have passed the one URL to cgi script , and i have retrieve the values by using the param method.. the example url is following , http://172.16.2.30:2004/block/blocked.cgi?url=google.com&target=gambling now i wanted to retrieve the host of http://172.16.2.30:2004/block/bl

Geting the Host from URL in cgi script

2008-03-28 Thread sivasakthi
Hi all, I have passed the one URL to cgi script , and i have retrieve the values by using the param method.. the example url is following , http://172.16.2.30:2004/block/blocked.cgi?url=google.com&target=gambling now i wanted to retrieve the host of http://172.16.2.30:2004/block/blocked.cgi ..

Re: special chars as scalar inside regex

2008-03-28 Thread John W. Krahn
Rob Benton wrote: I've got a problem I think there may be a straight-forward solution to that I just don't know. I have a program that reads a variable-length input file. And the field delimiter of that file is given as an argument. The problem is something like pipe "|" might show up as th

Re: special chars as scalar inside regex

2008-03-28 Thread Gunnar Hjalmarsson
Rob Benton wrote: I've got a problem I think there may be a straight-forward solution to that I just don't know. I have a program that reads a variable-length input file. And the field delimiter of that file is given as an argument. The problem is something like pipe "|" might show up as the

special chars as scalar inside regex

2008-03-28 Thread Rob Benton
I've got a problem I think there may be a straight-forward solution to that I just don't know. I have a program that reads a variable-length input file. And the field delimiter of that file is given as an argument. The problem is something like pipe "|" might show up as the delimiter.

Re: Load hash from a scalar

2008-03-28 Thread John W. Krahn
scooter wrote: I want to load the value from scalar variable to a hash Example: my $a = "a, 1, b, 2, c, 3"; Now, I need to create a hash %b, which holds values like %b = { a => 1, b => 2, c => 3 }; $ perl -le' use Data::Dumper; my $a = "a, 1, b, 2, c, 3"; my %b = $a =~ /[^, ]+/g; print Dumper

Load hash from a scalar

2008-03-28 Thread scooter
I want to load the value from scalar variable to a hash Example: my $a = "a, 1, b, 2, c, 3"; Now, I need to create a hash %b, which holds values like %b = { a => 1, b => 2, c => 3 }; TIA. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://le

Re: File Handling problem.

2008-03-28 Thread Ben Bullock
On Mar 28, 1:35 am, [EMAIL PROTECTED] (Ay) wrote: > Hi, > > Current task requires me to combine a few files into a single file > ( abc. txt ) where in each file has to be in a single page. I was able > to create a combined file, but not able to ensure that each file > resides in a page. Attempted a

Re: Handling OLD files

2008-03-28 Thread Ben Bullock
On Mar 28, 5:40 am, [EMAIL PROTECTED] (Anders) wrote: > Hi! > I am looking for a way of moving files older than a date, You can find the number of days since a file was last modified with - M: #! perl use warnings; use strict; opendir (my $dir, ".") or die "$1"; for (readdir ($dir)) { print $

Re: Handling OLD files

2008-03-28 Thread Sandy
On Mar 27, 1:40 pm, [EMAIL PROTECTED] (Anders) wrote: > I am looking for a way of moving files older than a date, > I am need this in a script for moving/erase old files from a > production machine Try using File::Find http://search.cpan.org/~nwclark/perl-5.8.7/lib/File/Find.pm /sandy http://mype

Re: how to repeat non-atom patterns

2008-03-28 Thread Sandy
On Mar 27, 11:48 am, [EMAIL PROTECTED] (Ciwei) wrote: > Given a multiple char patterns like ":C9" that repeated, how to write > a regex that repeat the patterns( which is non-atom ) 6 times. like > in > below > >WWPN:10:00:00:00:c9:2e:e8:90 > > I tried to define pattern to match > > my $matc