Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Counting number of characters in a string

by archon (Monk)
on Mar 14, 2001 at 01:44 UTC ( #64225=note: print w/replies, xml ) Need Help??

in reply to Counting number of characters in a string

sicker and twisteder!!
use strict; use IPC::Open2; my $pid = open2 (\*RDRFH, \*WTRFH, '/usr/bin/wc', '-c') or die "Couldn't open pipe to wc: $!"; if ($pid) { my $string = "shoes and ships and sealing wax"; print WTRFH $string; close (WTRFH); my $len = <RDRFH>; $len =~ s/^\s+//; print "length: $len"; close (RDRFH); }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://64225]
[LanX]: he was "meating" Italian monks oO?
[erix]: then again, there are people who do 10 full triathlons on 10 consecutive days, so it must be doable
choroba's friend has done the Pacific Crest Trail, it's 4200 km
LanX Ladies and gentlemen: due to shortages of "Body of Christ" we have to resort to Body of Monks ...
LanX ... buon appetito!
[LanX]: Pacific Crest Trail is really hard stuff
[Eily]: erix he plans to go as far as leuca
[erix]: ah, that's really down at the heel point :)
[Eily]: LanX how dare you imply that I made a typo? It's true but still!
[Eily]: or is it a typo if the mistake was in my brain rather than in the process of typing?

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-12-13 15:14 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (369 votes). Check out past polls.