laziness, impatience, and hubris | |
PerlMonks |
Re: Perl embedded in Kornshellby perigeeV (Hermit) |
on Sep 02, 2001 at 05:32 UTC ( [id://109693]=note: print w/replies, xml ) | Need Help?? |
You can't just stick perl in front of a shell script. Why not just make the the whole thing a perl script. The only thing you're doing in shell is passing the contents of two files to be acted upon, and then redirecting the output to another file. Pick a language. Do it with either perl or ksh. In Perl (since this is Perl Monks) just open each file: I don't know how the contents are arranged in your files, but suck out its tasty fillin':
Do the same to the other input file, twist and spindle the data to your nefarious ends, and then open an output file:
You have many more issues to deal with regarding your Perl syntax. You're omitting semi-colons at the end of each statement. Arguments are passed via the special @ARGV array, not the "numbered" variables. $1, $2, etc. do something else in Perl. Instead of else if, you use elsif. Try the handy Tutorials section.
In Section
Seekers of Perl Wisdom
|
|