PerlPeer has asked for the wisdom of the Perl Monks concerning the following question:
hi, I try to replace white spaces with tabs, but my string gets changed into a numeric value after that. I wrote the basic step as a new program to show what happens
#!/usr/bin/perl -w use strict; $_ = "CC1G_00040T0 NODE_4204_length_20667_cov_33.873905_4 3e-46" +; my $line = $_; print "$line\n"; $line = s/\s+/\t/g; print "$line\n";
when I run this, it gives the following:
CC1G_00040T0 NODE_4204_length_20667_cov_33.873905_4 3e-46
2
How can I prevent my string from becoming a numeric value?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substituting white spaces with a tab changes my string into numeric value
by remiah (Hermit) on Sep 20, 2012 at 02:30 UTC | |
by PerlPeer (Novice) on Sep 20, 2012 at 02:33 UTC | |
|
Re: Substituting white spaces with a tab changes my string into numeric value
by dsheroh (Monsignor) on Sep 20, 2012 at 08:17 UTC | |
by PerlPeer (Novice) on Sep 20, 2012 at 09:22 UTC |