Re: Barewood found where operator expected?

2007-08-29 Thread John W. Krahn
Jeff Pang wrote: 2007/8/28, mojorising <[EMAIL PROTECTED]>: Here is the script: perl -i.old -p -e /s/$(cat infra_east.txt)/$(cat infra_west.txt)/ig configfile.cfg Not tested it but it seems to be: perl -pi.old -e 's/$(`cat infra_east.txt`)/$(`cat infra_west.txt`)/ig' notice for the `` symb

Re: Barewood found where operator expected?

2007-08-29 Thread Jeff Pang
2007/8/29, John W. Krahn <[EMAIL PROTECTED]>: > Jeff Pang wrote: > > 2007/8/28, mojorising <[EMAIL PROTECTED]>: > > > >> Here is the script: > >> perl -i.old -p -e /s/$(cat infra_east.txt)/$(cat infra_west.txt)/ig > >> configfile.cfg > >> > > > > Not tested it but it seems to be: > > > > perl -pi.o

Re: File::Find

2007-08-29 Thread Rob Dixon
Randal L. Schwartz wrote: "Somu" == Somu <[EMAIL PROTECTED]> writes: Somu> Good sense of humour! Actually i wanted to search for F:/Hindi/RHTDM Somu> and i entered only /Hindi/RHTDM/ Why did you do that? I think you have to enter the full path on Windows. However, I don't run Windows (anywh

Re: Barewood found where operator expected?

2007-08-29 Thread John W. Krahn
mojorising wrote: Hello! Hello, I am trying to write a simple Perl script to edit a file using two other source files named infra_east.txt and infra_west.txt. Please excuse my ignorance on this. I am sure there are much better ways to do what I am doing but this is the best I can come up with

Problem in opening the file using Tail Module

2007-08-29 Thread sivasakthi
Hi Guys, I have used the following code to print the log files. but nothing is printed even it doesn't show the warning message, no prompt is returned. what is the mistake in code , could u help me to find the pbm??? #!/usr/bin/perl use strict; use warnings; use File::Tail; my $file=File::Tai

Re: Problem in opening the file using Tail Module

2007-08-29 Thread Jeff Pang
I tested the codes,which run well for me. Give a try to add '$|++' to disable IO buffer. 2007/8/29, sivasakthi <[EMAIL PROTECTED]>: > Hi Guys, > > I have used the following code to print the log files. but nothing is > printed even it doesn't show the warning message, no prompt is > returned. >

Re: AW: Problem in opening the file using Tail Module

2007-08-29 Thread sivasakthi
>File::Tail is waiting at least 10 second before starting to work. if it is taking at least 10 second to start then how it is faster than using open to access the file??? On Wed, 2007-08-29 at 11:49 +0200, Angerstein wrote: > File::Tail is waiting at least 10 second before starting to work. > If

Re: Problem in opening the file using Tail Module

2007-08-29 Thread sivasakthi
i didn't get your point , please explain little bit more... Thanks, Siva On Wed, 2007-08-29 at 17:55 +0800, Jeff Pang wrote: > I tested the codes,which run well for me. > Give a try to add '$|++' to disable IO buffer. > > 2007/8/29, sivasakthi <[EMAIL PROTECTED]>: > > Hi Guys, > > > > I have u

Re: Problem in opening the file using Tail Module

2007-08-29 Thread Rob Dixon
sivasakthi wrote: I have used the following code to print the log files. but nothing is printed even it doesn't show the warning message, no prompt is returned. what is the mistake in code , could u help me to find the pbm??? #!/usr/bin/perl use strict; use warnings; use File::Tail; my $fil

Re: Problem in opening the file using Tail Module

2007-08-29 Thread Mumia W.
On 08/29/2007 04:41 AM, sivasakthi wrote: Hi Guys, I have used the following code to print the log files. but nothing is printed even it doesn't show the warning message, no prompt is returned. what is the mistake in code , could u help me to find the pbm??? #!/usr/bin/perl use strict; use w

