On Dec 5, Rahul Garg said:
>how to check $line contains how many tabs ..is there any func in perl
You might want to use the tr/// operator.
$tab_count = ($string =~ tr/\t//);
if ($tab_count == 1) {
# ...
}
Or, more briefly:
if (($string =~ tr/\t//) == 1) {
# ...
}
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]