Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: a perl code syntax help

by kcott (Archbishop)
on Jul 28, 2014 at 11:32 UTC ( [id://1095336]=note: print w/replies, xml ) Need Help??


in reply to a perl code syntax help

G'day ghosh123,

"In the above code, what does this <<END and END mean ?"

The construct

<<END; ... END

is called a heredoc.

Simplistically, it's just a string. In perlop, it's introduced in "Quote and Quote-like Operators" with a lot more detail in "Quote-Like Operators".

"how can I change the code which is in between that <<END and END, to insert a if-else condition for that popup_menu."

Now that you know that's a string, you probably won't be trying to do that any more. :-)

I'd suggest something along these lines:

my $popup_string; if (some_condition()) { $popup_string = ...; } else { $popup_string = ...; } $html .= <<END; ... <td bgcolor="#EEEEEE">$popup_string</td> ... END

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1095336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found