Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: How to check if a word is reserved

by hossman (Prior)
on Jun 13, 2003 at 00:57 UTC ( #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/ tmp/ 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++


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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-01-18 07:49 GMT
Find Nodes?
    Voting Booth?