Re: files checksum perl program help

2012-01-05 Thread ram ram
newer than master install. I need to figure out and report in a file that the library xxx_lib.so(server2) is different from Master(which is on server1). Ramp From: Jim Gibson To: "beginners@perl.org" Sent: Thursday, January 5, 2012 11:34 AM Subject:

Re: files checksum perl program help

2012-01-05 Thread Jim Gibson
On 1/5/12 Thu Jan 5, 2012 11:01 AM, "ram ram" scribbled: > Thank You very much Jim for your immediate response. > my requirement is that I have standard installation on server1 which is a > master copy. I know the location of the installation directory which contains > bunch of libraries. > I h

Re: files checksum perl program help

2012-01-05 Thread ram ram
server1. I am not sure which protocol suits best. right now I am considering NFS. Your help greatly appreciated. Regards, Ramp From: Jim Gibson To: "beginners@perl.org" Sent: Wednesday, January 4, 2012 3:54 PM Subject: Re: files checksum perl program hel

Re: files checksum perl program help

2012-01-04 Thread Jim Gibson
On 1/4/12 Wed Jan 4, 2012 3:38 PM, "ram ram" scribbled: > Hi , >    Wish you a Very Happy and Wonderful New Year. > I am a beginner in perl programming. > > I request your help to write a perl program that takes 2 different directories > on 2 different servers and find all the files in these 2

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Uri Guttman
> "BM" == Brandon McCaig writes: BM> On Fri, Sep 16, 2011 at 2:55 PM, Paul Johnson wrote: >> map EXPR, @a is just the same as map { EXPR } @a. BM> The part that I find confusing is that EXPR is evaluated against each BM> $_, as opposed to once when map is called, passing the resulti

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Uri Guttman
> "PJ" == Paul Johnson writes: PJ> On Fri, Sep 16, 2011 at 02:27:08PM -0400, Brandon McCaig wrote: >> my @column_headers = map trim($_), split /\|/, $header_line; >> Using an EXPR with map is even more confusing to me, but it seems to >> work here so I'll leave it at that. ;D PJ>

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Brandon McCaig
On Fri, Sep 16, 2011 at 2:55 PM, Paul Johnson wrote: > map EXPR, @a is just the same as map { EXPR } @a. The part that I find confusing is that EXPR is evaluated against each $_, as opposed to once when map is called, passing the resulting value into map. :) Obviously it's just one of the many ma

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Paul Johnson
On Fri, Sep 16, 2011 at 02:27:08PM -0400, Brandon McCaig wrote: > my @column_headers = map trim($_), split /\|/, $header_line; > Using an EXPR with map is even more confusing to me, but it seems to > work here so I'll leave it at that. ;D map EXPR, @a is just the same as map { EXPR } @a. Some

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Jim Gibson
On 9/16/11 Fri Sep 16, 2011 11:27 AM, "Brandon McCaig" scribbled: > On Fri, Sep 16, 2011 at 11:32 AM, Brandon McCaig wrote: >>    my @column_headers = map { $_ = trim($_); $_; } >>            split /\|/, $header_line; > > Sorry, that should be: > > my @column_headers = map trim($_), split

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Brandon McCaig
On Fri, Sep 16, 2011 at 11:32 AM, Brandon McCaig wrote: >    my @column_headers = map { $_ = trim($_); $_; } >            split /\|/, $header_line; Sorry, that should be: my @column_headers = map trim($_), split /\|/, $header_line; I'm still relatively new to using BLOCKs within statements li

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Shlomi Fish
Hi Brandon, On Fri, 16 Sep 2011 11:32:16 -0400 Brandon McCaig wrote: > On Thu, Sep 15, 2011 at 3:48 PM, Rob wrote: > > I have a file of test results it is formatted as follows: > > > >        School |fname| lname | sub| testnum|score| grade|level > > MLK School | John | Smith | RE | Test 1| 95|

Re: Files and Arrays - Search for values and write to the right

2011-09-16 Thread Brandon McCaig
On Thu, Sep 15, 2011 at 3:48 PM, Rob wrote: > I have a file of test results it is formatted as follows: > >        School |fname| lname | sub| testnum|score| grade|level > MLK School | John | Smith | RE | Test 1| 95| A | Prof > MLK School | John | Smith | RE | Test 2| 97| A | Prof > MLK School | J

