Re: hash of arrays sorting

2012-08-22 Thread Salvador Fandino
On 08/22/2012 10:34 PM, Eduardo wrote: > On 22/08/12 03:49, Uri Guttman wrote: >> On 08/21/2012 08:29 PM, Eduardo wrote: >>> how would you do with Sort::Maker? >> i don't have time to show an example now but it is much cleaner >> looking. all you need to do is code up how you extract each key from

Re: extract blocks out and output into a series of files

2012-08-22 Thread lina
On Thursday 23,August,2012 12:46 AM, Jim Gibson wrote: > > On Aug 22, 2012, at 8:32 AM, lina wrote: > >> Hi, >> >> I have a data file, wish to split into 9 small files, each one starts >> >> >> 2:MODEL1 >> 1552:ENDMDL >> >> 1554:MODEL2 >> 3104:ENDMDL >> >> 3106:MODEL3 >> 4

Moose Role Derivation

2012-08-22 Thread marcos rebelo
Hi all I would like to now what is the better pattern to do what I need. I try to reduce the problem to a minimum, let me explain it step by step. I have an interface Role like: package Likeable; use Moose::Role; requires 'likers'; requires 'do_like'; After this, I need 2 Abstr

Re: How to format the data ??

2012-08-22 Thread timothy adigun
Hi jet speed, I think is a lot better using hash or hash reference as implemented in perldsc to do this. Like so: #!/usr/bin/perl use warnings; use strict; use Data::Dumper; my $display_dev_num = {}; my $id_name; while ( defined( my $line = ) ) { chomp $line; if ( $line =~ m{\ADispl

Re: hash of arrays sorting

2012-08-22 Thread Eduardo
On 22/08/12 03:49, Uri Guttman wrote: > On 08/21/2012 08:29 PM, Eduardo wrote: >> how would you do with Sort::Maker? > i don't have time to show an example now but it is much cleaner > looking. all you need to do is code up how you extract each key from > the data set and how it gets sorted (number

Re: extract blocks out and output into a series of files

2012-08-22 Thread Jim Gibson
On Aug 22, 2012, at 8:32 AM, lina wrote: > Hi, > > I have a data file, wish to split into 9 small files, each one starts > > > 2:MODEL1 > 1552:ENDMDL > > 1554:MODEL2 > 3104:ENDMDL > > 3106:MODEL3 > 4656:ENDMDL > > till > > 12418:MODEL9 > 13968:ENDMDL > > >

Re: How to format the data ??

2012-08-22 Thread jet speed
Hi Rob, Thanks for the detailed explanation. Appreciate it. Yes, perfect. All the details are captured. i should be able to modify the output from your code. Thanks Sj On Wed, Aug 22, 2012 at 5:01 PM, Rob Coops wrote: > > > On Wed, Aug 22, 2012 at 4:39 PM, jet speed wrote: > >> Hi All, >> >

Re: How to format the data ??

2012-08-22 Thread Rob Coops
On Wed, Aug 22, 2012 at 4:39 PM, jet speed wrote: > Hi All, > > Please advice me on now to capture the data below in the format as below. > > i thought of using hash, but then the problem is each DisplayDevNum has > multiple WWN. some has 4 elements, some has 2. Any other method ? > Apprecaite y

extract blocks out and output into a series of files

2012-08-22 Thread lina
Hi, I have a data file, wish to split into 9 small files, each one starts 2:MODEL1 1552:ENDMDL 1554:MODEL2 3104:ENDMDL 3106:MODEL3 4656:ENDMDL till 12418:MODEL9 13968:ENDMDL The left number are the line numbers. I can get those 9 output file via some sed co

Re: How to format the data ??

2012-08-22 Thread Ken Slater
On Wed, Aug 22, 2012 at 10:39 AM, jet speed wrote: > Hi All, > > Please advice me on now to capture the data below in the format as below. > > i thought of using hash, but then the problem is each DisplayDevNum has > multiple WWN. some has 4 elements, some has 2. Any other method ? > Apprecaite y

How to format the data ??

2012-08-22 Thread jet speed
Hi All, Please advice me on now to capture the data below in the format as below. i thought of using hash, but then the problem is each DisplayDevNum has multiple WWN. some has 4 elements, some has 2. Any other method ? Apprecaite your comments. i want to caputre in the below format. DisplayDe