Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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); }


Comment on Re: Counting number of characters in a string
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://64225]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-07-07 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls