Re: Question regarding Perl on RH9

2004-03-11 Thread Randy W. Sims
On 3/12/2004 4:48 AM, fcp wrote: On Thu, 2004-03-11 at 23:37, Randy W. Sims wrote: On 3/11/2004 5:41 PM, fcp wrote: Not really a perl programmer but have used the perl utility "mirror" for a good number of years now. The problem I have is that mirror worked on RH8 but does not on RH9. Both releas

Re: Reading text file in reverse order

2004-03-11 Thread Randy W. Sims
On 3/11/2004 11:05 PM, Mame Mbodji wrote: This is a hwk, but I never asked for a complete answer. I just needed guidance because I was lost. Thank you anyway. Did you understand the hint I gave earlier? Your code while(my @line = ) { foreach my $lin(@line){ my @lines = $lin; print reve

Re: help with a regex and greediness

2004-03-11 Thread Stuart White
Oops, it just looked like you were testing a literal. My mistake, I'll check it out. --- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: > On 3/11/2004 10:28 PM, Stuart White wrote: > > > --- "Randy W. Sims" <[EMAIL PROTECTED]> > > wrote: > > > >>On 3/11/2004 9:01 PM, Stuart White wrote: > >> > >>

Re: Reading text file in reverse order

2004-03-11 Thread Mame Mbodji
This is a hwk, but I never asked for a complete answer. I just needed guidance because I was lost. Thank you anyway. Randy W. Sims wrote: Doh! I hope it wasn't his assignment! As a newbie myself it took me about 10 minutes to do that. That's ok. Your solution is the wrong solution ;-) -

Re: Reading text file in reverse order

2004-03-11 Thread Randy W. Sims
Doh! I hope it wasn't his assignment! As a newbie myself it took me about 10 minutes to do that. That's ok. Your solution is the wrong solution ;-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Reading text file in reverse order

2004-03-11 Thread Robert
Randy W. Sims wrote: On 3/11/2004 10:01 PM, [EMAIL PROTECTED] wrote: Sorry, no answers. This sounds like a school assignemnt. But I'll offer a few hints ;-) I have a text file with 5 or more lines as in: My name is this and that I live in Denver Colorado I live in washington I live in Denver V

Re: Reading text file in reverse order

2004-03-11 Thread Robert
[EMAIL PROTECTED] wrote: I have a text file with 5 or more lines as in: My name is this and that I live in Denver Colorado I live in washington I live in Denver Virginia I am trying to read this file and print each line and each word in reverse order as in: ainigriv revned ni evil I (the output s

Re: help with a regex and greediness

2004-03-11 Thread Randy W. Sims
On 3/11/2004 10:28 PM, Stuart White wrote: --- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: On 3/11/2004 9:01 PM, Stuart White wrote: I'm confused about greediness. This is the line that I'm trying to match: Spurs 94, Suns 82 If the line is as above, I probably wouldn't use a regex. The following

Re: help with a regex and greediness

2004-03-11 Thread Stuart White
--- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: > On 3/11/2004 9:01 PM, Stuart White wrote: > > > I'm confused about greediness. > > This is the line that I'm trying to match: > > > > Spurs 94, Suns 82 > > If the line is as above, I probably wouldn't use a > regex. The following > is more verbo

Re: Reading text file in reverse order

2004-03-11 Thread Randy W. Sims
On 3/11/2004 10:01 PM, [EMAIL PROTECTED] wrote: Sorry, no answers. This sounds like a school assignemnt. But I'll offer a few hints ;-) I have a text file with 5 or more lines as in: My name is this and that I live in Denver Colorado I live in washington I live in Denver Virginia I am trying to

Reading text file in reverse order

2004-03-11 Thread Mercedissa1
I have a text file with 5 or more lines as in: My name is this and that I live in Denver Colorado I live in washington I live in Denver Virginia I am trying to read this file and print each line and each word in reverse order as in: ainigriv revned ni evil I (the output starts with the last las

Re: help with a regex and greediness

2004-03-11 Thread Randy W. Sims
On 3/11/2004 9:01 PM, Stuart White wrote: I'm confused about greediness. This is the line that I'm trying to match: Spurs 94, Suns 82 If the line is as above, I probably wouldn't use a regex. The following is more verbose, but easier to manage IMHO. #!/usr/bin/perl use strict; use warnings; my

Re: STATing large files

2004-03-11 Thread drieux
On Mar 11, 2004, at 3:41 PM, Phil Schaechter wrote: Folks, Does anyone know of a workaround for stat'ing large files on perl < 5.6.1 ? For large files, stat and print -M both return nothing. We cannot install any modules, or upgrade/recompile perl. The problem is that you will need to build yo

help with a regex and greediness

2004-03-11 Thread Stuart White
I'm confused about greediness. This is the line that I'm trying to match: Spurs 94, Suns 82 This is my regex: if ($_ =~/(Spurs|Suns|Mavericks|Lakers|Clippers|Cavaliers|Celtics|Pacers|Pistons|Wizards|Warriors|Bulls|Hawks|Raptors|Magic|Heat|Kings|Rockets|Nuggets|Grizzlies|Jazz|Knicks|Nets|Supersoni

perl -d / apache server debug

2004-03-11 Thread Mike Ni
Hey everyone, Working on my first perl project:: I have at least 25 perl files written by a person who isn't here anymore. All these perl script files were programmed to serve the inquiry from the Internet via the web server. For me to understand the logic behind all these perl files, I wan

Re: Improving performance when working with large text files

2004-03-11 Thread James Edward Gray II
On Mar 11, 2004, at 10:41 AM, Price, Jason wrote: I'm trying to optimize a script used for processing large text log files (around 45MB). I think I've got all the processing fairly well optimized, but I'm wondering if there's anything I can do to speed up the initial loading of the file. Curre

Re: Question regarding Perl on RH9

2004-03-11 Thread Randy W. Sims
On 3/11/2004 5:41 PM, fcp wrote: Not really a perl programmer but have used the perl utility "mirror" for a good number of years now. The problem I have is that mirror worked on RH8 but does not on RH9. Both releases have perl v5.8.0. On RH9 mirror stops with: [EMAIL PROTECTED] mirror]# ./mirror -d

RE: Read from tape device

2004-03-11 Thread David le Blanc
> -Original Message- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 10 March 2004 5:37 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: Read from tape device > > [EMAIL PROTECTED] wrote: > > > Hi All, > > > > I am trying to read some data from af u

Re: Return value from system command.

2004-03-11 Thread Silky Manwani
Bingo! Got it... Thanks John and David. :) On Mar 11, 2004, at 4:38 PM, John W. Krahn wrote: Silky Manwani wrote: Hello, Hello, Back with the system command but with a different problem. I am calling a program with the system command which has arguments. This program returns a string and I nee

Re: Return value from system command.

2004-03-11 Thread John W. Krahn
Silky Manwani wrote: > > Hello, Hello, > Back with the system command but with a different problem. > > I am calling a program with the system command which has arguments. > This program returns a string and I need to capture it. > > @args("command","arg1","arg2"); > $res = system(@args); > >

RE: Return value from system command.

2004-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Silky Manwani wrote: > Hello, > > Back with the system command but with a different problem. > > I am calling a program with the system command which has arguments. > This program returns a string and I need to capture it. > > @args("command","arg1","arg2"); > $res = system(@args); > > print $r

Re: not getting the syntax

2004-03-11 Thread John W. Krahn
Charlotte Hee wrote: > > Hello, Hello, > I'm looking at the perl cookbook example on how to create a record data > type: > > $record = { > NAME => "Jason", > EMPNO => 132, > TITLE => "deputy peon", > AGE=> 23, > SALARY => 37_000, > PALS => [ "Norbert", "Rhys"

Return value from system command.

2004-03-11 Thread Silky Manwani
Hello, Back with the system command but with a different problem. I am calling a program with the system command which has arguments. This program returns a string and I need to capture it. @args("command","arg1","arg2"); $res = system(@args); print $res; It prints 0; But before that it print

not getting the syntax

2004-03-11 Thread Charlotte Hee
Hello, I'm looking at the perl cookbook example on how to create a record data type: $record = { NAME => "Jason", EMPNO => 132, TITLE => "deputy peon", AGE=> 23, SALARY => 37_000, PALS => [ "Norbert", "Rhys", "Phineas"], }; # store record $byname{ $record->{

STATing large files

2004-03-11 Thread Phil Schaechter
Folks, Does anyone know of a workaround for stat'ing large files on perl < 5.6.1 ? For large files, stat and print -M both return nothing. We cannot install any modules, or upgrade/recompile perl. Thanks, Phil -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAI

Re: split function - from

2004-03-11 Thread John W. Krahn
"John W. Krahn" wrote: > > A more perl-ish way to write that: > > while ( ) { Oops, forgot to chomp. chomp; > next if /^\s*(?:#|$)/; #if line begins with a # or line is blank > print MESS if /\w/; > print { /[A-Za-z]/ ? *TIDY : *MESS } $_; > > # split the string into

Re: split function - from

2004-03-11 Thread John W. Krahn
Stephen Kelly wrote: > > hi there Hello, > i'm trying to split a string from a line of text in a file - the split > delimiter is a tab character '\t' - i then need to compare the 2 bits on > either side of the tab to see if they are equal - if not eq - i write to > tidy else i write to mess > >

Re: Replace a string in a text file

2004-03-11 Thread Mr Mojo
Thank you to everyone for your help. I have learned a lot! Any your answers were WAY cooler than mine... Greg > perl -pi -e 's/fox/coyote' text_file_name_here.txt > > Is that cool enough? ;) > > James > -- __ Check out the latest SMS services @

RE: how to get the buffer size of a string

2004-03-11 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > length() Returns the length in characters. How do I translate that > to bytes? Read 'perldoc bytes' for an example of how to do this. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Question regarding Perl on RH9

2004-03-11 Thread u235sentinel
Perhaps you can post the code so we can look at it? Or even a link where we can get it. I'm not familiar with that tool. Thx > Not really a perl programmer but have used the perl utility "mirror" for > a good number of years now. The problem I have is that mirror worked on > RH8 but does not o

Re: how to get the buffer size of a string

2004-03-11 Thread Motherofperls
length() Returns the length in characters. How do I translate that to bytes?

Question regarding Perl on RH9

2004-03-11 Thread fcp
Not really a perl programmer but have used the perl utility "mirror" for a good number of years now. The problem I have is that mirror worked on RH8 but does not on RH9. Both releases have perl v5.8.0. On RH9 mirror stops with: [EMAIL PROTECTED] mirror]# ./mirror -d packages/all unknown input in "

RE: CMD Install Doesn't Work

2004-03-11 Thread Tim Johnson
You need to invoke PPM first. C:\> PPM PPM> install Win32-My-Module ... -Original Message- From: KENNETH JANUSZ [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 9:21 AM To: PERL Beginners Subject: CMD Install Doesn't Work I tried Start -> Run -> CMD This is what I got. In

RE: :Mechanize through a proxy?

2004-03-11 Thread Rajesh Dorairajan
Hi James, There should be no problem going by your code and assuming you've the environment variables setup as indicated. What are the contents of $a->content()? Are you getting a error code such as 501, 404? Also, you might want to verify the version of WWW::Mechanize that is installed in your sy

CMD Install Doesn't Work

2004-03-11 Thread KENNETH JANUSZ
I tried Start -> Run -> CMD This is what I got. Install is not recognized as a command. I also tried running COMMAND with the same results. Any idea what the problem is? Thanks, Ken -- At the top of the Command Prompt window it displays:

Re: how to get the buffer size of a string

2004-03-11 Thread Paul Johnson
[EMAIL PROTECTED] said: > Does perl have a function to get the buffer size of a string? length() perldoc -f length -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Browser-specific perl error (taint mode)

2004-03-11 Thread Erik Rieselbach
> "R. Joseph Newton" wrote: > >> Can anyone explain to me why I would get a perl error in one web browser but >> not in any others? > > This depends on on alot of factors, few of which you are sharing. Generally, > perl errors should not come through to the browser. I'm happy to share them, if yo

RE: can somebody tell me what this means

2004-03-11 Thread Thomas Bätzler
Hi, sam lehman <[EMAIL PROTECTED]> asked: > i got his code from a program i found, and i was wondering > that the ? and > the : are for? > > $target = (@digits % 2) ? ($digits[int(@digits/2)]) : > ([EMAIL PROTECTED]/2-1]); This is the so-called ternary operator. It's roughly equal to saying

Improving performance when working with large text files

2004-03-11 Thread Price, Jason
I'm trying to optimize a script used for processing large text log files (around 45MB). I think I've got all the processing fairly well optimized, but I'm wondering if there's anything I can do to speed up the initial loading of the file. Currently, I'm performing operations on the file one line

how to get the buffer size of a string

2004-03-11 Thread Motherofperls
Is there a function to get the buffer size?

WWW::Mechanize through a proxy?

2004-03-11 Thread Taylor James
Hi all, Has anyone here sucessfully used WWW::Mechanize through a proxy server? This always fails for me. On Win32. Cheers, James #! /usr/bin/perl use strict; use WWW::Mechanize; my $a = WWW::Mechanize->new(); my $url = 'http://www.

split function - from

2004-03-11 Thread stephen kelly
hi there i'm trying to split a string from a line of text in a file - the split delimiter is a tab character '\t' - i then need to compare the 2 bits on either side of the tab to see if they are equal - if not eq - i write to tidy else i write to mess ? confused - this bit of code is giving me em

RE: Some java some perl

2004-03-11 Thread Marcos . Rebelo
I did this question in here because I was aspecting that I was not the first crazy man doing something like this. I'm a perl programmer not a java programmer. I know that I'll have problems calling one from the other like this. Probabli the final release will be a Server/Client application to avo

Re: Browser-specific perl error (taint mode)

2004-03-11 Thread Erik Rieselbach
> WC -Sx- Jones wrote: > >> ³Insecure dependency in piped open while running with -T switch² at the line >> where I open a pipe to sendmail. > > This is what your server logs say or what is displayed in the browser > window? It is displayed in the browser window, thanks to CGI::Carp qw(fatalsToB

how to get the buffer size of a string

2004-03-11 Thread Motherofperls
Hi everyone, Does perl have a function to get the buffer size of a string? Thanks, Tricia

RE: Some java some perl

2004-03-11 Thread Guay Jean-Sébastien
Hello Joseph, >> String[] aStr = {"-e", "'print(\"Ola\n\") foreach (1..100);'"}; >> >> Process p = r.exec("perl", aStr); > > You told the system to open the perl compiler here. You may also have Offered > it 100 lines like this: > "Ola > ""Ola > Which Perl would have a ver

Re: Some java some perl

2004-03-11 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > I'm doing one interface in java that will call some perl scripts. I need to > catch the output and I don't know how to do it. > > If I execute the 'ls' command my java program finnish if I call the perl my > program don't finnish. What am I missing? What are you expecti

RE: Win32::OLE 7 Excel

2004-03-11 Thread Saadat Saeed
Hello, At the bottom is my is my entire code. Ofcourse all it does is get data out of a Lotus Notes server and dump it into excel. If you see the last lines I want to change the column width of a column in Excel. and that doesn't happen! Regards Saadat Saeed use strict; use Win32::OLE

Some java some perl

2004-03-11 Thread Marcos . Rebelo
I'm doing one interface in java that will call some perl scripts. I need to catch the output and I don't know how to do it. If I execute the 'ls' command my java program finnish if I call the perl my program don't finnish. What am I missing? import java.io.DataInputStream; import java.io.IOExcept

RE: Win32::OLE 7 Excel

2004-03-11 Thread Charles K. Clarkson
Saadat Saeed <[EMAIL PROTECTED]> wrote: : : Now it gives me an error :-( : : syntax error at mailrep.pl line 52, near ");" : Execution of mailrep.pl aborted due to compilation : errors. Please stop top-posting! If you post a little more code, we can show you how to properly use a while

Re: can somebody tell me what this means

2004-03-11 Thread Remo Sanges
Yes excuse my typo!!! Remo Sanges On Mar 11, 2004, at 11:37 AM, Ralf Schaa wrote: Remo Sanges wrote: $target = (@digits % 2) ? ($digits[int(@digits/2)]) : ([EMAIL PROTECTED]/2-1]); if ($target = (@digits % 2)) { ($digits[int(@digits/2)]); } else { ([EMAIL PROTECTED]/2-1]); } isn't it

Re: can somebody tell me what this means

2004-03-11 Thread John W. Krahn
Sam Lehman wrote: > > i got his code from a program i found, and i was wondering that the ? and > the : are for? > > $target = (@digits % 2) ? ($digits[int(@digits/2)]) : > ([EMAIL PROTECTED]/2-1]); Others have explained what ?: is but you could write that more simply as: my $target = $digits[

Re: can somebody tell me what this means

2004-03-11 Thread Ralf Schaa
Remo Sanges wrote: $target = (@digits % 2) ? ($digits[int(@digits/2)]) : ([EMAIL PROTECTED]/2-1]); if ($target = (@digits % 2)) { ($digits[int(@digits/2)]); } else { ([EMAIL PROTECTED]/2-1]); } isn't it like this? condition is (@digits % 2) : when the modulo is 1 then $target= ($digits

Re: can somebody tell me what this means

2004-03-11 Thread Remo Sanges
On Mar 11, 2004, at 6:07 AM, sam lehman wrote: i got his code from a program i found, and i was wondering that the ? and the : are for? It is a contracted form for 'if'... 'else' $target = (@digits % 2) ? ($digits[int(@digits/2)]) : ([EMAIL PROTECTED]/2-1]); if ($target = (@digits % 2)) {

Re: can somebody tell me what this means

2004-03-11 Thread Ralf Schaa
sam lehman wrote: i got his code from a program i found, and i was wondering that the ? and the : are for? $target = (@digits % 2) ? ($digits[int(@digits/2)]) : ([EMAIL PROTECTED]/2-1]); conditional statement (with lower priority than an 'if-construct' ?): if (@digits % 2) { $target = ($dig

can somebody tell me what this means

2004-03-11 Thread sam lehman
i got his code from a program i found, and i was wondering that the ? and the : are for? $target = (@digits % 2) ? ($digits[int(@digits/2)]) : ([EMAIL PROTECTED]/2-1]); -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad