Re: Hash values as array indexes inside Arrays

2008-02-16 Thread Paul Lalli
On Feb 16, 9:35 am, [EMAIL PROTECTED] (Dr.Ruud) wrote: > [EMAIL PROTECTED] schreef: > > > The following code won't load up the array with the hashes like it > > does by explicitly putting them in. > > > [EMAIL PROTECTED] = qw \ 56 56 33 67 22 11 88 94 452 334 67 65 2 3 3 3 \; > > Because of the bac

Re: Printing text between two blank lines

2008-02-16 Thread Gunnar Hjalmarsson
Dr.Ruud wrote: Gunnar Hjalmarsson schreef: [EMAIL PROTECTED]: I have data in a text file where the important thing I want to extract is between two blank lines. Assuming the data has been slurped into $_ : print "$1\n" while /\n\n(.+)(?=\n\n)/g; Or /\n[[:blank:]]*\n(.+)\n[[:blank:]]*\

Re: Excel Type Sorting ???

2008-02-16 Thread Chas. Owens
On Feb 15, 2008 4:36 PM, <[EMAIL PROTECTED]> wrote: > I'm trying to figure out how to do an Excel type sort in Perl but > can't seem to find anything on specifically what I want to do. So here > goes. > > Imagine 3 columns of numbers: A, B, C. > > I want to sort in descending order starting with C

Re: Excel Type Sorting ???

2008-02-16 Thread Tom Phoenix
On Feb 15, 2008 1:36 PM, <[EMAIL PROTECTED]> wrote: > I'm trying to figure out how to do an Excel type sort in Perl but > can't seem to find anything on specifically what I want to do. So here > goes. I think you want to sort on multiple criteria, with nothing "Excel" about it. > Imagine 3 colu

Re: Printing text between two blank lines

2008-02-16 Thread Dr.Ruud
Gunnar Hjalmarsson schreef: > [EMAIL PROTECTED]: >> I have data in a text >> file where the important thing I want to extract is >> between two blank lines. > > Assuming the data has been slurped into $_ : > > print "$1\n" while /\n\n(.+)(?=\n\n)/g; Or /\n[[:blank:]]*\n(.+)\n[[:blank:]]*\

Re: Hash values as array indexes inside Arrays

2008-02-16 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > The following code won't load up the array with the hashes like it > does by explicitly putting them in. > > @crcerrs = qw \ 56 56 33 67 22 11 88 94 452 334 67 65 2 3 3 3 \; Because of the backslash? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-

Re: OOP in Perl

2008-02-16 Thread Randal L. Schwartz
> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes: "Jeff> but the second one is recommended, it looks more like the OO way. It's more than just recommended. The indirect object form is actively discouraged, because we've been finding more and more examples where the inherent imbiguity in i

Re: Hash values as array indexes inside Arrays

2008-02-16 Thread J. Peng
On Feb 16, 2008 1:57 PM, <[EMAIL PROTECTED]> wrote: > @data = ( > { crc => $crcerrs[$i], overrun => $overrunerrs[$i], inputerrs => > $inputerrs[$i] } ); > }; This overide the array each time. You need a 'push' at each loop: push @data, { }; good luck. -- To unsubscribe, e-mail: [E

Hash values as array indexes inside Arrays

2008-02-16 Thread ezsuperkev
I"m trying to find a way to convert this into where I can use array indexes as the values but it doesn't seem to work. my @data = ( { crc => 56, overrun => 1, inputerr => 45 }, { crc => 56, overrun => 7, inputerr => 4 }, { crc => 33, overrun => 7, inputerr => 4 } ) The following code w

Re: OOP in Perl

2008-02-16 Thread Jeff Pang
On Feb 15, 2008 11:56 PM, howa <[EMAIL PROTECTED]> wrote: > Hi, > > Currently I have seen two way to create objects in Perl: > > 1. my $a = new Apple... > 2. my $a = Apple->new(); > > What are the differences, and which one is recommended? > Both are fine: $ perl -le 'package A;sub new{print shif

Re: Printing text between two blank lines

2008-02-16 Thread Gunnar Hjalmarsson
[EMAIL PROTECTED] wrote: I've been trying to use regular expressions or some kind of counter thing, but I can't seem to work this right. I have data in a text file where the important thing I want to extract is between two blank lines. That's the only systematic way to find the useful lines. So,

Re: Printing text between two blank lines

2008-02-16 Thread Paul Johnson
On Fri, Feb 15, 2008 at 01:04:24PM -0800, [EMAIL PROTECTED] wrote: > I've been trying to use regular expressions or some kind of counter > thing, but I can't seem to work this right. I have data in a text file > where the important thing I want to extract is between two blank > lines. That's the o

Excel Type Sorting ???

2008-02-16 Thread ezsuperkev
I'm trying to figure out how to do an Excel type sort in Perl but can't seem to find anything on specifically what I want to do. So here goes. Imagine 3 columns of numbers: A, B, C. I want to sort in descending order starting with Column A then Column B, and then Column C. Thing is I don't want

Printing text between two blank lines

2008-02-16 Thread PlagueMagazine
I've been trying to use regular expressions or some kind of counter thing, but I can't seem to work this right. I have data in a text file where the important thing I want to extract is between two blank lines. That's the only systematic way to find the useful lines. So, it'll go "blank line, impo

OOP in Perl

2008-02-16 Thread howa
Hi, Currently I have seen two way to create objects in Perl: 1. my $a = new Apple... 2. my $a = Apple->new(); What are the differences, and which one is recommended? Thanks. Howard. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.