mikejones has asked for the wisdom of the Perl Monks concerning the following question:
My code needs to delete the P column since its not populated and in the above example is after hdisk#. I tried using tr and s///, but of course it deletes all of the Ps__DATA__ Disk Path P Location adapter LUN SN Type Size LSS Vol Rank C/A +S Connection port RaidMode ------- ----- - ----------- ------ ----------- ---------- +-- ---- ---- --- ----- ---- - ----------- ---- -------- vpath0 hdisk2 1n-08-01[FC] fscsi0 00013772 IBM 2105-F20 15.3GB 16 +0 1000 01 Y R1-B2-H4-ZA 2c RAID5 __END_DATA__
use strict; use warnings; use Data::Dumper; my ($vpath,$hdisk,$lun,$lunsz); my (%HoA,$HoA); open( SANCLI, "datapath query essmap |" ) or die "unable to open pipe. +.. $!"; while(<SANCLI>) { s/^\s+|\s+$//g; s/P{1,1}//g; next unless length $_; my @array=split; { local $" = "\t"; my @fields=@array[0,1,4,7]; print "@fields\n"; } #push @{$HoA{$id}}, $name; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: splicing time
by graff (Chancellor) on Oct 03, 2007 at 03:47 UTC | |
Re: splicing time
by GrandFather (Saint) on Oct 03, 2007 at 01:43 UTC | |
by mikejones (Scribe) on Oct 03, 2007 at 03:41 UTC | |
Re: splicing time
by bruceb3 (Pilgrim) on Oct 03, 2007 at 01:43 UTC |