Do you have a question? Post it now! No Registration Necessary. Now with pictures!
August 23, 2009, 7:31 pm
rate this thread
I am new to Perl, so please excuse me for asking such a simple
question: The book I am reading gave an example of how to use the
"_PACKAGE_" token. The original code is like this:
print _PACKAGE, "\n";
When I tried to run this code using Perl version 5.10.0, I encoutered
an error message, saying "No comma allowed after file handle". But
after I changed the code to: print "_PACKAGE_\n", all I got is
_PACKAGE printed out on the screen. It appears that the _PACKAGE_ is
just like a string if "use strict" is not enforced. Can anyone explain
why is this? Thank you very much.
If you learn your way around the documentation that comes with
perl, then you won't be dependant on others for simple questions.
Perl's docs are large so it is easy to miss the right place to look,
but you should at least take a shot at it.
Books are nice, but they are not the 1st reference for Perl.
The std docs are the 1st reference for Perl, so when something
in a book isn't working right, it is wise to try verifying what
the book says in the Perl docs.
See the "Special Literals" section in:
paying particular attention to the characters that make
up the literal that you are using.
email: perl -le "print scalar reverse qq/moc.noitatibaher0cmdat/"
- » newbie question: prerequisites missing: going in circles.
- — Previous thread in » PERL Modules Announcements
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum