Re: how can I |more output.

2004-08-26 Thread Ramprasad A Padmanabhan
On Thu, 2004-08-26 at 12:28, Etienne Ledoux wrote: > Greetings, > > I have a program that does a search on a db and prints the output to the > screen. If there is a lot of output how can I a stop/continue displaying it. > like 'ls -l |more' would do. or anything |more for that matter. > > tx >

Re: how can I |more output.

2004-08-26 Thread Etienne Ledoux
On Thursday 26 August 2004 09:20, Ramprasad A Padmanabhan wrote: > On Thu, 2004-08-26 at 12:28, Etienne Ledoux wrote: > > Greetings, > > > > I have a program that does a search on a db and prints the output to the > > screen. If there is a lot of output how can I a stop/continue displaying > > it.

Re: how can I |more output.

2004-08-26 Thread Etienne Ledoux
ok. Here is the output I'm trying to '|more' while (@ref = $sth->fetchrow_array()) { print "Username: $ref[0], Password: $ref[1]\n"; } I tried putting |more at various positions where I thought it might work. But it doesn't work as expected. On Thursday 26 August

Re: how can I |more output.

2004-08-26 Thread Edward Wijaya
I guess you should use the "|more" command in the command prompt not inside the perl code itself. perl code.pl |more On Thu, 26 Aug 2004 09:36:38 +0200, Etienne Ledoux <[EMAIL PROTECTED]> wrote: ok. Here is the output I'm trying to '|more' while (@ref = $sth->fetchrow_array()) {

Re: how can I |more output.

2004-08-26 Thread Etienne Ledoux
My program starts with a menu with options. That being one of the options to choose from. Once it is done it returns to the main menu again so you can run other options again. I would like to be able to do this within my program somehow if possible. If not, I guess I could run it with |more from

Re: how can I |more output.

2004-08-26 Thread Ramprasad A Padmanabhan
On Thu, 2004-08-26 at 13:26, Etienne Ledoux wrote: > My program starts with a menu with options. That being one of the options to > choose from. Once it is done it returns to the main menu again so you can run > other options again. I would like to be able to do this within my program > somehow

Re: get last record in a file

2004-08-26 Thread Jeremy Kister
On Wednesday, August 25, 2004 11:56 PM, balaji venkat wrote: > The following code will do the required task. > > #! /usr/bin/perl > > open (FILE,"test789.pl"); > @array1 = ; > $last = pop(@array1); > print $last; No, I don't think you read the requirement correctly. Either solution from myself

Re: how can I |more output.

2004-08-26 Thread John W. Krahn
Etienne Ledoux wrote: Greetings, Hello, I have a program that does a search on a db and prints the output to the screen. If there is a lot of output how can I a stop/continue displaying it. like 'ls -l |more' would do. or anything |more for that matter. perlopentut has an example using less inste

Reegexp removing everything except...

2004-08-26 Thread juman
I have som strings that I want to clean up. They can contain digits, some special characters (white space etc) and a comma and all I want to keep is the digits and the comma? Any idea how I could do this? /juman -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Reegexp removing everything except...

2004-08-26 Thread Gavin Henry
juman said: > I have som strings that I want to clean up. They can contain digits, > some special characters (white space etc) and a comma and all I want to > keep is the digits and the comma? Any idea how I could do this? > >From Learning Perl Chp9: "9.6.1. Global Replacements with /g As you ma

Re: Reegexp removing everything except...

2004-08-26 Thread Paul Johnson
On Thu, Aug 26, 2004 at 12:06:57PM +0200, juman wrote: > I have som strings that I want to clean up. They can contain digits, > some special characters (white space etc) and a comma and all I want to > keep is the digits and the comma? Any idea how I could do this? What have you tried? y/0-9,/

Re: Reegexp removing everything except...

2004-08-26 Thread Gunnar Hjalmarsson
Juman wrote: I have som strings that I want to clean up. They can contain digits, some special characters (white space etc) and a comma and all I want to keep is the digits and the comma? Any idea how I could do this? Use the s/// operator (explained in "perldoc perlop"). The PATTERN may consist of

Setting special variable $/ to a regular expression

2004-08-26 Thread Denham Eva
Hello Perl Gurus, Is there some way to set the special variable $/ to a regular expression such as (.+?):(\d+):(.*) I have tried: local $/ =~ m/(.+?):(\d+):(.*)/; # But cannot change $/; local $/= /(.+?):(\d+):(.*)/; # Use of uninitialized value in pattern match m//. I am trying to p

Re: Reegexp removing everything except...

