Off topic:Perl Code: Difference between print and print $_
1
1
Entering edit mode
8.5 years ago
Shicheng Guo ★ 9.4k

Suppose the contents of the a.fa is as the following:

> a b c
> d_b c.m

The following code were used to remove the space of the head line in a.fa. What's difference between these two script? and Why?

 perl -lane "s/\s+/_/g if /^>/; print " a.fa
 perl -lane "s/\s+/_/g if /^>/; print $_" a.fa
perl • 1.4k views
ADD COMMENT
This thread is not open. No new answers may be added
Traffic: 2433 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6