Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: It's all getting messy - remove whitespace

by tinita (Parson)
on Jun 15, 2014 at 10:50 UTC ( #1089933=note: print w/replies, xml ) Need Help??


in reply to It's all getting messy - remove whitespace

Whenever you don't know what's in your data (you think it contains whitespaces) print it to make sure.
use Data::Dumper; local $Data::Dumper::Useqq = 1; # make "invisible" characters visible print Dumper \@spliceout;

Then read about array interpolation in perldata:
Arrays and slices are interpolated into double-quoted strings by joining the elements with the delimiter specified in the $" variable

The problem is in this line:
  print MYFILE (">" . "$col_ID[$i]" , "@spliceout" , "\n");    

Replies are listed 'Best First'.
Re^2: It's all getting messy - remove whitespace
by lecb (Acolyte) on Jun 15, 2014 at 11:21 UTC

    Thank you! I have modified the script and it now works!

    my @splicejoin = join('', @spliceout); open (MYFILE, '>>fasta'); print MYFILE (">" . "$col_ID[$i]" , "@splicejoin" . "\n"); + close (MYFILE);

    Many thanks for the quick responses and for pointing me in the direction about it not actually being whitespace; didn't realise I could do that. Thanks again.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2019-10-21 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?