2004-08-26 Thread juman
Thanks this solved it all and I learned a new Perl-thingy ;) /juman On Thu, Aug 26, 2004 at 12:22:04PM +0200, Paul Johnson wrote: > On Thu, Aug 26, 2004 at 12:06:57PM +0200, juman wrote: > > > I have som strings that I want to clean up. They can contain digits, > > some special characters (white

Re: Setting special variable $/ to a regular expression

2004-08-26 Thread Paul Johnson
On Thu, Aug 26, 2004 at 12:35:25PM +0200, Denham Eva wrote: > Is there some way to set the special variable $/ to a regular expression > such as (.+?):(\d+):(.*) >From perlvar: Remember: the value of "$/" is a string, not a regex. awk has to be better for something. :-) I await the reply

Japanese database Issues

2004-08-26 Thread Sidharth
Hi all. I am having issues with extracting the Japanese data from a sql server with a cgi-perl script , I have a sql 2000 server which does handel japanese characters, the silly part is that i have iis5.something based on win 2k english, but i could use asp to extract the japanese characterset by s

Re: how can I |more output.

2004-08-26 Thread Chris Devers
On Thu, 26 Aug 2004, Etienne Ledoux wrote: Here is the output I'm trying to '|more' while (@ref = $sth->fetchrow_array()) { print "Username: $ref[0], Password: $ref[1]\n"; } I tried putting |more at various positions where I thought it might work. But it doesn't work as

RE: POD on new module to make sure it looks right before uploading to CPAN

2004-08-26 Thread christopher . l . hood
Ok well sorry about that I must have missed your earlier post. Good luck on the other module, it looked simpler to me. Chris Hood Investigator Verizon Global Security Operations Center Email: [EMAIL PROTECTED] Desk: 972.399.5900 Verizon Proprietary NOTICE - This message and any atta

RE: Help With OLE

2004-08-26 Thread DiGregorio, Dave
So that gives me the ASCII Value. But I am looking for the 1-for-1 value. A = 1 B = 2 C = 3 AA = 27 AB = 28 As the columns in Excel is are labeled So I have a Value at max row AN which is 40 Columns in the Excel Worksheet. Using the below method gives me decimal value 104 which is 'H' and I

Re: get last record in a file

2004-08-26 Thread Zeus Odin
The following solution isn't as short as the other solutions, but it will allow you to maintain the order of the original file: #!/usr/bin/perl use warnings; use strict; my($last, $last_rec); while () { my @data = split; if ($last and $data[0] != $last) { print $last_rec; } elsif (eof)

Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-26 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: Ok well sorry about that I must have missed your earlier post. Good luck on the other module, it looked simpler to me. Thanks, if I run into problems I'll be posting back :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: how can I |more output.

2004-08-26 Thread Bob Showalter
Etienne Ledoux wrote: > Greetings, > > I have a program that does a search on a db and prints the output to > the screen. If there is a lot of output how can I a stop/continue > displaying it. like 'ls -l |more' would do. or anything |more for > that matter. Read perldoc perlopentut and search f

Re: Help With OLE

