Re: very new - need help with regular expressions

2005-03-26 Thread John W. Krahn
Brett Williams wrote: Hi :) Hello, I am still very new to perl (and programming) and am getting stuck with regular expressions. I have a text file in which I want to find, then print to screen all lines beginning with "?" and then print the text between the "<" and ">" characters. The code I hav

RE: very new - need help with regular expressions

2005-03-26 Thread Chris Heiland
> -Original Message- > From: Manav Mathur [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 26, 2005 5:33 AM > To: Brett Williams; beginners@perl.org > Subject: RE: very new - need help with regular expressions > > > > > |-Original Message- > |From: Brett Williams [mailto:[E

Re: Arguments in a program

2005-03-26 Thread Steven Schubiger
On 26 Mar, Carlos Mantero wrote: > However, today I need a program that accepts many > arguments but I've tryied to make for myself but it's impossible. Global arguments usually reside in @ARGV; parsing @ARGV "manually" is unnecessary and awkward in most cases. Instead, you may consider using Ge

RE: Arguments in a program

2005-03-26 Thread Moon, John
-Original Message- From: Carlos Mantero [mailto:[EMAIL PROTECTED] Sent: Saturday, March 26, 2005 12:53 PM To: Beginners Perl Subject: Arguments in a program Hi folks! I'm really new with perl, but I practice making little programs or scripts. However, today I need a program that accepts m

Arguments in a program

2005-03-26 Thread Carlos Mantero
Hi folks! I'm really new with perl, but I practice making little programs or scripts. However, today I need a program that accepts many arguments but I've tryied to make for myself but it's impossible, get a very large script :(. Thanks for all. P.D: Excuse for my poor english. -- To unsubscrib

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Dear Steven, Sorry, don't mean to nitpick. On Sat, 26 Mar 2005 23:09:26 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: On 26 Mar, Edward Wijaya wrote: It's fine, as it is. Typedefs most often reside in header files, although, they can be used in the main file without suffer. As per your sug

ending attributes in XML::Writer

2005-03-26 Thread Nuno Morgadinho
I'am using XML::Writer to create a XML file that is then read by another application. This other application is expecting a XML in the form of (with the slash in the starttag ending the attribute) but using XML::Writer I can't find a way to output this and my application fails. I know both and

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: > Sorry my C is barely Novice. > Where can I put this snippet in my C subroutine? It's fine, as it is. Typedefs most often reside in header files, although, they can be used in the main file without suffer. If you ever should get bored, read the Perl Sources. --

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
On Sat, 26 Mar 2005 22:31:52 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: typedef (malloc(2*sizeof(long double))) Big_Double; Big_Double var; Sorry my C is barely Novice. Where can I put this snippet in my C subroutine? like this: [snip code] __END__ __C__ typedef (malloc(2*sizeof(long do

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> printf("%i\n", sizeof(long double)); > > It gives: > 12 Fine, it was even 2 Bytes bigger than excepted. typedef (malloc(2*sizeof(long double))) Big_Double; Big_Double var; var should measure 24 bytes in size, which should suffice; if not, increment the factor

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
> On 26 Mar, Edward Wijaya wrote: >> Try "long double" instead, which gives you 10 Bytes and >> the format char %Lf. > Still wont' do. It still return 'inf' for N>500 Another solution would be, dynamically allocating memory: long double var; var = (long double *) malloc(2*sizeof(long double)

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> Try "long double" instead, which gives you 10 Bytes and >> the format char %Lf. > Still wont' do. It still return 'inf' for N>500 What does printf("%i\n", sizeof(long double)); tell you? The byte sizes of variable types can vary from platform to platform. --

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi Steven, On Sat, 26 Mar 2005 22:08:44 +0800, Steven Schubiger <[EMAIL PROTECTED]> wrote: Try "long double" instead, which gives you 10 Bytes and the format char %Lf. Still wont' do. It still return 'inf' for N>500 -- Edward WIJAYA Singapore -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Steven Schubiger
On 26 Mar, Edward Wijaya wrote: >> Change every occurence of the word "float" , in your script, >> to "double". > > It worked, but still limited. It overflowed when N>500. > Most of the value of N, I use are around 1000-2000. > > Any other possibility? Try "long double" instead, which gives you

Re: How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi Zentara, Thanks for the reply. On Sat, 26 Mar 2005 21:35:17 +0800, zentara <[EMAIL PROTECTED]> wrote: Change every occurence of the word "float" , in your script, to "double". It worked, but still limited. It overflowed when N>500. Most of the value of N, I use are around 1000-2000. Any other p

RE: very new - need help with regular expressions

2005-03-26 Thread Manav Mathur
|-Original Message- |From: Brett Williams [mailto:[EMAIL PROTECTED] |Sent: Saturday, March 26, 2005 3:01 PM |To: beginners@perl.org |Subject: re: very new - need help with regular expressions | | |Thank you Manav :) | |That was a big help. I now have another problem however. I had assume

Re: very new - need help with regular expressions

2005-03-26 Thread Steven Schubiger
> chomp($line); It's superfluous in this peculiar case, by the way. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: very new - need help with regular expressions

2005-03-26 Thread Steven Schubiger
On 26 Mar, Brett Williams wrote: > What i would like is for the output to look like > > 1: 1002.00 > 2: 125.00 > 3: 61864.35 > 4: 890876.99 > 5: 9.99 > > but perl doesn't like my code. #! /usr/bin/perl use strict; use warnings; my $lnum = 1; while (my $line = ) { next unless $line =~ /\d+

Re: Beginner question

2005-03-26 Thread David Kirol
Kyle Lampe wrote: Hello! Hi I've got a quick perl question for you. I'm writing a script that compares two xml files, ignoring one certain tag. The problem I have is I want to get the output from two files simultaneously. What I'm trying is: while ( $lineFile1 = && $lineFile2 = ) { try: while (

calendar

2005-03-26 Thread Octavian Rasnita
Hi, Can you recommend a good module for creating calendars with links for each day in html format? I have searched with CPAN after "calendar" and I found more modules, but I don't know which one would be the best. Have you used one that's good? Thanks. Teddy -- To unsubscribe, e-mail: [EMAI

Beginner question

2005-03-26 Thread Kyle Lampe
Hello! I've got a quick perl question for you. I'm writing a script that compares two xml files, ignoring one certain tag. The problem I have is I want to get the output from two files simultaneously. What I'm trying is: while ( $lineFile1 = && $lineFile2 = ) { if ( $lineFile1 =~ /$IGNOR

re: very new - need help with regular expressions

2005-03-26 Thread Brett Williams
Thank you Manav :) That was a big help. I now have another problem however. I had assumed that adding a line number preceding the prices would be a trivial matter, however what i thought would work is not doing so. Here is the code ive tried. (open(INPUT, "record.txt")) or die("Error, can't find

How can I get Inline::C to deal with big number?

2005-03-26 Thread Edward Wijaya
Hi, I have the following code that uses Inline::C to compute factorial. The problem is that whenever I use large N (>30) it began to return "INF". I thougtht my C implementation already cater large number by using "float"? Additionally I have already added Math::Pari as an attempt to solve the prob

very new - need help with regular expressions

2005-03-26 Thread Brett Williams
Hi :) I am still very new to perl (and programming) and am getting stuck with regular expressions. I have a text file in which I want to find, then print to screen all lines beginning with "?" and then print the text between the "<" and ">" characters. The code I have tried (amongst many varia