in reply to An REAL array of hashes
#!/usr/env/perl
Next, always use strictures---something like this:
#!/usr/env/perl use strict; use warnings; use diagnostics;
Next, you can run your script using the perl debugger
perl -d yourscript.pl
The debugger will start the script and a prompt will popup. At the prompt, enter the first line of code
x my $data = "clients.dat";
Something like 'clients.dat' will come back, so there's the first error: "clients.dat" should be 'clients.dat'. Be sure to use x my $data = "clients.dat" because the "x" will make it correct the mistake for you. If you just enter "my $data = "clients.dat"", then nothing will happen. Pretty simple, no? Enter each line thru the end of the script.
Next, you'll want to straighten-up your code, make it prettier so to speak. Download and install Perl::Tidy. Then from the command line: perltidy yourscript.pl
Lastly, since you are new to Perl, you'll want to download and install Perl::Critic. Then enter on the command line:
perlcritic yourscript.pl
Be sure to check the documentation. There's a lot that you can do with perlcritic, and it will definitely help you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: An REAL array of hashes
by moritz (Cardinal) on Jun 24, 2009 at 07:22 UTC |