[root@mysql1 perl]# cat test.pl
#!/usr/bin/env perl
while (defined($line=<>)) {
chomp($line);
print "it was $line that i saw!\n";
}
[root@mysql1 perl]# ./test.pl a.txt b.txt
it was a that i saw!
it was b that i saw!
it was c that i saw!
it was d that i saw!
it was e that i saw!
it was i was the end! that i saw!
it was a that i saw!
it was b that i saw!
it was c that i saw!
it was d that i saw!
it was e that i saw!
it was i was the end! that i saw!
[root@mysql1 perl]# cat a.txt
a
b
c
d
e
i was the end!
[root@mysql1 perl]# cat b.txt
a
b
c
d
e
i was the end!
#!/usr/bin/env perl
while (defined($line=<>)) {
chomp($line);
print "it was $line that i saw!\n";
}
[root@mysql1 perl]# ./test.pl a.txt b.txt
it was a that i saw!
it was b that i saw!
it was c that i saw!
it was d that i saw!
it was e that i saw!
it was i was the end! that i saw!
it was a that i saw!
it was b that i saw!
it was c that i saw!
it was d that i saw!
it was e that i saw!
it was i was the end! that i saw!
[root@mysql1 perl]# cat a.txt
a
b
c
d
e
i was the end!
[root@mysql1 perl]# cat b.txt
a
b
c
d
e
i was the end!