programingnoob
Technical User
Hi,
I have this search problem. I just can't master the search functions...
I have this script
use warnings;
open IN, "results.htm" or die "error";
@content = <IN>;
close IN;
foreach $ln (@content) {
$ln =~ /.gif' width=30 height=30 border=1></a></td><td bgcolor='#ffffcc' align=left><a href='games.html?type=beat&shade_id=(\d+)'>/ && print;
$al[1]=$1;
$al[2]=$2;
$al[3]=$3;
$al[4]=$4;
$al[5]=$5;
$al[6]=$6;
$al[7]=$7;
$al[8]=$8;
$al[9]=$9;
$al[10]=$10;
$al[11]=$11;
}
I got lots of errors.
However, i soon found out the the \ can be used to eliminate some of tthe errors. But I don't know where to put them. Also, I need the search results to be the numbers, which is (\d+) (\d is a shortcut for numbers and + means any quanity). And () means save it to $1
However, I'm sure that there will be more than result, how can I save them all?
Thanks
I have this search problem. I just can't master the search functions...
I have this script
use warnings;
open IN, "results.htm" or die "error";
@content = <IN>;
close IN;
foreach $ln (@content) {
$ln =~ /.gif' width=30 height=30 border=1></a></td><td bgcolor='#ffffcc' align=left><a href='games.html?type=beat&shade_id=(\d+)'>/ && print;
$al[1]=$1;
$al[2]=$2;
$al[3]=$3;
$al[4]=$4;
$al[5]=$5;
$al[6]=$6;
$al[7]=$7;
$al[8]=$8;
$al[9]=$9;
$al[10]=$10;
$al[11]=$11;
}
I got lots of errors.
However, i soon found out the the \ can be used to eliminate some of tthe errors. But I don't know where to put them. Also, I need the search results to be the numbers, which is (\d+) (\d is a shortcut for numbers and + means any quanity). And () means save it to $1
However, I'm sure that there will be more than result, how can I save them all?
Thanks