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.
Use subroutines for code reuse
Master regular expressions
Write my GUIs with Perl
Abandon CGI in favor of some modern web framework
Put my code in modules
Create CPAN distributions
test and document my code as I write it
Write OOP with or without animal help
Finally switch to a modern Perl style
Create a killer application with Perl
Detoxify from Perl and PerlMonks
Choose another language because Perl is dead
Learn to program for mobile devices
Complete my secret world domination project
None, because the road to hell is paved with good intentions
Results (249 votes),