What am I doing wrong when using "use strict" ?

Discussion in 'Perl' started by ed, Jan 5, 2004.

  1. ed

    ed Guest

    Folks,

    I'm attempting to write some OOP with the use strict pragma on an I'm just
    not getting it to work. Here's an example

    #!/usr/bin/perl -w
    use strict;
    use Automobile;
    my $file = new Automobile;

    I keep getting the error:
    Bareword "Automobile" not allowed while "strict subs" in use.

    The script runs fine without the use strict, so their must be something I
    haven't figured out yet.

    Thanks in advance!!

    Ed
    ed, Jan 5, 2004
    #1
    1. Advertising

  2. ed

    Guest

    "ed" <> wrote in message news:<Ag2Kb.300$>...
    > #!/usr/bin/perl -w
    > use strict;
    > use Automobile;
    > my $file = new Automobile;
    >
    > I keep getting the error:
    > Bareword "Automobile" not allowed while "strict subs" in use.


    Not from that code I think.

    Please post genuine code that generates the error (see posting guidelines).

    This news group does not exist (see FAQ). Please do not start threads here.
    , Jan 5, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. H. Wade Minter
    Replies:
    8
    Views:
    286
    Robin
    Apr 25, 2004
  2. Martina

    why is important to use : use strict?

    Martina, Sep 19, 2005, in forum: Perl Misc
    Replies:
    6
    Views:
    98
    J├╝rgen Exner
    Sep 20, 2005
  3. Ting Wang
    Replies:
    5
    Views:
    172
    John Bokma
    Oct 6, 2005
  4. Peng Yu

    When to use "use strict;"?

    Peng Yu, Jan 25, 2010, in forum: Perl Misc
    Replies:
    14
    Views:
    176
    John Bokma
    Jan 27, 2010
  5. Marius Gavrilescu

    Re: use strict; use warnings;

    Marius Gavrilescu, Feb 24, 2014, in forum: Perl Misc
    Replies:
    152
    Views:
    483
    $Bill
    Mar 11, 2014
Loading...

Share This Page