why getstore can't work, especially for store xml file on freebsd

2005-05-24 Thread Franklin
Hi; I have a small program that uses getstore to fetch a xml webpahe and store it. It is: use strict; use warnings; use LWP::Simple; my $xmlurl=http://www.sec.gov/Archives/edgar/data/903404/000118143105029692/rrd79736.xml;; my $xmlfile=xml.xml; my $status=getstore($xmlurl,$xmlfile);

Re: undefined...

2005-05-24 Thread John W. Krahn
Ley, Chung wrote: I didn't know the use of Data::Dumper, wish I had known it earlier... Basically, I was trying to mimic what the Boxplot.pl was doing, and so I did a loop like this: for (my $k; defined $data[0][1][$k]; $k++ ) { print data[0][1][$k] is

To Thread or not?

2005-05-24 Thread Tielman Koekemoer \(TNE\)
Hi all, I need to execute a shell command in a loop but the shell command takes about 1 minute to complete. I want to execute the shell command but but then continue processing. Usually I would background the process with but this does not work as Perl waits for the process to exit before

Count special character

2005-05-24 Thread Joel Divekar
Hi All I want to search a string for a special character and count the occurance. My code is as follows : -- #!/usr/bin/perl -w my $a = a:b:c:d:e:f:\:#8596;:#8596;:; my $count = ($a =~ tr/\chr(29)//); print $count; --

hash reference help

