Prev: sysopen failures
Next: Question re calling subroutines
From: Thomas Andersson on 6 Aug 2010 16:00 Will this line update $page with a number if it's double digit (ie 10+) or does the code need to change? my ($page) = $page_number_txt =~ /PAGE (\d) >/;
From: RedGrittyBrick on 6 Aug 2010 16:16 On 06/08/2010 21:00, Thomas Andersson wrote: > Will this line update $page with a number if it's double digit (ie 10+) or No, \d matches a single digit. > does the code need to change? Yes. E.g. change \d to \d+ > > my ($page) = $page_number_txt =~ /PAGE (\d)>/; > > -- RGB
From: Tad McClellan on 6 Aug 2010 17:19 Thomas Andersson <thomas(a)tifozi.net> wrote: > Will this line update $page with a number if it's double digit (ie 10+) or > does the code need to change? > > my ($page) = $page_number_txt =~ /PAGE (\d) >/; What happened when you tried it? -- Tad McClellan email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/" The above message is a Usenet post. I don't recall having given anyone permission to use it on a Web site.
From: Thomas Andersson on 8 Aug 2010 15:41 Tad McClellan wrote: > Thomas Andersson <thomas(a)tifozi.net> wrote: >> Will this line update $page with a number if it's double digit (ie >> 10+) or does the code need to change? >> >> my ($page) = $page_number_txt =~ /PAGE (\d) >/; > > What happened when you tried it? It's sorted now, basically my script processed pages and a had a function to look for next page to see if it should continue. When page 10 came around it bugged out as it found a page, but pagenumber was incorrectly set. Changing to \d+ fixed it.
|
Pages: 1 Prev: sysopen failures Next: Question re calling subroutines |