Posted:
Wed Jun 07, 2006 8:00 am (17 years, 10 months ago)
I want the line begining with the code s$ be printed ot. Just that line. If I do it the way shown below, it only prints the first line. What am I doing wrong? Somebody help me here!
#!/usr/local/bin/perl
print "Enter the input filename: ";
chomp ($filename = <STDIN>);
s$=1234;
open INPUT, "<$filename" or die "Can't open input file: $!\n";
while ($line = <INPUT>) {
chomp $line;
$accession = substr($line, 0, 4);
if ($password = $accession){
print $line;
exit;
}
print "$accession\n";
}
close INPUT;
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.