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 | |
by marto (Cardinal) on Mar 05, 2012 at 14:11 UTC |