Hello,
I am writing a simple perl script to count the # of characters in a given
field.  At the command line I can write >>wc -m somefile.txt, and get the
total character count.  But in the script I am splitting a text file and
then doing a count on an element of the array.

code snippet:
**************************
while (<FILE>)
{
   chomp;
   (@fields) = split(/\t/);
   $count = wc -m $fields[12];
   print "$count\n";
}
**************************

Here is the error I receive when I check the syntax.
perl -c count.pl
Unrecognized file test: -m at count.pl line 20.


I've tried many different ways of writing this, but can't seem to get it working. Any ideas/help? Thanks, Rob

_________________________________________________________________
Check out MSN PC Safety & Security to help ensure your PC is protected and safe. http://specials.msn.com/msn/security.asp



-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to