canyon289
06-20-2009, 02:07 AM
Hi,
I'm new to coding so I apologize in advance if my questions are basic.
I wrote this basic piece of code but frankly I don't understand what is actually happening
#(Script 1)
print "What is your name?\n";
chomp($name = <STDIN>); #waits for user input from keyboard
print ("$name" & 'name');
Here's the executed code
Process started >>>
John Doe
What is your name?
Jahd<<< Process finished.
I'm trying to learn by experimentation and I was wondering if anyone could explain why the output is Jahd. What exactly is the computer doing?
Thanks,
Canyon289
I'm new to coding so I apologize in advance if my questions are basic.
I wrote this basic piece of code but frankly I don't understand what is actually happening
#(Script 1)
print "What is your name?\n";
chomp($name = <STDIN>); #waits for user input from keyboard
print ("$name" & 'name');
Here's the executed code
Process started >>>
John Doe
What is your name?
Jahd<<< Process finished.
I'm trying to learn by experimentation and I was wondering if anyone could explain why the output is Jahd. What exactly is the computer doing?
Thanks,
Canyon289