parenthesis as memory or substitution?

Please bear with me. I'm a Perl novice.

I have some HTML code being read in from a file with includes this image tag (actually several of them):

<Img Src="/content/Images/Blobs3/bra1master.gif" Width="81" Height="6" Border="0"></Td>

Out of this code, all that I want is the number 81 from the width--nothing else.

How would I go about this?
If I'm not giving enough information let me know, I'll try to be clearer.

jdixonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
$_ = '<Img Src="/content/Images/Blobs3/bra1master.gif" Width="81" Height="6" Border=""0"></Td>';
($width) = /Width="(\d+)"/;
inq123Commented:
Hi jdixon,

if your img tag is inside normal html file and it's always this syntax, then you probably want to use the whole tag as regex pattern as ozo's solution will get too much noise when a full html file is parsed.  Something like below would work:

while(<IN>) # reading the html file
{
  while(m|<Img\s*Src\s*=\s*"/content/Images/Blobs3/bra1master.gif".*?Width="(\d+)"[^>]*>\s*</Td>|ig)
  {
    print "width is $1\n";
  }
}

This'll be pretty safe since it deals with full html file, it deals with more than one img tag on one line, and it allows for some variations on the img tag.

Cheers!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jdixonAuthor Commented:
Thanks to the both of you! You guys are great not to mention fast.
inq123Commented:
You're welcome!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.