Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: Counting number of characters in a string

by Anonymous Monk
on Jun 21, 2010 at 07:13 UTC ( #845681=note: print w/replies, xml ) Need Help??

in reply to (jcwren) Re: Counting number of characters in a string
in thread Counting number of characters in a string

It didn't working

use strict; { my $string = "Oh please, good sir program, what is my length?"; printf ("The length is %d characters\n", howlong ($string)); use Inline C => <<'END_OF_C_CODE'; #include <string.h> int howlong(char *s) { return strlen (s); } END_OF_C_CODE }

Replies are listed 'Best First'.
Re^3: Counting number of characters in a string
by rowdog (Curate) on Jun 21, 2010 at 23:13 UTC

    Works fine on Linux. I imagine you're missing either Inline::C or string.h and the associated library.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://845681]
[1nickt]: Hm, that is, how to prevent Perl from turning 1.0 into 1? I feel sure this must be an faq, but am reading perlnum and not finding the answer ...
[Lady_Aleena]: 1nickt, why does it matter in this case?
[1nickt]: Hm, perhaps this? "Operators which expect an integer force the argument into the integer format."
[1nickt]: Can this be? So print
[1nickt]: ... "expects an integer" ?

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-05-24 18:35 GMT
Find Nodes?
    Voting Booth?