
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given the equation of curve $C$ is: $x^{2}+y^{2}-2x-4y+m=0$, and point $P(3,-1)$.  
$(1)$ If $m=1$, and line $l$ passes through point $P$ and has only one common point with curve $C$, find the equation of line $l$;  
$(2)$ If curve $C$ represents a circle and is intersected by the line $x+2y+5=0$ with a chord length of $2\sqrt{5}$, find the value of the real number $m$.

Present the answer in LaTex format: \boxed{Your answer}
user