Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: What the @#%* lost again!

by svsingh (Priest)
on Jul 02, 2003 at 21:39 UTC ( #270975=note: print w/ replies, xml ) Need Help??


in reply to Re: What the @#%* lost again!
in thread problem opening and reading from a file

Thanks for letting me know that Abigail. I didn't realize you could use reserved words in filehandles. I guess it's just more of a recommendation that you don't use them. Thanks again.


Comment on Re: Re: What the @#%* lost again!
Re: What the @#%* lost again!
by Abigail-II (Bishop) on Jul 02, 2003 at 22:49 UTC
    Well, I carefully worded it "all-caps words with a special meaning". BEGIN isn't a reserved word. However, you can use reserved words as file handles, as long as you quote them when appropriate:
    #!/usr/bin/perl use strict; use warnings; open print => "/etc/passwd" or die; print while <print>; __END__

    If you replace the => with a comma, the code above won't compile.

    Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://270975]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-10-25 09:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls