Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Require Carp - doesn't

by Wiggins (Hermit)
on Dec 07, 2006 at 17:13 UTC ( #588398=perlquestion: print w/replies, xml ) Need Help??
Wiggins has asked for the wisdom of the Perl Monks concerning the following question:

In order to use perlcc. (no comments needed), I need to change all of the 'use' commands to 'require' for inclusion in the compile.

require threads ; require threads::shared ; require IO::Socket; require Thread::Semaphore; require Getopt::Std; require Carp;

Works for all but Carp.

PerlThreads]# perlcc -o xm /usr/bin/perlcc: did not compile: String found where operator expected at line 98, near "carp "bad + args"" (Do you need to predeclare carp?) String found where operator expected at line 144, near "carp "N +amed pipe (-n) required "" (Do you need to predeclare carp?) String found where operator expected at line 151, near "carp "p +roblem with the NamedPipe ($opt_n) "" (Do you need to predeclare carp?) ....

obvious - don't use Carp. Other than that, any suggestions or explanations?

Replies are listed 'Best First'.
Re: Require Carp - doesn't
by idsfa (Vicar) on Dec 07, 2006 at 17:20 UTC

    Did you Super Search? Steve_p just wrote about this.

    The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
      The thread referred to is about the dynamic loading, it usefulness, and attempted optimizations. I know I use Carp; it is needed for the compile.

      But what I did find (looking at code examples) is that "requiring warnings" prior solved the problem.

      Tis strange that Carp doesn't complain when a dependency is not present.

        This has nothing to do with Carp's dependencies (and it doesn't depend on warnings). In fact, your "fix" is actually incorrect and buggy and Steve Peters posted his comment to warn people away from doing that! It has nothing to do with dynamic loading either. It has everything to do with subroutine prototypes, as Steve explained.

        Perl hasn't loaded Carp when it tries to compile the carp() calls. Without parentheses, it has no idea how many arguments the function should take (or even if carp is a function call at all), so it warns.

        It would do that even if you weren't trying to use perlcc or Carp.

Re: Require Carp - doesn't
by diotalevi (Canon) on Dec 07, 2006 at 22:21 UTC

    perlcc doesn't work anyway. Perhaps you want PAR instead?

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://588398]
Approved by andyford
[james28909]: what i am trying to accomplish is piping the output of ffmpeg to yet another encryption routine using libsodium. and hopefully once that is done i will be able to forward the packets to discord servers
[RonW]: choroba: Please define "high end" and "low end"
[LanX]: choroba: subversive (as usual ;)
[james28909]: i dunno, if i didnt have so little experience in linux i would swap. but it would be to much of a learning curve for me right now.
[choroba]: Low-end is defined as the Perl that generates millions of income
[choroba]: sorry, that's high-end, of coursse
[choroba]: low end, in my talk, will be code that "we don't touch because it works" and noone knows why
[choroba]: I want to present the most bizzare bugs and misfeatures I met when working for a large financial institution
[choroba]: I already gave a similar talk to my friends in a pub and at an internal conference at work and people liked it, so maybe...
[choroba]: LanX: That's the heritage, I can't do anything else

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (17)
As of 2017-05-22 21:31 GMT
Find Nodes?
    Voting Booth?