Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to check if a word is reserved

by hossman (Prior)
on Jun 13, 2003 at 00:57 UTC ( [id://265550]=note: print w/replies, xml ) Need Help??


in reply to How to check if a word is reserved

You ask an excellent question, but i worry about your motivation.

Wouldn't "perl -c your_file_here" serve quite well as a syntax checker?

Update: As it has been pointed out in a reply, perl (5.6.0 anyway) doesn't seem to care if you use undefined methods when run with -c ... I thought this behavior depended on wether the method was called with "&" or not ... but it doesn't seem to make a difference one way or another...

!/usr/local/bin/perl -wc use strict; sub foo { return not_here("baz"); } print &some_undef_method(1); __END__ bester:~> tmp/monk.pl tmp/monk.pl syntax OK

Replies are listed 'Best First'.
Re: Re: How to check if a word is reserved
by htoug (Deacon) on Jun 13, 2003 at 08:11 UTC
    I would prefer 'perl -wc your_file_here'.

    Always, alway, always (well nearly always) use '-w'
    - or 'use warnings;' with newer Perls.

Re: Re: How to check if a word is reserved
by genecutl (Beadle) on Jun 13, 2003 at 17:28 UTC
    I mainly want to use this syntax checker for code that is still under development which may not be ready to pass a full syntax check. Also, I may be mistaken, but it seems like calling a non-existant function doesn't get caught by the perl syntax checker. It only triggers an error when the code is actually run.

      Holy Crap! ... you're right.

      I can't believe I've never noticed that before. Man, that's anoying.

      ... i retract my comment ... keep up the good work.

Re: Re: How to check if a word is reserved
by shotgunefx (Parson) on Jun 13, 2003 at 15:16 UTC
    Excellent point++

    -Lee

    "To be civilized is to deny one's nature."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-28 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found