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
3924 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
3983 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
4130 days ago
Get line number with Perl $fh->input_line_number()
#Perl
#Tipsoftheday
#Tricks
Shikha Logwani
@shikha
Thread
By
Shikha Logwani
4502 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
4624 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
4630 days ago
To print the matching pattern line perl -ne '/pattern/ && print' infile.gtf
#Perloneliner
#Tipsoftheday
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4640 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
4663 days ago
Number all lines in a file; perl -pe '$_ = "$. $_"':
#Tipsoftheday
#Perl
Jitendra Narayan
@admin
Thread
By
Jitendra Narayan
4664 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
4671 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
4676 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
4677 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
4682 days ago
By
Jitendra Narayan
4682 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
4683 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
4711 days ago
print "$^O\n"; To print the OS name in perl
#Tipsoftheday
#Perl
#RegularExpression