Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Re: how to shor...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 11035 of 11509
Post > Topic >>

Re: how to shorten this code ? x occur how many times in variable

by krahnj@[EMAIL PROTECTED] (John W. Krahn) May 7, 2008 at 06:15 PM

Richard Lee wrote:
> Rob Dixon wrote:
>>  
>> returns the number of colons found but leaves them untouched. Similarly
>>
>>   $str =? tr/\t /_/;
> 
> this is great!!
> 
> use warnings;
> use strict;
> 
> my $str = 'ab:cd:ef:g:hi::now;';
> print $str =~ tr/:// . "\n";
> print $str =~ tr/:b/_X/ . "\n";
> 
> print "$str\n";
> 
> 
> ././././././testthis.pl
> 6
> 7
> aX_cd_ef_g_hi__now;
> 
> BTW, what is =?    ? or is that a typo?
> 
> $str =? tr/\t /_/;

Typo.


John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall
 




 7 Posts in Topic:
how to shorten this code ? x occur how many times in variable
rich.japh@[EMAIL PROTECTE  2008-05-07 01:43:29 
Re: how to shorten this code ? x occur how many times in variabl
krahnj@[EMAIL PROTECTED]   2008-05-06 23:28:58 
Re: how to shorten this code ? x occur how many times in variabl
rich.japh@[EMAIL PROTECTE  2008-05-07 03:12:03 
Re: how to shorten this code ? x occur how many times in variabl
rob.dixon@[EMAIL PROTECTE  2008-05-07 16:11:07 
Re: how to shorten this code ? x occur how many times in variabl
rich.japh@[EMAIL PROTECTE  2008-05-07 14:07:04 
Re: how to shorten this code ? x occur how many times in variabl
krahnj@[EMAIL PROTECTED]   2008-05-07 18:15:25 
Re: how to shorten this code ? x occur how many times in variabl
rich.japh@[EMAIL PROTECTE  2008-05-08 00:15:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 20:59:39 CDT 2008.