Gossamer Forum
Home : General : Perl Programming :

Perl executes comments?

Quote Reply
Perl executes comments?
Code:
print $_->{s-var} = 1;

# WTF? - Turn your head 90 degrees left to see the smiley face! :-} = 'Paul';

Can anyone tell me what that code prints?...Yogi is not included. This is code originally by someone else but I've modified it for this little demo.

Last edited by:

Paul: Aug 23, 2002, 5:25 AM
Quote Reply
Re: [Paul] Perl executes comments? In reply to
1
Quote Reply
Re: [golden_water] Perl executes comments? In reply to
Nope.
Quote Reply
Re: [Paul] Perl executes comments? In reply to
I get...

Paul
Quote Reply
Re: [Watts] Perl executes comments? In reply to
Yep do you know why? Smile
Quote Reply
Re: [Paul] Perl executes comments? In reply to
Something to do with the } in the comment? Unsure

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Perl executes comments? In reply to
No, not really.
Quote Reply
Re: [Paul] Perl executes comments? In reply to
cute Wink
Quote Reply
Re: [Mark Badolato] Perl executes comments? In reply to
I thought so Blush

Last edited by:

Paul: Aug 26, 2002, 4:15 AM
Quote Reply
Re: [Paul] Perl executes comments? In reply to
Paul, I have absolutely no idea how that works. Please, please can you explain to me? I am trying to learn and you're confusing me.
Quote Reply
Re: [Derrida] Perl executes comments? In reply to
Here's a hint, look carefully at the middle line Wink

Code:
$buf = "abcdefghijklmnop";
$buf =~ s-f-[haha! I'm replacing this letter!]-;
print $buf;
Quote Reply
Re: [Aki] Perl executes comments? In reply to
shush, don't give it away Smile
Quote Reply
Re: [Aki] Perl executes comments? In reply to
Hmm. That's very cunning, only the construct >{ on the first "line" is very beyond me. What is it?