|Do you know where your variables are?|
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??|
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. :-)