Gurus-
i remember using the var setting in the while loop before when i needed to 
do some movement. not sure if it was pre- perl 5.7.8 or not.


could anyone enlighten me as to what i must be completely overlooking 
that's causing the inside of the while loop t remained untouched? it is as 
if it forgets there is any information in the global array.

i'm trying to build a regexp here so that i can place it in a larger 
program.

************************************************************start 
code**************************************
#! /usr/bin/perl
use strict;
use warnings;

my $tmp;
my @temp = split "\n", `sfu sho /det`;

if ($temp[1] =~ /Drive:/){
  my $drvs = 'Drives: ';
  my $rls = 'RAID Levels: ';
  my $ssz = 'Stripe Sizes: ';
  my $wps = 'Write Policies: ';

        print "blah! the array starts....
\t1:$temp[0]
\t2:$temp[1]
\t3:$temp[2]

";

  # now get some of this that we want to pass on
  while($tmp = shift(@temp)){

        print "\tTEMP IS: $tmp\n";

    # find each drive's info
    if($tmp =~ /drive: (\w+)/i){
      $drvs .= "$1, "; # add the drive


      while(!(($temp[1] =~ /Drive:/i) ||
              ($temp[1] =~ /Unit:/i) ||
              ($temp[1] =~ /Volume:/i))){
        $tmp=shift(@temp);
        if($tmp =~ /Raid level:\s+(\d+)/i){ $rls .= "$1, "; }
        if($tmp =~ /Stripe size:\s+(\d+\s\w\w)/i){ $ssz .= "$1, "; }
        if($tmp =~ /Write policy:\s+(\w+\s\w+)/i){ $wps .= "$1, "; }
      }

    }
  # copy and paste unit/volume info

  }

print "drvs: $drvs
raids: $rls
stripes: $ssz
wps: $wps\n\n

and this should be nothing: $temp[1]
";

}
************************************************************end 
code**************************************


since i doubt anyone has SFU (a proprietary program the company i work for 
owns), there's an example, specifically what one gets on the system i am 
trying to build the regexp on.

while i do not have it here, the print out has an empty line proceeding 
and following the information

************************************************************start 
example**************************************
Drive: SeaFileDrive0

    Formatted as NTFS

    Physical configuration:
        DAC controller:             0
        Adapter type:               LSI 520 (AMI 320-1)
        Raid level:                 5
        Stripe size:                128 KB
        Write policy:               Write through
        Number of spans:            1
        Span 0 configuration:
            Starting block:         0
            Number of drives:       12
            Drive size in blocks:   3727360
            Physical drive(s):      0-0 blocks 0 through 3727359
                                    0-1 blocks 0 through 3727359
                                    0-2 blocks 0 through 3727359
                                    0-3 blocks 0 through 3727359
                                    0-4 blocks 0 through 3727359
                                    0-5 blocks 0 through 3727359
                                    0-8 blocks 0 through 3727359
                                    0-9 blocks 0 through 3727359
                                    0-10 blocks 0 through 3727359
                                    0-11 blocks 0 through 3727359
                                    0-12 blocks 0 through 3727359
                                    0-13 blocks 0 through 3727359

Drive: SeaFileDrive1

    SeaFile unit:                   DVL (Drive 1 of 2)
    Drive data size:                1522961 MB
    Format signature:               SeaChange Expandable File System 
(SXFS)
    Format date/time:               21-Feb-2006 09:52:59 AM

    Physical configuration:
        DAC controller:             0
        Adapter type:               LSI 520 (AMI 320-1)
        Raid level:                 5
        Stripe size:                128 KB
        Write policy:               Write through
        Number of spans:            1
        Span 0 configuration:
            Starting block:         3727360
            Number of drives:       12
            Drive size in blocks:   283547648
            Physical drive(s):      0-0 blocks 3727360 through 287275007
                                    0-1 blocks 3727360 through 287275007
                                    0-2 blocks 3727360 through 287275007
                                    0-3 blocks 3727360 through 287275007
                                    0-4 blocks 3727360 through 287275007
                                    0-5 blocks 3727360 through 287275007
                                    0-8 blocks 3727360 through 287275007
                                    0-9 blocks 3727360 through 287275007
                                    0-10 blocks 3727360 through 287275007
                                    0-11 blocks 3727360 through 287275007
                                    0-12 blocks 3727360 through 287275007
                                    0-13 blocks 3727360 through 287275007

Drive: SeaFileDrive2

    Formatted as NTFS

    Physical configuration:
        DAC controller:             1
        Adapter type:               LSI 520 (AMI 320-1)
        Raid level:                 5
        Stripe size:                128 KB
        Write policy:               Write through
        Number of spans:            1
        Span 0 configuration:
            Starting block:         0
            Number of drives:       12
            Drive size in blocks:   3727360
            Physical drive(s):      0-0 blocks 0 through 3727359
                                    0-1 blocks 0 through 3727359
                                    0-2 blocks 0 through 3727359
                                    0-3 blocks 0 through 3727359
                                    0-4 blocks 0 through 3727359
                                    0-5 blocks 0 through 3727359
                                    0-8 blocks 0 through 3727359
                                    0-9 blocks 0 through 3727359
                                    0-10 blocks 0 through 3727359
                                    0-11 blocks 0 through 3727359
                                    0-12 blocks 0 through 3727359
                                    0-13 blocks 0 through 3727359

Drive: SeaFileDrive3

    SeaFile unit:                   DVL (Drive 2 of 2)
    Drive data size:                1522961 MB
    Format signature:               SeaChange Expandable File System 
(SXFS)
    Format date/time:               21-Feb-2006 09:52:59 AM

    Physical configuration:
        DAC controller:             1
        Adapter type:               LSI 520 (AMI 320-1)
        Raid level:                 5
        Stripe size:                128 KB
        Write policy:               Write through
        Number of spans:            1
        Span 0 configuration:
            Starting block:         3727360
            Number of drives:       12
            Drive size in blocks:   283547648
            Physical drive(s):      0-0 blocks 3727360 through 287275007
                                    0-1 blocks 3727360 through 287275007
                                    0-2 blocks 3727360 through 287275007
                                    0-3 blocks 3727360 through 287275007
                                    0-4 blocks 3727360 through 287275007
                                    0-5 blocks 3727360 through 287275007
                                    0-8 blocks 3727360 through 287275007
                                    0-9 blocks 3727360 through 287275007
                                    0-10 blocks 3727360 through 287275007
                                    0-11 blocks 3727360 through 287275007
                                    0-12 blocks 3727360 through 287275007
                                    0-13 blocks 3727360 through 287275007

Unit: SeaFileUnit0

    Unit size:                      3045922 MB
    Volume label:                   DVL
    Unit count of volume:           1
    Unit position within volume:    1
    Free space:                     2440093 MB
    Used space:                     605830 MB
    Max files:                      100000
    Min segment size:               8257536
    Drive(s):                       SeaFileDrive1, SeaFileDrive3

Volume: SeaFileVolume1

    Volume label:                     DVL
    Volume size:                      3045922 MB
    Free space:                       2440093 MB
    Used space:                       605830 MB
    Min segment length:               7 MB
    Name count:                       5457
    Previous validation error count:  0
    Previous damage flags:            none
    Validation error count:           0
    Damage flags:                     none
    Max files:                        100000
    Max file name length:             64
    Max brief private data length:    12
    Max full private data length:     2048
    Max system private data length:   512
    Max window turns per cathedral:   100
    Max cathedrals per basilica:      10

    Unit count:                       1
    Unit(s):                          SeaFileUnit0
************************************************************end 
example**************************************


thank you in advance,
-Josh
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to