BOL
Log in
Username or email
Password
Remember me
Register
Lost password
Activity
News
Opportunity
ResearchLabs
Questions
Pages
Discussion
More
BioScripts
Blogs
Bookmarks
Files
Fun
Polls
The Wire
Videos
Our Sponsors
Download
BioinformaticsOnline(BOL) Apps
in your chrome browser.
The Wire
#TipsOftheDay
Wire posts tagged with 'TipsOftheDay'
Rahul Nayak
@rahul
Thread
By
Rahul Nayak
4023 days ago
Search and replace the string 'this' with the string 'that' in the file filename. perl -p -i -e 's/this/that/g' filename
#Perl
#Trick
#PerlOneLiner
#Tipsoftheday
#Replace
#FindandReplace
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4082 days ago
Print all possible 2 combination of words ( ATGC): $letter = join',','A','T','G','C';
@abc
=glob "{$letter}{$letter}"; foreach (
@abc
) { print "$_\n"; }
#Perl
#PerlTrick
#TipsOftheDay
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4229 days ago
Get line number with Perl $fh->input_line_number()
#Perl
#Tipsoftheday
#Tricks
Shikha Logwani
@shikha
Thread
By
Shikha Logwani
4601 days ago
regex (?(3)foo|fu)bar - Matches foo if 3rd subpattern has matched, fu if not
#Tipsoftheday
#Regex
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4723 days ago
Convert space separated data to tab separated: perl -p -i -e 's/\s+/\t/g' file.txt
#Perl
#Tipsoftheday
#Perlonliner
Abhimanyu Singh
@abhimanyu
Thread
By
Abhimanyu Singh
4729 days ago
To print the matching pattern line perl -ne '/pattern/ && print' infile.gtf
#Perloneliner
#Tipsoftheday
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4739 days ago
To count the number of matches in a string !!! $str = "one.two.three.four"; $n =()= $str =~ /\./gi; print $n;
#Tipsoftheday
#Perl
Poonam Mahapatra
@poonam
Thread
By
Poonam Mahapatra
4762 days ago
Number all lines in a file; perl -pe '$_ = "$. $_"':
#Tipsoftheday
#Perl
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4763 days ago
Generate N base genome: perl -e '
@b
=qw/A T G C/;print ">Genome\n";while($l<N){print
@b
[int(rand(4))];$l++;}'
#Tipsoftheday
#Perl
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4770 days ago
To round a floating-point value to a certain number of decimal places: $rounded = sprintf("%.2f", $unrounded);
#Tipsoftheday
#Perl
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4775 days ago
To get all the module dependencies for yourScript.pl program. $ scandeps.pl yourScript.pl
#Perl
#Tipsoftheday
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4776 days ago
To check: Does an array has all equal values. if (keys %{{ map {$_, 1}
@test
}} == 1) { # all equal }
#Tipsoftheday
#Perl
Jitendra Narayan
@admin
Thread
1 like
Archana Malhotra
@archana
Archana Malhotra
liked this
4781 days ago
By
Jitendra Narayan
4781 days ago
Write something at the bottom of the file without opening it. perl -p -i -e 'eof && s/$/\nWord/;' <filename>
#Tipsoftheday
#Perloneliner
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4782 days ago
Do you want to compile your Perl program without running it, try $ perl -c <program>
#Tipsoftheday
#Perl
Archana Malhotra
@archana
Thread
By
Archana Malhotra
4810 days ago
print "$^O\n"; To print the OS name in perl
#Tipsoftheday
#Perl
#RegularExpression