in reply to Extract line, matching more than one variable
Welcome to the Monastery! Make yourself at home.
To accomplish your task, go through perlopentut and perlre. Try some code and if you have any questions, you can come again here.
# Remove the newline from the DNA filename
open (PDBFILE, $pdbfile);
@sa = split(/\t/,$_);
#print "$sa $sa $sa\n";
#$res = substr $_, 0, 4;
#$res_no = substr $_, 4, 5;
#$atom =substr $_, 9, 3;
$res = substr $_, 17, 3;
$res_no = substr $_, 22, 4;
$atom =substr $_, 13, 3;
#print " $res $res_no $atom \n" ; # works fine
if (( $saeq$res)&&($sa==$res_no)&&($sa eq $atom))
print "$_"; # does not print anything.
Please use <code> tags to wrap the coding parts in your nodes.
Can you please show us your sample file, so that we can give solutions without assumption.
Read a book on Perl
Written a book on Perl
Contributed to the Perl source code
Debugged someone else's script
Played Perl Golf
Used regular expressions to save the day
Used Perl for a certain amount of time (please specify)
Invested a certain amount of man-hours in learning Perl (please estimate)
Visited at least x Perl related events
(Co)maintain at least x active (up-river) CPAN modules
Forgotten you were not Larry Wall
One can never truly know Perl
Results (301 votes). Check out past polls.