Hi,
Hello,
i am new to perl and to this mailing list. My name is Hameed and I am 20 years old. I am doing BCS from Biztek (http://biztek.edu.pk). i have joined this mailing list because i am learning perl. i am getting a warinig which i can't understand so i am mailing you people. following is my programme.
[EMAIL PROTECTED] cat backwards.pl #!/usr/bin/perl #backwards.pl use warnings; use strict;
print qw( January February March April May June July August September October November December )[-1]; print "\n"; print (('January', 'Fubruary', 'March', 'April', 'May ', 'June',
^ ^
'July', 'August', 'September', 'Ooctber', 'November', 'December')[-1]); print "\n"; # End of programme listing
following is the warning and output i am getting.
[EMAIL PROTECTED] ./backwards.pl print (...) interpreted as function at ./backwards.pl line 14. December December
can some one help me, what i am doing wrong.Or how can i fix this. it will be very nice if you explain why this is happening to me. so in future the same mistake will not happen.
You have a space between the print *operator* and the left parenthesis which means that perl will interpret it as the print *function* and output that warning. See the "Terms and List Operators (Leftward)" section of perlop for details.
perldoc perlop
John -- use Perl; program fulfillment
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>