I am learning Perl , very new user . May i know whats the difference between these Perl codes.
#!/usr/bin/perl
&
#!/usr/bin/perl -w
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That is not perl code, it’s a shebang, which is used in a linux/unix environment as a way to tell the shell what program should be used to run the program file. It has no effect in windows, but it does activate any switches used.
The
-wpart is a switch for perl, telling it to activate warnings. You can learn more about perl’s command line switches by typingperl -hat the command prompt. Read more inperldoc perlrun-wis the older version of theuse warningspragma, which is preferred nowadays. While-wis global,use warningsis lexical, and can be activated selectively.