Re: Barewood found where operator expected?

2007-08-29 Thread Peter Scott
On Tue, 28 Aug 2007 08:58:58 -0700, mojorising wrote: > When I type this into the console: > perl -i.old -p -e /s/$(cat infra_east.txt)/$(cat infra_west.txt)/ig > configfile.cfg > > I get this: > Barewood found where operator expected at -e line 1, near "/s/emile" [...] > The weirdest thing is tha

Re: Problem in opening the file using Tail Module

2007-08-29 Thread sivasakthi
> > File::Tail will read only lines that are added to the file after it has been > opened. Your program will simply sleep until something new is added. > > Rob when my log file is updated then it works correctly thanks to all for reply

Re: Regex Issue

2007-08-29 Thread Chas Owens
On 8/29/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: snip > But i want to read only the elements of the Enum and the values assigned to > those elements. I dont want to read the Enum names and the extra characters. > I am unable to filter them. snip Sometimes one regex is not enough. The fol

AW: Problem in opening the file using Tail Module

2007-08-29 Thread Angerstein
Buffering is a problem, when you are printing to files or pipes. The Systems don´t write everything right away to disc. It waits until it has some time for it or the buffer is full. If you disable buffering, you write without wait for the cost of performance. (if you want to write with no buffering

AW: Problem in opening the file using Tail Module

2007-08-29 Thread Angerstein
rtfm ^^ -Ursprüngliche Nachricht- Von: sivasakthi [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 29. August 2007 13:16 An: beginners perl Betreff: Re: Problem in opening the file using Tail Module > > File::Tail will read only lines that are added to the file after it > has been open

More Perl and AJAX

2007-08-29 Thread Mathew Snyder
When passing a value from JavaScript to a Perl script, am I right in thinking that the value received by the Perl script would be captured like my $value = @_;? I'm trying to pass a value to Perl and by calling it directly in the browser and passing a value to it like so http://ajax.application.c

problem with simple pattern matching

2007-08-29 Thread Jim
Hi, I hope this is simple, as i am very new to perl. I am trying to use pattern matchinig to create many srcipts from a template file which i have read into a list then print out to files. the problem is the patter match only matches on the first 2 successful matches after that it keeps the valu

AW: More Perl and AJAX

2007-08-29 Thread Angerstein
Ihhhkk @values = @_; Or you got the number of elements. -Ursprüngliche Nachricht- Von: Mathew Snyder [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 29. August 2007 13:32 An: Perl Beginners Betreff: More Perl and AJAX When passing a value from JavaScript to a Perl script, am I right

RE: More Perl and AJAX

2007-08-29 Thread Andrew Curry
Yeah that's fine to use. If you use CGI.pm You can use param('') i.e. if (! param) { # # do something # } elsi

Problem in comparing two files using compare.pm

2007-08-29 Thread [EMAIL PROTECTED]
Hi, Please find below my code to compare 2 files "source.txt,destination.txt" in folder "seek" #!perl use File::Compare; if(Compare("source.txt","destination.txt")==0) { print "They're equal\n"; } Please find below the error I am getting while running the code in co

how to modify a variable stored in a hash value

2007-08-29 Thread phil
Ok so here's the deal...I have the following: $var = 123; GetOptions( 'v|var=n' => \$var); %xyz = ( type1 => { ABC => "after zero comes $var", }, type2 => {...etc.}, ); get_var() if $condition; sub get_var { $var = `external gui app to get

Re: AW: More Perl and AJAX

2007-08-29 Thread Mathew Snyder
Ahh yes. Assigning an array to a scalar results in the scalar having the element count instead of actual elements. Thanks. Keep up with me and what I'm up to: http://theillien.blogspot.com Angerstein wrote: > Ihhhkk > @values = @_; > > Or you got the number of elements. > > -Ursprüngl

Re: how to modify a variable stored in a hash value

2007-08-29 Thread Paul Lalli
On Aug 28, 11:16 pm, [EMAIL PROTECTED] (Phil) wrote: > Ok so here's the deal...I have the following: > > $var = 123; > > GetOptions( 'v|var=n' => \$var); > > %xyz = ( > type1 => { ABC => "after zero comes $var", }, > type2 => {...etc.}, > ); > > get_va

Re: conflicting errors

2007-08-29 Thread Paul Lalli
On Aug 29, 2:52 am, [EMAIL PROTECTED] (John W. Krahn) wrote: > >return undef; > > You normally don't need to return undef, perl will do the right thing and > correctly distinguish between list and scalar context. I'd go one level more - it's not just unnecessary, it's generally wrong.

Re: Problem in comparing two files using compare.pm

2007-08-29 Thread Stephen Kratzer
On Wednesday 29 August 2007 00:43:52 [EMAIL PROTECTED] wrote: > Hi, > > Please find below my code to compare 2 files > "source.txt,destination.txt" in folder "seek" > > #!perl > > use File::Compare; > > if(Compare("source.txt","destination.txt")==0) > { > print "They're equal\n"; >

Re: How to erase PERL5LIB enviromental variable in Windows XP

2007-08-29 Thread Dr.Ruud
JAYO schreef: > When I star my computer with windows XP, and I isssue 'set' in a > command windows, PERL5LIB is set, even I don't have now the perl > package. > Now I want to install another package that says that PERL5LIB is set > and it needs not to be for having a clean installation. In the sys

Re: how to modify a variable stored in a hash value

2007-08-29 Thread Dr.Ruud
phil schreef: > Ok so here's the deal...I have the following: > $var = 123; > GetOptions( 'v|var=n' => \$var); > %xyz = ( > type1 => { ABC => "after zero comes $var", }, > [...] Maybe this will help: type1 => { ABC => ['after zero comes', \$var ] }, -- Affijn, Ruud

dereferencing hashes

2007-08-29 Thread Hunter Barrington
ok so im using HTML::TreeBuilder to pull some data off of a website and parse it. If I'm understanding this right each tag of the tree is put inside the tree as a hash reference with hash references inside of it for each tag thats below it. Like: = $root_hash_ref->$body_hash_ref->$p_hash_ref

Re: dereferencing hashes

2007-08-29 Thread Rob Dixon
Hunter Barrington wrote: ok so im using HTML::TreeBuilder to pull some data off of a website and parse it. If I'm understanding this right each tag of the tree is put inside the tree as a hash reference with hash references inside of it for each tag thats below it. Like: = $root_hash_ref->$body

Re: dereferencing hashes

2007-08-29 Thread Hunter Barrington
thnx for the reply. code @ http://barringtonweb.com/code.txt trying to pull data out of the td elements without iterating over them will look at html::element perldoc thanks a lot i think thats what i was missing, -Hunter Rob Dixo

Re: problem with simple pattern matching

2007-08-29 Thread Chas Owens
On 8/29/07, Jim <[EMAIL PROTECTED]> wrote: > Hi, > > I hope this is simple, as i am very new to perl. > > I am trying to use pattern matchinig to create many srcipts from > a template file which i have read into a list then print out to files. > > the problem is the patter match only matches on the

Re: store more values in a hash array

2007-08-29 Thread Kermit Tensmeyer_semipublic
On Aug 27, 2:36 am, [EMAIL PROTECTED] (Andreas Moroder) wrote: > Hello, > > I have to store more then one value in a hash array. I tried to store a > array as value in the hash. But when I try to retrieve it I don't get the > array I have stored. > > Can anyone please help me. $a{val1} = "a1";

Re: perl load of external librarie (unix/linux)

2007-08-29 Thread Tom Phoenix
On 8/28/07, Kermit Tensmeyer <[EMAIL PROTECTED]> wrote: > I can see > from the error that the required library did not get loaded. What did you do to try to load it? > How does it know where the library is located? I think you're looking for Perl's special @INC variable. See perlvar. Hope thi

Big unicode problem with Perl 5.8.8 with MySQL 5.0 (i.e. Debian 4.0)

2007-08-29 Thread Karjala
I just upgraded from Debian 3 (Perl 5.8.4 and MySQL 4.1) to Debian 4 (Perl 5.8.8 and MySQL 5.0 and DBD::mysql 3.0008) and have the following problem: In the following lines I create a table with a char field of length 4 and then try, using a perl script, to populate it with a string of 4 unic

Invalid cursor state on second $sth->execute

2007-08-29 Thread Ashley Cooper
I have written that a script that opens a cursor on a table in a DB2 database then processes each record in the result set inside a loop. In the course of the loop I prepare and execute another SQL statement to get a maximum value from the same table for a given condition. This worked fine. I t

Spliting the log files

2007-08-29 Thread sivasakthi
Hi All, I have used the following code to calculate from log files, #!/usr/bin/perl use strict; use warnings; use File::Tail; my $file=File::Tail->new("/log/path"); my $line= undef; while (defined($line=$file->read)) { my ($time,$lport,$ip,$stats,$rport) = split; print "$ip/n"; } The log fil

Re: Spliting the log files

2007-08-29 Thread John W. Krahn
sivasakthi wrote: Hi All, Hello, I have used the following code to calculate from log files, #!/usr/bin/perl use strict; use warnings; use File::Tail; my $file=File::Tail->new("/log/path"); my $line= undef; You don't really need file scope for $line. while (defined($line=$file->read))

Trouble with activestate perl for windows

2007-08-29 Thread Caduceus
Every time I try to use perl 5.8.8 I keep geting the error message "Barewood found where operator expected at - line 1, near "/perl/bin" " What am I doing wrong here and how can I fix it. I'm using activestate perl. The command I'm trying is C:/Perl/bin/perl5.8.8.exe perl -v. Any help would b

Re: Barewood found where operator expected?

2007-08-29 Thread mojorising
Thanks everyone! I have a much better understanding of what's going on now and am on my way. Feel pretty silly about the "barewood" thing. I need to keep my glasses on. :) I'm working on something else right now so I won't be able to try all this out for a bit but your comprehensive answers have d

Re: how to modify a variable stored in a hash value

2007-08-29 Thread phil
On Aug 29, 9:41 am, [EMAIL PROTECTED] (Paul Lalli) wrote: > On Aug 28, 11:16 pm, [EMAIL PROTECTED] (Phil) wrote: > > > > > Ok so here's the deal...I have the following: > > > $var = 123; > > > GetOptions( 'v|var=n' => \$var); > > > %xyz = ( > > type1 => { ABC => "after zero comes

Appending a character to a field

2007-08-29 Thread bokjasong
Hi, I'm a perl newbie and would like to ask this question here. Let's say I have the following code. Trying to check the disk space, it's to truncate the percent sign % from the df -k output, compare the percentage field to see if it's bigger than 90%, and grasp only those lines that are and p

Re: Trying to dynamically create arrays, getting can't use string as ARRAY ref

2007-08-29 Thread Justin The Cynical
Ok, I think I more or less have it. The true grocking of the hash, well, that I think will come in time with reading and experience. Thank you all for the help and pointers! Justin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.per

Unable to locate make

2007-08-29 Thread kilaru rajeev
Hi All, I got a problem while installing the module with *CPAN.pm* shell. At the begining, it was asked to for some confiuguration settings. It could able to find almost all settings except make. At first, I ignored that and moved to install the modules but it is saying like the make test failed.

Re: Appending a character to a field

2007-08-29 Thread Jeff Pang
Try to use this way, use strict; my $percent=90; my @df; open(DFOUT, "df -k|"); while () { next if /Filesystem/i; my ($free) = /(\d+)%/; if ( $free >= $percent ) { push(@df, $_); } } close DFOUT; print "@df"; 2007/8/30, [EMAIL PROTECTED] <[EMAIL PROT