Re: Files are getting blank while using substitute command in script

2010-01-19 Thread harish behl
\$/; print WRITEFILE $_;   } Now, the script is working fine   Regards, Harish     From: Erez Schatz Subject: Re: Files are getting blank while using substitute command in script To: "harish behl" Cc: beginners@perl.org Date: Tuesday, 19 January, 2010, 4:27 PM 2010/1/19 harish be

Re: Files are getting blank while using substitute command in script

2010-01-19 Thread Erez Schatz
2010/1/19 harish behl : > My Script has to search a particular string like "\$Header\$" in files and if > this string is found, it should replace it with "\$Header > $NameofFile 01/01/2009". But it's making the files blanks. This means you have a problem in the part that is writing to the files,

RE: Files manipulation

2007-03-27 Thread José Pedro Silva Pinto
First option should be better, because it is faster to implement, and run faster. But open file using perl language and make changes using s operator, should be faster too. The best way to choose should be make a test using two methods (using time unix command before ask perl script to verify t

Re: Files manipulation

2007-03-27 Thread Tom Phoenix
On 3/27/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote: What's the more fast ? 1) perl -pi -e 's/foo/bar/g' file.txt 2) open the file and make modifications What happens when you time both programs? It may be that the answer for me with my data on my hardware is different than the answer for

Re: Files Operations in Pearl

2007-03-16 Thread Jeff Pang
>> @tmp = map { (split)[2] } grep { /localhost/ } ; > >This is a bad idea if the file you are reading from is at all large. Yes memory consuming of using map and grep is the fact. But AFAIK postgresql.conf is not big at all (just a few lines) b/c I'm pretty familiar with it. :) -- To unsubscr

Re: Files Operations in Pearl

2007-03-16 Thread Chas Owens
On 3/16/07, Jeff Pang <[EMAIL PROTECTED]> wrote: snip @tmp = map { (split)[2] } grep { /localhost/ } ; snip This is a bad idea if the file you are reading from is at all large. It is better to use a real loop rather than map or grep when reading from a file. The problem lies in the fact that

Re: Files Operations in Pearl

2007-03-16 Thread Jeff Pang
>In shell-script I get a variable with command line: > >AUXIP=`cat $INPUTDB/postgresql.conf | grep "localhost" > | awk '{print $3}' | head -n1` > Hello, In Perl it can most likely be written as: open FILE,"$INPUTDB/postgresql.conf" or die $!; @tmp = map { (split)[2] } grep { /localhost/ } ; c

Re: Files Operations in Pearl

2007-03-16 Thread John W. Krahn
Rodrigo Faria Tavares wrote: > Hello, Hello, > In shell-script I get a variable with command line: > > AUXIP=`cat $INPUTDB/postgresql.conf | grep "localhost" > | awk '{print $3}' | head -n1` UUOC: AUXIP=`grep "localhost" "$INPUTDB/postgresql.conf" | awk '{print $3}' | head -n1` AWK can do re

Re: Files Operations in Pearl

2007-03-16 Thread Chas Owens
On 3/16/07, Rodrigo Faria Tavares <[EMAIL PROTECTED]> wrote: snip After I open the file, i like to get a simple word and store in a scalar variable. Or write after line 10 for example. And others. snip In Perl file operations are generally handled by file handles. If you want to use the object

Re: Files Operations in Pearl

2007-03-16 Thread Igor Sutton Lopes
Hi Rodrigo, On 2007/03/16, at 18:09, Rodrigo Faria Tavares wrote: Hello, In shell-script I get a variable with command line: AUXIP=`cat $INPUTDB/postgresql.conf | grep "localhost" | awk '{print $3}' | head -n1` In C++, I use the functions read, write and others for manipulation files. And P

Re: files download and performance

2007-01-22 Thread Igor Sutton
Hi Tatiana, 2007/1/22, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: I've executed script using ip number instead of domain name but it takes more or less the same time in these 2 steps: $browser2->get($url); $content = $browser2->content(); You also has to consider the network tr

Re: files download and performance

2007-01-22 Thread Tatiana Lloret Iglesias
I've executed script using ip number instead of domain name but it takes more or less the same time in these 2 steps: $browser2->get($url); $content = $browser2->content(); Honestly i dont know if these 9 seconds can be improved ... Regards, T On 1/22/07, Igor Sutton <[EMAIL PROTE

Re: files download and performance

2007-01-22 Thread Igor Sutton
Hi Tatiana, 2007/1/22, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: does it work for this kind of urls? http://patft.uspto.gov/netacgi/nph-Parser? thanks! T. For these kind of problem, you always have URI: #!env perl use strict; use warnings; use URI; my $url = "http://patft.uspto.gov/net

Re: files download and performance

2007-01-22 Thread Tatiana Lloret Iglesias
does it work for this kind of urls? http://patft.uspto.gov/netacgi/nph-Parser? thanks! T. On 1/22/07, Igor Sutton <[EMAIL PROTECTED]> wrote: Hi Tatiana, 2007/1/22, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: > i've realized that for each link, i spend most of the time in the following > perl

Re: files download and performance

2007-01-22 Thread Igor Sutton
Hi Tatiana, 2007/1/22, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: i've realized that for each link, i spend most of the time in the following perl script foreach my $url (@lines){ -- I READ MY 1-ROW URL FILE $contador=2; $test=0; while(!$test){ $browser2->

Re: files download and performance

2007-01-22 Thread Tatiana Lloret Iglesias
i've realized that for each link, i spend most of the time in the following perl script foreach my $url (@lines){ -- I READ MY 1-ROW URL FILE $contador=2; $test=0; while(!$test){ $browser2->get($url); $content = $browser2->content(); --IN THESE 2 STEPS

Re: files download and performance

2007-01-22 Thread Igor Sutton
Hi Tatiana, 2007/1/22, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: I do it from the JAva and not from the PErl because i need to perform an insert into the database each time i process a link and also i have to inform via rss about the progress of the global download process (23.343 out of 70.0

Re: files download and performance

2007-01-22 Thread Tatiana Lloret Iglesias
I do it from the JAva and not from the PErl because i need to perform an insert into the database each time i process a link and also i have to inform via rss about the progress of the global download process (23.343 out of 70.000 files have been downloaded) On 1/22/07, Igor Sutton <[EMAI

Re: files download and performance

2007-01-22 Thread Igor Sutton
Hi Tatiana, 2007/1/22, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: Regarding the performance problem: The schema of my application is: 1. I execute perl script which performs a search in a public database. It gets total results in *several pages*. Pressing "Next Page" button (with perl script

Re: files download and performance

2007-01-22 Thread Tatiana Lloret Iglesias
Regarding the performance problem: The schema of my application is: 1. I execute perl script which performs a search in a public database. It gets total results in *several pages*. Pressing "Next Page" button (with perl script) i get a list of all the links related to my query (70.000 more or le

Re: files download and performance

2007-01-15 Thread Rob Dixon
Tatiana Lloret Iglesias wrote: Hi all, from my java applicaation i invoke a perl script which downloads a huge quantity of files from an external database using WWW-mechanize library and my problem is that I have big CPU performance problems ... can you give me any advice to avoid this? Hi Tati

Re: files download and performance

2007-01-15 Thread Tom Phoenix
On 1/15/07, Tatiana Lloret Iglesias <[EMAIL PROTECTED]> wrote: from my java applicaation i invoke a perl script which downloads a huge quantity of files from an external database using WWW-mechanize library and my problem is that I have big CPU performance problems ... can you give me any advice

Re: files creating filters

2006-05-14 Thread John W. Krahn
badrinath chitrala wrote: > Hi Hello, > Can sombody hepl me in the below prog > I could not get any output What output were you expecting to get? What input did you give your program? > please tell me the mistake i hav done and where > also suggest me how to go with this > > my $lineno; > my

Re: files creating filters

2006-05-14 Thread Jeff Pang
Hi, For beginners,someone should always add this statement at the top: use strict; >my $lineno; Good. >my $current =3D ""; Here maybe you want: my $current = '3D'; In strict mode,bareword "3D" is not allowed. > >while(<>){ > if($current ne $ARGV){ $ARGV contains the name of the current file wh

RE: files creating filters

2006-05-14 Thread Charles K. Clarkson
badrinath chitrala wrote: : Can sombody hepl me in the below prog Can you tell us what it is suppose to do? It looks like you are trying to add line numbers to a file and print the result. : I could not get any output What is on your command line? What is in the file which is processe

Re: Files at different location

2002-11-06 Thread Paul Johnson
dan said: > well i could spend ample amount of time testing code for someone else. > like everyone else here, i'm only offering suggestions on how a problem > can be overcome. seriously, if someone is trying to create a perl > script, they'll have at least some knowledge in perl on how to fix > er

Re: Files at different location

2002-11-05 Thread LRMK
use this open (FILE _HANDDLE,'>c:\abc\abc.abc'); - Original Message - From: "Ankit Gupta" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 5:07 AM Subject: Files at different location > Hi, > > I have written script that makes lot of files but the pr

Re: Files at different location

2002-11-05 Thread LRMK
use this open (FILE _HANDDLE,'>c:\abc\abc.abc'); - Original Message - From: "Ankit Gupta" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 5:07 AM Subject: Files at different location > Hi, > > I have written script that makes lot of files but the pr

Re: Files at different location

2002-11-05 Thread dan
well i could spend ample amount of time testing code for someone else. like everyone else here, i'm only offering suggestions on how a problem can be overcome. seriously, if someone is trying to create a perl script, they'll have at least some knowledge in perl on how to fix errors if something isn

Re: Files at different location

2002-11-05 Thread Paul Johnson
dan said: > __ START __ > my $path = qq~C:\path\where\to\put\stuff~; > open (WHATEVER,qq~>$path\filename.ext~) or die (qq~Can't open > $path\filename.ext for writing : $!~); > etc.. > close(WHATEVER); > __ END __ > Note: untested, but i doubt anything can go wrong. Might I suggest testing next ti

Re: Files at different location

2002-11-05 Thread dan
__ START __ my $path = qq~C:\path\where\to\put\stuff~; open (WHATEVER,qq~>$path\filename.ext~) or die (qq~Can't open $path\filename.ext for writing : $!~); etc.. close(WHATEVER); __ END __ Note: untested, but i doubt anything can go wrong. give that a go. dan "Ankit Gupta" <[EMAIL PROTECTED]> wr

Re: files

2002-10-28 Thread Mark Goland
THANX - Original Message - From: "Steve Grazzini" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 28, 2002 11:33 PM Subject: Re: files > Mark Goland <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I am trying to read

Re: files

2002-10-28 Thread Steve Grazzini
Mark Goland <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to read from file handles in a loop. What I want to do is add a > string to a file handle. Here is an example of what I am tryin to do. > open FH1,"file"; > open FH2,"otherfile"; > ... > ... > foreach $Val (@F_handles){ >

Re: files

2002-02-06 Thread P0R0NG
hi andrea! thank you for your help - it did work. i have some extra problems though. in the code, i replaced nat with a variable (let's call it $section), here's my code snippet: ### start of snippet ### #this is the xml repository where all xml files where residing chdir $repository; # sec

Re: files

2002-02-02 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "P0r0ng" <[EMAIL PROTECTED]>: > hi list. > supposing i have a directory containing these files: nat_10-full.xml.afp >nat_10.xml.afp > nat_1-full.xml.afpnat_1.xml.afp > nat_2-full.xmlnat_2.xml > nat_3-full.xmlnat_3.xm

Re: files, mask

2001-04-24 Thread Michael Lamertz
[EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > i input as arguments a dir and a mask, and i need to get the name's of > the files of that mask in that dir on an array, how can i do this? Use the glob function - perldoc -f glob -- If we fail, we will lose the war. Michael

Re: files, mask

2001-04-24 Thread Paul Johnson
On Tue, Apr 24, 2001 at 01:01:11PM +0100, [EMAIL PROTECTED] wrote: > i input as arguments a dir and a mask, and i need to get the name's of > the files of that mask in that dir on an array, how can i do this? I would suggest using opendir(), readdir() and closedir() and making your mask a regula