2004-08-26 Thread Colm Gallagher
I'll bet there is a clever perl (ie 6 characters) way to do this, but I've done it like this... sub toLetter { my $leftLetter = int($_[0]/26); my $rightLetter = ($_[0] % 26) + 64; if ($leftLetter>0) { $leftLetter += 64; return chr($leftLette

RE: Help With OLE

2004-08-26 Thread Bob Showalter
DiGregorio, Dave wrote: > So that gives me the ASCII Value. But I am looking for the 1-for-1 > value. A = 1 > B = 2 > C = 3 > > AA = 27 > AB = 28 > > As the columns in Excel is are labeled > > So I have a Value at max row AN which is 40 Columns in the Excel > Worksheet. Using the below meth

Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-26 Thread Jenda Krynicky
From: "JupiterHost.Net" <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > From: "JupiterHost.Net" <[EMAIL PROTECTED]> > > > >>Is there an easy way to view the POD from a local module in a > >>browser to see what it will look like in CPAN? > > > > > > I would generate the HTML file by the pod2html

RE: [PBML] Setting special variable $/ to a regular expression

2004-08-26 Thread Madani, Srikanth, VF-DE
Our fellow list member Denham wrote: >Is there some way to set the special variable $/ to a regular expression >such as (.+?):(\d+):(.*) Well, man perlvar says: perlvar> Remember: the value of $/ is a string, not a regexp. perlvar> AWK has to be better for something :-) >I am trying to process

Re: utility to install modules

2004-08-26 Thread Joe Echavarria
Hi there, I am getting this error while trying to configure MCPAN, the error is as follow : Trying with "/usr/sfw/bin/ncftpget" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY ftp.perl.org: unknown host. ncftpget: cannot open ftp.perl.org: unknown host. Trying with "/usr/sfw/bin/ncftpget"

Problem configuring MCPAN

2004-08-26 Thread Joe Echavarria
Hello, When i try to configure the MCPAN i get this error..: rying with "/usr/sfw/bin/ncftpget" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz ftp.perl.org: unknown host. ncftpget: cannot open ftp.perl.org: unknown host. Trying with "/usr/sfw/bin/wget -O -" to get ftp://ftp.perl.or

Newbie needs help changing date format

2004-08-26 Thread John Bruin
Hi I have a list of dates that have been converted to epoch seconds, processed and then converted back to a string (using timelocal). The resulting date format is:- "Wed Mar 16 22:10:16 2004" What is the easiest way to convert this format (or epoch seconds) to "16-Mar-2004 22:10" - preferrably u

Re: POD on new module to make sure it looks right before uploading to CPAN

2004-08-26 Thread JupiterHost.Net
Jenda Krynicky wrote: From: "JupiterHost.Net" <[EMAIL PROTECTED]> Jenda Krynicky wrote: From: "JupiterHost.Net" <[EMAIL PROTECTED]> Is there an easy way to view the POD from a local module in a browser to see what it will look like in CPAN? I would generate the HTML file by the pod2html script and

Re: Newbie needs help changing date format

2004-08-26 Thread Wiggins d Anconia
> Hi > > I have a list of dates that have been converted to epoch seconds, processed > and then converted back to a string (using timelocal). The resulting date > format is:- > > "Wed Mar 16 22:10:16 2004" > > What is the easiest way to convert this format (or epoch seconds) to > "16-Mar-2004 22

Re: Problem configuring MCPAN

2004-08-26 Thread Owen
On Thu, 26 Aug 2004 09:45:57 -0700 (PDT) Joe Echavarria <[EMAIL PROTECTED]> wrote: >When i try to configure the MCPAN i get this > error..: > Connecting to ftp.perl.org:21... > ftp.perl.org: Host not found > Issuing "/usr/bin/ftp -n" > ftp.perl.org: unknown host or invalid literal address >

Re: Newbie needs help changing date format

2004-08-26 Thread Gunnar Hjalmarsson
John Bruin wrote: I have a list of dates that have been converted to epoch seconds, processed and then converted back to a string (using timelocal). The resulting date format is:- "Wed Mar 16 22:10:16 2004" What is the easiest way to convert this format (or epoch seconds) to "16-Mar-2004 22:10" - T

return codes

2004-08-26 Thread DBSMITH
All, I have a foreach statement that is going through a file and looking for all line w/out *Orig and what I want to do is if its return code was 0 then print out a short message, but I do not want to print out this short message more than n +1 times. Any ideas? Here is my code: foreach (s

RE: return codes

2004-08-26 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : All, : : I have a foreach statement that is going through a file and : looking for all line w/out *Orig and what I want to do is if : its return code was 0 then print out a short message, but I do : not want to print out this short message more than

Re: Problem configuring MCPAN

2004-08-26 Thread Joe Echavarria
yes i know what it means.., what ftp site of cpan i can use ? Thanks. --- Owen <[EMAIL PROTECTED]> wrote: > On Thu, 26 Aug 2004 09:45:57 -0700 (PDT) > Joe Echavarria <[EMAIL PROTECTED]> wrote: > > >When i try to configure the MCPAN i get this > > error..: > > > Connecting to ftp.perl.org:

RE: Newbie needs help changing date format

2004-08-26 Thread John Bruin
Hi Wiggins and Gunnar Thanks for your help. I come from an excel vba background where date formatting is a simpler process. This is what I used: $date_next_string = strftime("%d-%b-%Y %H:%M", localtime($date_next)); From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] Sent: Friday, 27 August 200

Re: utility to install modules

2004-08-26 Thread Chris Devers
On Thu, 26 Aug 2004, Joe Echavarria wrote: I am getting this error while trying to configure MCPAN, the error is as follow : Sorry for the confusion, it's not "MCPAN". Rather, "-M" is a command line argument for perl that says to use the "m"odule you're about to name. In this case, it's equivale

Re: utility to install modules

2004-08-26 Thread Randy W. Sims
On 8/26/2004 11:39 PM, Chris Devers wrote: On Thu, 26 Aug 2004, Joe Echavarria wrote: Trying with "/usr/sfw/bin/ncftpget" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY ftp.perl.org: unknown host. ncftpget: cannot open ftp.perl.org: unknown host. Can you ping this host? Can you FTP to it? It s

Elegant sequencing

2004-08-26 Thread Bryan Harris
One of my favorite things about perl is that long and tedious solutions can often be replaced by incredibly elegant and concise ones. I'm writing a sequence generator. I've got most of it handled, but this part bugs me. I want it to take the variable $field containing, e.g.: 4.3:8.3 And turn