Fontenot, Paul wrote:

Here is the entire script:

while (my(@row) = $sth->fetchrow_array)
{
my $ip = $row[0];
next if $ip == "010.041.\*";
my $name = $row[1];
my $mso = $row[2](m/MS\d\d\-\d{3}/);

I'd do (assuming $row[2] holds the html you gave before and $row[2] only hols one unique MS12-345 thta your after)


        my ($mso) = $row[2] =~ m/(MS\d\d\-\d{3})/;

because:
=~ returns an array in array context and a scalar (the number of elements in that array) if called in scalar context. Also you need to use the parentheses to capture what you want to match and grab.


perldoc perlre
will help you out a lot with regular expressions.

HTH

Lee.M - JupiterHost.Net

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to