There are a number of problems with you code fragment. In particular $value never gets a value and $reading can never become non-zero. Perhaps you could sort those problems first, then you could tell us what the problem is that you see and what result you would rather see.
Note that using a __DATA__ section as in the sample code below means that we can all share the pleasure of testing your code for you. Note too that use warnings; use strict; often saves red faces.
use strict; use warnings; my $file = "Appxxx"; while (<DATA>) { my $reading = 0; $reading++ if $reading; if(/.* ss:Name=\"$file*/oi){ # When we see <Appxxx> start storing the data print "VALUE IS $value \n"; $reading = 1; } $reading = 0 if (/<Row AutoFitHeight=\"0\">/); next unless $reading; print "$_"; } __DATA__ <Worksheet ss:Name="Appxxx"> <Table ss:ExpandedColumnCount="9" ss:ExpandedRowCount="4" x:FullColumn +s="1"> <Row ss:StyleID="s21"> <Cell><Data ss:Type="String">APPLES</Data></Cell> <Cell><Data ss:Type="String">GRAPES</Data></Cell> <Cell><Data ss:Type="String">TOWELS</Data></Cell> <Cell><Data ss:Type="String">NUMBER1</Data></Cell> <Cell><Data ss:Type="String">NUMBER2</Data></Cell> <Cell><Data ss:Type="String">NUMBER3</Data></Cell> <Cell><Data ss:Type="String">NUMBER4</Data></Cell> </Row> <Row> <Cell><Data ss:Type="Number">9</Data></Cell> <Cell><Data ss:Type="Number">0</Data></Cell> <Cell><Data ss:Type="Number">0</Data></Cell> <Cell><Data ss:Type="Number">0</Data></Cell> <Cell><Data ss:Type="Number">4</Data></Cell> <Cell><Data ss:Type="Number">126</Data></Cell> <Cell><Data ss:Type="Number">5</Data></Cell> <Cell><Data ss:Type="Number">144</Data></Cell> <Cell><Data ss:Type="String">01/24/2006-03:00</Data></Cell> </Row> <Row AutoFitHeight="0">
In reply to Re: match and read
by GrandFather
in thread match and read
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |