in reply to $foo = << "END"

"Hi Everybody, Does anyone know what the following code do."

What did it do when you tried it? I know it'll throw an error.

"I would be very thankful if you could suggest me an alternative for the same."

You want an alternative for something but you don't understand what it's supposed to do? Why not find out what it is and what it does first. It's called a Here_document. Consider the following example:

#!/usr/bin/perl use strict; use warnings; my $foo = << "END"; Blah blah blah more blah END print $foo;

Output:

Blah blah blah more blah

Replies are listed 'Best First'.
Re^2: $foo = << "END"
by akagrawal3 (Beadle) on Mar 05, 2012 at 13:57 UTC
    Thank you morto. I have updated my thread. Please check if that could help.

      I previously advised you to read and understand How do I post a question effectively? which mentions updating your posts. Generally it's very helpful to add a line to point out what has been updated, e.g.

      My first question goes here....

      Update: I've thought of something else

      Incidentally the code to post this is as follows:

      <p>My first question goes here....</p> <p><b>Update</b>: I've thought of something else</p>

      Again, going back to advice given in a previous thread, you need to ask questions properly. Tell people what you're actually trying to do.

      It seems you're trying to build up a SQL statement based on a template query and some values stored in variables. I'd advise against using here docs to build up SQL queries based on appending values to strings. See Placeholders and bind variables and SQL_injection.