in reply to Re^2: How to use __DATA__ efficiently, help!
in thread How to use __DATA__ efficiently, help!

I am getting weird numbers in the middle of the html code; 1 and 11, using:
while (<DATA>) { $_.=s/<--date\/\/>/$date/; $_.=s/<--loc\/\/>/$location/; $data .= $_ }
Any ideas why?

Replies are listed 'Best First'.
Re^4: How to use __DATA__ efficiently, help!
by Anonyrnous Monk (Hermit) on Feb 09, 2011 at 20:02 UTC
    $_.=s/<--date\/\/>/$date/;

    You probably meant

    $_ =~ s/<--date\/\/>/$date/; ...

    or just (as $_ is the default anyway)

    s/<--date\/\/>/$date/; ...

    s/// returns the number of substitutions made, so as you have it, you're appending that number to $_.