in reply to comments break my code

arcnon, it would be extremely helpful if you could show a piece of code the replicates the problem. Off the top of my head, you may be using a source filter, even if you don't realise that you are (what modules are you useing inside this module?).

Replies are listed 'Best First'.
Re^2: comments break my code
by arcnon (Monk) on Nov 19, 2005 at 17:04 UTC
    this is it

    t.pl

    #!/usr/bin/perl -w use strict; use CGI; use Tester::Test; Tester::Test->test();
    Test.pm
    package Tester::Test; use strict; sub test{ print "test"; } #test 1; __END__
      If you're editing files on Windows and running them on a Mac, you might need to check your line endings -- is there a real carriage-return between the comment and the "1;" line? -Simon
        holy crap... thanks. the .pm had mac lineendings.
        fixed that and it worked.
        Guess I am offically an idiot.

      Hi,

      A thing that has nothing to do with your problem, but I won't use the indirect method call when you're not dealing with OO. Tester::Test->test() Because that way your first argument in the @_ array will be the Package name 'Tester::Test'.

      Use the normal method Tester::Test::test() or use the Exporter module to import the subroutines into your namespace.

      Tester::Test.pm
      package Tester::Test; use strict; use Exporter qw/ import /; our @EXPORT_OK = qw/ test /; sub test{ print "test"; } 1;
      t.pl
      #!/usr/bin/perl -w use strict; use CGI; use Tester::Test qw/test/; # if you want to import it into your namesp +ace Tester::Test::test(); # or directly test() if you have imported it exit;

      Regards,

      |fire| at irc.freenode.net