|go ahead... be a heretic|
Re: very new to perl; suggestions for porting this shell script to perl?by Cristoforo (Deacon)
|on May 28, 2011 at 16:25 UTC||Need Help??|
Not knowing Unix systems, I can't offer too much help. It would be very helpful to provide about 50+ lines of your output to show how you want the results of the program. I'm sure there are many improvements that could be made. For one, the line:
It could be better stated:
my @Files = grep /\.desktop$/, readdir DIR;
grep will only pass *.desktop files to @Files
If you plan on writing Perl scripts, it would be advisable to declare your variables, (usually with 'my'), and to include the lines (at the beginning of your script):
These will tell you of errors in your code syntax, spelling mistakes, etc. You will find nearly all the code on this site follow that method.
Update: It would also be helpful to see some of the input files, in paticular, lines that match Categories and Name and Exec.
One last thing - it would be nice to enclose these sample inputs and outputs in <readmore>. . .</readmore> tags so your post doesn't take so much space. :-)