If you're talking about the glass panel that connects the digitizer to the phone, you will have to get a new front panel and digitizer to resolve this issue. Almost every cable in the iPhone 3G and 3GS has only 1 user accessible connection that doesn't require micro soldering. This means that if you tore the cable, whatever is attached to it must also be replaced. In your case, if it was just the front glass, it sounds like you could get away with just buying a new front panel to resolve your issue. If you could post a picture of the exact damage, I could recommend which version of the glass to purchase to at minimum, fix the torn cable. Just as a not, you're probably choosing between these two parts. The only difference is what come attached as standard, where one has the speaker already connected, which may be the cable that was torn, and the other does not, which includes juts the digitizer cable, which also may have been what you tore. Hopefully you can get the part you need to fix the phone, and any pictures or further details can help to get you the right part.
iPhone 3GS Front Panel Assembly
iPhone 3GS Front Panel
Hope this helps!