Re: very new - need help with regular expressions

2005-04-12 Thread M. Kristall
John W. Krahn wrote: M. Kristall wrote: John W. Krahn wrote: As long as you realise that putting a space between the operator name and the left parenthesis may trigger a warning when warnings are enabled. (And you DO have warnings enabled, don't you?) $ perl -le'use warnings; print( 1,2,3,4,5 )

Re: very new - need help with regular expressions

2005-04-11 Thread John W. Krahn
M. Kristall wrote: John W. Krahn wrote: As long as you realise that putting a space between the operator name and the left parenthesis may trigger a warning when warnings are enabled. (And you DO have warnings enabled, don't you?) $ perl -le'use warnings; print( 1,2,3,4,5 )' 12345 $ perl -le'us

Re: very new - need help with regular expressions

2005-04-11 Thread M. Kristall
John W. Krahn wrote: M. Kristall wrote: John W. Krahn wrote: open INPUT, '<', 'record.txt' or die "Error, can't open 'record.txt' $!"; while ( ) { next unless /^\?/; print "$1\n" if /<([^>]+)>/; } close INPUT; We want some line numbers (and I like parens): As long as you realise th

Re: very new - need help with regular expressions

2005-04-11 Thread John W. Krahn
M. Kristall wrote: John W. Krahn wrote: open INPUT, '<', 'record.txt' or die "Error, can't open 'record.txt' $!"; while ( ) { next unless /^\?/; print "$1\n" if /<([^>]+)>/; } close INPUT; We want some line numbers (and I like parens): As long as you realise that putting a space betwee

Re: very new - need help with regular expressions

2005-04-11 Thread M. Kristall
John W. Krahn wrote: 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 ">" char

Re: very new - need help with regular expressions

2005-03-27 Thread Zeus Odin
"Brett Williams" <[EMAIL PROTECTED]> wrote in message ... > > 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. > > [sn

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- &

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

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: 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