2005-05-24 Thread Ing. Branislav Gerzo
Hi beginners@perl.org, I fetch results from table with fetchall_hashref, here is my snippet: my $hr = $get-fetchall_hashref('id'); while (my ($id, $value) = each(%$hr)) { get_something(); } sub get_something { foreach my $k ( reverse sort { $hr-{$a}{counter} = $hr-{$b}{counter} }

RE: To Thread or not?

2005-05-24 Thread Bob Showalter
Tielman Koekemoer (TNE) wrote: Hi all, I need to execute a shell command in a loop but the shell command takes about 1 minute to complete. I want to execute the shell command but but then continue processing. Usually I would background the process with but this does not work as Perl waits

Graphic files visual modofocation in Perl

2005-05-24 Thread Vladimir D Belousov
Hallo all! I beg your pardon for this question - the question more theoretical, rather than practical. Whether there is a modules for geometry transformation of the images? In particular, I need rotate and change geometry (perspective, resize)? Thanks a lot for any answers! -- Vladimir D

RE: To Thread or not?

2005-05-24 Thread Tielman Koekemoer \(TNE\)
Thanks, I had a look at fork() and system(). I think system() would work better in my case. Thanks! -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: 24 May 2005 02:34 PM To: Tielman Koekemoer (TNE); Perl Beginners Subject: RE: To Thread or not? Tielman Koekemoer

RE: hash reference help

2005-05-24 Thread Charles K. Clarkson
Ing. Branislav Gerzo mailto:[EMAIL PROTECTED] wrote: : Hi beginners@perl.org, : : I fetch results from table with fetchall_hashref, here is my snippet: : : my $hr = $get-fetchall_hashref('id'); It would be helpful to know what $hr looks like. Do this, and then show us what it looks like.

Re: Graphic files visual modofocation in Perl

2005-05-24 Thread Chris Devers
On Tue, 24 May 2005, Vladimir D Belousov wrote: Whether there is a modules for geometry transformation of the images? In particular, I need rotate and change geometry (perspective, resize)? Yes. ImageMagick is the most common way to do this. It's a toolkit for making all kinds of image

Re: Graphic files visual modofocation in Perl

2005-05-24 Thread Vladimir D Belousov
Chris Devers wrote: On Tue, 24 May 2005, Vladimir D Belousov wrote: Whether there is a modules for geometry transformation of the images? In particular, I need rotate and change geometry (perspective, resize)? Yes. ImageMagick is the most common way to do this. It's a toolkit for

Re: hash reference help

2005-05-24 Thread Ing. Branislav Gerzo
Charles K. Clarkson [CKC], on Tuesday, May 24, 2005 at 08:16 (-0500) thinks about: CKC It would be helpful to know what $hr looks like. Do this, and then CKC show us what it looks like. Show a partial dump if this is too long. CKC use Data::Dumper 'Dumper'; CKC print Dumper $hr; in select I

chr function on z/OS.

2005-05-24 Thread rajarshi das
Hi, I have a basic doubt regarding unicode and z/OS (ebcdic : ibm-1047). $a = chr(0x00A1); $b = chr(0xA1); Should $a and $b be equal or yield different results ? $b is definitely the character ~. Is $a also the same thing or is it the character equivalent to \xAA ? $a on linux gives me

a question about print in array

2005-05-24 Thread Frank
I met an interesting problem recently and am expecting your kind advice. my input file (for_test) is like as follows. I wish add a to the first line (before the word blue) and remove at the last line. # ---begining of the file, this line is not included in the file---# blue sky skirt

Re: a question about print in array

2005-05-24 Thread Jeff 'japhy' Pinyan
On May 24, Frank said: print OUTPUT @items\n; When you place an array inside quotes, it's the same as saying join($, @array) where $ is the list separator variable, whose default value is (a single space). Thus, if @array is (this, that, those), then @array is this that those.

Re: assigning printf statement to an array

2005-05-24 Thread DBSMITH
my @a= map {$hdir.$_-[1]} # select filename grep {$_-[0] 100} # exclude age = 100 map { [ sprintf (%.0f,( $now - ( stat(${hdir}$_ ) )[9] ) / ONE_DAY ), $_ ] } # create aref [age, filename] grep {$_ ne . and $_ ne ..} # exclude unwanted sort readdir DH; # get all files The

while loop - map

2005-05-24 Thread Robert Citek
I found a variation of this in the Perl Nutshell book: $ perl -le ' $foo=fee fie foe foo ; while ($foo =~ m/e/g ) { push @bar, pos $foo ; } print join(:, @bar); ' 2:3:7:11 Is there an equivalent way to do the same using map instead of an explicit while loop? I'm guessing not, since

Re: efficiency of hash of hashes/lists

2005-05-24 Thread Dave Gray
On 5/23/05, Peter Rabbitson [EMAIL PROTECTED] wrote: On Mon, May 23, 2005 at 01:40:08PM -0400, Zhenhai Duan wrote: I tried hash (where the members of a group are joined with :), and hash of hash. It happended that hash of hash is slower than single hash. Hash: $groups{$g1} =

Return CD-ROM/RW Creation Date

2005-05-24 Thread ahuber
Platform: Windows Version: Active State v5.8.36 build number 811 Is there a way to find out the creation date (or burn date) of a cd-rw disc? I tried using things like $burndate = (stat(.))[9], but on windows there is no current directory entry for CD media, it always returns an old date like

Re: efficiency of hash of hashes/lists

2005-05-24 Thread Philip M. Gollucci
Dave Gray wrote: On 5/23/05, Peter Rabbitson [EMAIL PROTECTED] wrote: On Mon, May 23, 2005 at 01:40:08PM -0400, Zhenhai Duan wrote: I tried hash (where the members of a group are joined with :), and hash of hash. It happended that hash of hash is slower than single hash. Hash:

Re: efficiency of hash of hashes/lists

2005-05-24 Thread Dave Gray
# access test for 2d ($su, $ss) = times; for my $i (0 .. $hashsize-1) { $oned{$l1[$i]}{$l2[$i]}++ I think you should be operating on %twod here. LOL, thanks. Original poster take note: generating hashes..! base 0.03 0.00 0.03 1D 0.24

Fw: assigning printf statement to an array

2005-05-24 Thread DBSMITH
- Forwarded by Derek Smith/Staff/OhioHealth on 05/24/2005 03:47 PM - Derek Smith/Staff/OhioH

Using $# in a splice with split

2005-05-24 Thread Larsen, Errin M HMMA/IT
Hi Perl buddies, Can I do something like this: my $line = 'One Two Three Four Five Six'; my( $first, $last ) = (split(' ', $line))[0,$#(split(' ', $line))]; This does not work. What I want to do is to find the index of the last element of a list created by split, and use it in a slice on

Re: while loop - map

2005-05-24 Thread Xavier Noria
On May 24, 2005, at 19:22, Robert Citek wrote: I found a variation of this in the Perl Nutshell book: $ perl -le ' $foo=fee fie foe foo ; while ($foo =~ m/e/g ) { push @bar, pos $foo ; } print join(:, @bar); ' 2:3:7:11 Is there an equivalent way to do the same using map instead of an

Re: assigning printf statement to an array

2005-05-24 Thread John Doe
Hi Am Dienstag, 24. Mai 2005 18.05 schrieb [EMAIL PROTECTED] with funny quoting: [John:] my @a= map {$hdir.$_-[1]} # select filename grep {$_-[0] 100} # exclude age = 100 map { [ sprintf (%.0f,( $now - ( stat(${hdir}$_ ) )[9] ) / ONE_DAY ), $_ ] } # create aref [age, filename]

Re: while loop - map

2005-05-24 Thread John Doe
Am Dienstag, 24. Mai 2005 19.22 schrieb Robert Citek: I found a variation of this in the Perl Nutshell book: $ perl -le ' $foo=fee fie foe foo ; while ($foo =~ m/e/g ) { push @bar, pos $foo ; } print join(:, @bar); ' 2:3:7:11 Is there an equivalent way to do the same using

Re: why getstore can't work, especially for store xml file on freebsd

2005-05-24 Thread John Doe
Am Dienstag, 24. Mai 2005 08.59 schrieb Franklin: Hi; I have a small program that uses getstore to fetch a xml webpahe and store it. It is: use strict; use warnings; use LWP::Simple; my $xmlurl=http://www.sec.gov/Archives/edgar/data/903404/000118143105029692/r rd79736.xml; my

Re: assigning printf statement to an array

2005-05-24 Thread DBSMITH
operdir . 1 print 2 map {$_-[1].: .$_-[0].\n} # create entity output 3 grep {$_-[0] 100} # exclude age = 100 4 map { [ 5 sprintf (%.0f,( $now - ( stat(${hdir}$_ ) )[9] ) / ONE_DAY ), 6 $_ 7 ] } # create aref [age, filename] 8 grep {$_ ne . and $_ ne ..} # exclude unwanted 9 sort readdir

Re: why getstore can't work, especially for store xml file on freebsd

2005-05-24 Thread Franklin
Sometimes it ok. But when you run it many times, say 1,000 times, there is serveral times that it return 200, but the stored file is 0 bytes, titally empty. On 5/25/05, John Doe [EMAIL PROTECTED] wrote: Am Dienstag, 24. Mai 2005 08.59 schrieb Franklin: Hi; I have a small program

Re: assigning printf statement to an array

2005-05-24 Thread Jeff 'japhy' Pinyan
On May 24, [EMAIL PROTECTED] said: 1 print 2 map {$_-[1].: .$_-[0].\n} # create entity output 3 grep {$_-[0] 100} # exclude age = 100 4 map { [ 5 sprintf (%.0f,( $now - ( stat(${hdir}$_ ) )[9] ) / ONE_DAY ), 6 $_ 7 ] } # create aref [age, filename] 8 grep {$_ ne . and $_ ne ..} # exclude

Re: Count special character

2005-05-24 Thread Jeff 'japhy' Pinyan
On May 24, Joel Divekar said: #!/usr/bin/perl -w my $a = a:b:c:d:e:f:\:#8596;:#8596;:; my $count = ($a =~ tr/\chr(29)//); That doesn't work. First of all, '#8596;' in Perl is just 7 characters in a row. HTML entity codes are for HTML, not Perl. If you want character #8596 in Perl, you