Re: A loop to parse a large text file--output is empty!

2006-06-23 Thread Muma W.
D. Bolliger wrote: Michael Oldham am Freitag, 23. Juni 2006 18:20: [...] A faster strategy would be: 1. create a lookup hash with the IDs of IDFILE (IDs as keys) [...] Doh! That's right. A hash would be a hundred times faster. Here's the rewrite of my program to use a hash: #!/usr/bin/p

RE: Win32 - determining if a file is a directory

2006-06-23 Thread Charles K. Clarkson
Mark Harris wrote: # Always use strict and warnings. use strict; use warnings; : use Win32::File; : $dirspec = "c:\\xfer"; # / is the preferred perl directory separator # (even on windows). my $dirspec = 'c:/xfer'; Following Tom's advice we might do this. : opendir(DS, $dirspec); # Alway

Re: Netiquette

2006-06-23 Thread Mr. Shawn H. Corey
On Sat, 2006-24-06 at 01:09 +0200, Dr.Ruud wrote: > "Omega -1911" schreef: > > > while( ){ > >chomp; > >push @past_bids, $_; # push remaining lines into array > >} > > That is (almost) the same as > > chomp( @past_bids = ) ; > > > Why do you

Re: Netiquette

2006-06-23 Thread Dr.Ruud
"Omega -1911" schreef: > while( ){ >chomp; >push @past_bids, $_; # push remaining lines into array >} That is (almost) the same as chomp( @past_bids = ) ; Why do you insist on slurping the remaining lines in an array? If the file is 900 MB (

Re: Win32 - determining if a file is a directory

2006-06-23 Thread Tom Phoenix
On 6/23/06, Mark Harris <[EMAIL PROTECTED]> wrote: opendir(DS, $dirspec); You should probably use the "... or die" idiom, in case the opendir fails, much as you would with open. while($fn = readdir(DS)) { if ( -d $fn) The most common error when combining readdir() and the -x family of

Win32 - determining if a file is a directory

2006-06-23 Thread Mark Harris
On a windows xp machine, running the following code with active state perl 5.8.8: use Win32::File; $dirspec = "c:\\xfer"; opendir(DS, $dirspec); while($fn = readdir(DS)) { if ( -d $fn) { print "$fn is a directory\n"; } else { print "$fn is not a directory\n";

RE: Any PERL Decompiler / code ?

2006-06-23 Thread Timothy Johnson
Please reply to the list. .p is not an extension usually used with perl, but there's really not enough to go on here. It's always possible that they just used shroud or something to obfuscate the code. From: I BioKid [mailto:[EMAIL PROTECTED] Sent: Friday, June 23, 2006 1:49 PM To: Timoth

RE: Any PERL Decompiler / code ?

2006-06-23 Thread Timothy Johnson
I suppose if you're looking for a decompiler you should probably know the difference between a compiled and interpreted language. There are two products that can package Perl scripts into executables, but even they don't compile them. -Original Message- From: I BioKid [mailto:[EMAIL PROTE

RE: Any PERL Decompiler / code ?

2006-06-23 Thread Timothy Johnson
It depends on which program was used to create the executable. I don't know about Perl2Exe, but PerlApp encrypts the contents of the executables to prevent tampering. -Original Message- From: I BioKid [mailto:[EMAIL PROTECTED] Sent: Friday, June 23, 2006 1:35 PM To: Timothy Johnson; begi

Re: Any PERL Decompiler / code ?

2006-06-23 Thread Joshua Colson
On Sat, 2006-06-24 at 03:04 +0530, I BioKid wrote: > I am sure it is in perl. I am working on a linux - there is no proper > extension for that program for example one program name alscr.p another one > is test1.cgi - If u would likt have a closer look - I can send u a file - > > thanks for the ca

Re: Any PERL Decompiler / code ?

2006-06-23 Thread Chad Perrin
On Sat, Jun 24, 2006 at 03:04:14AM +0530, I BioKid wrote: > I am sure it is in perl. I am working on a linux - there is no proper > extension for that program for example one program name alscr.p another one > is test1.cgi - If u would likt have a closer look - I can send u a file - Feel free to s

Re: Any PERL Decompiler / code ?

2006-06-23 Thread I BioKid
I am sure it is in perl. I am working on a linux - there is no proper extension for that program for example one program name alscr.p another one is test1.cgi - If u would likt have a closer look - I can send u a file - thanks for the care & support I'm guessing it wasn't written in Perl, then

Re: Any PERL Decompiler / code ?

2006-06-23 Thread Chad Perrin
On Sat, Jun 24, 2006 at 02:30:15AM +0530, I BioKid wrote: > Thanks for your reply - > Infact I dnt which program was used to generate executable - > could you tell me any possible program to get the code out of it ? > funny thing is they dnt even have an extension name of .exe > for eg a file name

Re: Can't use string ("3862926") as a HASH ref while "strict refs"

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 15:10 -0500, Muma W. wrote: > IOW, you (probably) need to keep the depths the same. What he needs to do is to check the structure (with the debugger or Data::Dumper) every time before he uses the structure. And that means _every_ time. (Don't worry, like my karate instructor

Re: Any PERL Decompiler / code ?

2006-06-23 Thread I BioKid
Thanks for your reply - Infact I dnt which program was used to generate executable - could you tell me any possible program to get the code out of it ? funny thing is they dnt even have an extension name of .exe for eg a file name alignscr.p - am sure that it is a perl code, but am not able to ope

Re: Any PERL Decompiler / code ?

2006-06-23 Thread I BioKid
Hi I agreed Perl is human readable - for that I should open it in my VI editor - but am not able to at the same time the program is working fine ! This script are not written / made executable / packed byme - am just suppose to use it and at this point of time i need to edit to change some param

Re: Can't use string ("3862926") as a HASH ref while "strict refs"

2006-06-23 Thread Muma W.
Moon, John wrote: [...] 150 $totals{$fund}{$service}{$acct}{AMT} += $amt; 151 $totals{$fund}{$service}{$acct}{QTY} += $n_qty; 152 $totals{$fund}{$service}{AMT} += $amt; 153 $totals{$fund}{$service}{QTY} += $n_qty; 154 $totals{$fund} += $amt; > [...] I thi

Re: A loop to parse a large text file--output is empty!

2006-06-23 Thread Muma W.
Michael Oldham wrote: Hello again, Thanks to everyone for their helpful suggestions. I finally got it to work, using the following script. However, it takes about 5 hours to run on a fast computer. Using grep (in bash), on the other hand, takes about 5 minutes (see below if you are interested

Re: Any PERL Decompiler / code ?

2006-06-23 Thread Mr. Shawn H. Corey
On Sat, 2006-24-06 at 02:04 +0530, I BioKid wrote: > Infact my problem is I have some scripts that was converted in to PERL > executable - I dont know how it was done . > I just need to get the source code out of these executables ! > I though decompiler is the general term for that kind of softwar

Re: Any PERL Decompiler / code ?

2006-06-23 Thread I BioKid
Infact my problem is I have some scripts that was converted in to PERL executable - I dont know how it was done . I just need to get the source code out of these executables ! I though decompiler is the general term for that kind of software - :| Is there any thing around ? On 6/24/06, Timothy

Re: A loop to parse a large text file--output is empty!

2006-06-23 Thread D. Bolliger
Michael Oldham am Freitag, 23. Juni 2006 18:20: > Hello again, Hello Michael > Thanks to everyone for their helpful suggestions. I finally got it to > work, using the following script. However, it takes about 5 hours to > run on a fast computer. Using grep (in bash), on the other hand, takes >

Any PERL Decompiler / code ?

2006-06-23 Thread I BioKid
hi perlpals, am looking for a decompiler to decode some perl and cgi executable. is there any perl decompilers around (GNU) or raw code will do ? -- thanks and online pizzas for all help !`

Slurping a big file (WAS: Netiquette)

2006-06-23 Thread Dave Gray
On 6/23/06, Omega -1911 <[EMAIL PROTECTED]> wrote: Shawn, I modified your example like so, was this correct? chomp( my $data1 = ); # line 1 chomp( my $data2 = ); # line 2 chomp( my $data3 = ); # line 3 chomp( my $data4 = ); # line 4 chomp( my $data5 = ); # line 5 while( ){ c

Re: Can't use string ("3862926") as a HASH ref while "strict refs"

2006-06-23 Thread Tom Phoenix
On 6/23/06, Moon, John <[EMAIL PROTECTED]> wrote: 118 print "value =<$totals{$prev_fund}{$prev_service}{AMT}>\n"; Can't use string ("3862926") as a HASH ref while "strict refs" in use at ./journal_items.pl line 118. From the looks of that message, I'm guessing that $totals{$pre

Re: Can't use string ("3862926") as a HASH ref while "strict refs"

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 13:36 -0400, Moon, John wrote: > 1 #! /usr/local/bin/perl -d > 2 use strict; >106 my ($prev_fund, $prev_service, $prev_acct); >107 my %totals=(); >108 while ($sth->fetch) { >109 if ($fund ne $prev_fund) { >110 > &PrintAcctTotal($totals{$

Re: Netiquette (WAS: reading a line at a time inefficient?)

2006-06-23 Thread Omega -1911
On 6/23/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: On Fri, 2006-23-06 at 11:55 +, Jeff Peng wrote: > > > >Let's see, the subject is: reading a line at a time inefficient? > > > >That's where I got the idea. > > > > > No,the subject is "Re: reading a line at a time inefficient? ",he ha

should be a seamless upgrade?

2006-06-23 Thread tom arnall
There's a new CPAN.pm version (v1.87) available! [Current version is v1.7601] You might want to try install Bundle::CPAN reload cpan without quitting the current session. It should be a seamless upgrade WHILE WE ARE RUNNING... do not the cap'd words mean that i can continue doing

Can't use string ("3862926") as a HASH ref while "strict refs"

2006-06-23 Thread Moon, John
I guess I'm not understanding what I'm doing (or have been reading in my web searches)... Can someone explain the difference between these two code snippets... SUN83-PRODWEB>more foo #! /usr/local/bin/perl use strict; my %t; my ($a, $c); my ($aa, $cc); $a=$a

Re: How to pass a block of code, as a parameter to function.

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 13:01 -0400, Muttley Meen wrote: > All this if foo has the prototype > sub foo(&$) > > The question that I have is why isn't it possible to have > the block reference as the second parameter, so foo would be called as : Don't use prototypes. They were design for other things

Re: How to pass a block of code, as a parameter to function.

2006-06-23 Thread Muttley Meen
On 6/23/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: On Fri, 2006-23-06 at 17:19 +0300, Muttley Meen wrote: > I searched around for a construct to permit for a block > of code to be passed as parameter, but with no success. That's because you can't pass a block of code, you can only pass a

Re: Another (hopefully more clear) plea for help with CSV data

2006-06-23 Thread Todd W
""Ralph H. Stoos Jr."" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > All, > > I have been asked to do something in Access or Excel which I find > disagreeable. Open Source is the way to go and also, PERL is more > flexible. I might even obtain a little professional development o

'-d' with '>' creates errors

2006-06-23 Thread tom arnall
invoking a perl script with '#!/usr/perl -wd' in its first line and with './myscript >t' on the command line, i get as below. i have done this kind of thing many times, but never with this result. also, the script runs fine if i drop '>t' from the invocation, or drop '-d' from the first line o

RE: A loop to parse a large text file--output is empty!

2006-06-23 Thread Michael Oldham
Hello again, Thanks to everyone for their helpful suggestions. I finally got it to work, using the following script. However, it takes about 5 hours to run on a fast computer. Using grep (in bash), on the other hand, takes about 5 minutes (see below if you are interested). Thanks again! SLOW

RE: web 2.0 module

2006-06-23 Thread Jeff Peng
Search cpan with 'ajax' or 'blog',you could find something as 'CGI::Ajax' or 'Blog::Simple'. http://search.cpan.org/~bct/CGI-Ajax-0.695/lib/CGI/Ajax.pm http://search.cpan.org/~gilad/Blog-Simple-0.02/Simple.pm From: "Ken Perl" <[EMAIL PROTECTED]> To: "Perl Beginners List" Subject: web 2.0 modu

web 2.0 module

2006-06-23 Thread Ken Perl
hi, does anybody know any mature web2.0 modules on CPAN? -- perl -e 'print unpack(u,"62V5N\"FME;G\!Ehttp://learn.perl.org/>

Re: How to pass a block of code, as a parameter to function.

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 17:19 +0300, Muttley Meen wrote: > I searched around for a construct to permit for a block > of code to be passed as parameter, but with no success. That's because you can't pass a block of code, you can only pass a reference to a block of code, or the text that can be compil

RE: How to pass a block of code, as a parameter to function.

2006-06-23 Thread Jeff Peng
Hello, You maybe want to pass a subroutine's reference to another subroutine.I would modify your codes as follow: use strict; sub foo { my $p1 = shift ; my $p2 = shift ; print "Param1 = $p1\n" ; &$p2 ; } sub bar { print "hello\n"; } foo("test",\&bar); It execute and get the resu

How to pass a block of code, as a parameter to function.

2006-06-23 Thread Muttley Meen
I searched around for a construct to permit for a block of code to be passed as parameter, but with no success. The thing that I'm after is this : sub foo { $p1 = shift ; $p2 = shift ; print "Param1 = $p1\n" ; eval $p2 ; } foo("test") { print "depth 1\n" ; } Param1 = test

Re: ImageMagick Error

2006-06-23 Thread Mike Blezien
Brian, - Original Message - From: "Brian Volk" <[EMAIL PROTECTED]> To: Sent: Friday, June 23, 2006 7:59 AM Subject: RE: ImageMagick Error -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: Friday, June 23, 2006 8:08 AM To: Jeff Peng; beginners@perl.org

RE: ImageMagick Error

2006-06-23 Thread Brian Volk
> -Original Message- > From: Mike Blezien [mailto:[EMAIL PROTECTED] > Sent: Friday, June 23, 2006 8:08 AM > To: Jeff Peng; beginners@perl.org > Subject: Re: ImageMagick Error > > No, that's not the problem, the first thing I checked. the script runs > under the > correct UID, as suexec i

Re: ImageMagick Error

2006-06-23 Thread Mike Blezien
Jeff, - Original Message - From: "Jeff Peng" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Friday, June 23, 2006 6:58 AM Subject: RE: ImageMagick Error The $imagetoread is there, but keep getting the Error: Exception 435: unable to open image ... and haven't been able to ident

Re: Netiquette (WAS: reading a line at a time inefficient?)

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 11:55 +, Jeff Peng wrote: > > > >Let's see, the subject is: reading a line at a time inefficient? > > > >That's where I got the idea. > > > > > No,the subject is "Re: reading a line at a time inefficient? ",he has > followed the other's threads. > > > If you change th

RE: ImageMagick Error

2006-06-23 Thread Jeff Peng
The $imagetoread is there, but keep getting the Error: Exception 435: unable to open image ... and haven't been able to identify what this error means ?? Do you run your scripts under Apache/CGI? It seems that the apache don't have the privileges to open/access your images.Just take a look

Re: reading a line at a time inefficient?

2006-06-23 Thread Jeff Peng
Let's see, the subject is: reading a line at a time inefficient? That's where I got the idea. No,the subject is "Re: reading a line at a time inefficient? ",he has followed the other's threads. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTE

ImageMagick Error

2006-06-23 Thread Mike Blezien
Hello, Hoping we have someone who maybe able to shed some light on an error we keep getting when attempting to use ImageMagick w/Perl ### ERROR: Exception 435: unable to open image my $image = Image::Magick->new(); my($i); $i = $ima

Re: reading a line at a time inefficient?

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 11:02 +, Jeff Peng wrote: > >I don't know where people got the idea that reading a file one line at a > >time is less efficient than slurping it. > > Could you take a look at his questions carefully?He NEVER expressd the > meanings as you've said! > > Let's see, the s

Re: reading a line at a time inefficient?

2006-06-23 Thread Jeff Peng
I don't know where people got the idea that reading a file one line at a time is less efficient than slurping it. Could you take a look at his questions carefully?He NEVER expressd the meanings as you've said! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: reading a line at a time inefficient?

2006-06-23 Thread Mr. Shawn H. Corey
On Fri, 2006-23-06 at 02:39 -0400, Omega -1911 wrote: > -Open one file. > -Read that file. > --Line one will be assigned to $data1 > --Line two will be " " to $data2 > .. > --Line five will be " " to $data5 > -- The remaining lines pushed into an array... > > Really appreciate any help you can giv

Smth unnatural

2006-06-23 Thread Monomachus
Ok, there is the thing ... I have 2 lists ... First list @Q where i store all the knots ... of an graf I supose... ok so the first list is from for ex.: q0 to q1 ok 2 knots... everything's fine... Then second list @Sigma is smth like $glue (connections) values between knots ... For ex.: @Sig

RE: Trying to add hyperlink

2006-06-23 Thread Nath, Alok (STSD)
Thanx Clarles.This code is really cool. I was looking something like this . -Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: Thursday, June 22, 2006 10:22 PM To: beginners@perl.org Subject: RE: Trying to add hyperlink chen li wrote: : How to convert the fo