Who is having the panic attacks, and who thinks the code is stolen? I'm guessing a) you, and b) the boss, but the antecedents aren't clear.
Using code from the web without understanding it is not a good thing. But I would think worse of somebody who (for example) spent a week reimplementing in Perl what he could have installed from CPAN. (Do I understand everything I pull down from CPAN? Umm, well, I understand how to use it.)