DCPM: perltutopen blues....

Simon Waters Simon at wretched.demon.co.uk
Fri Jul 4 17:37:56 CDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matthew Browning wrote:
>
> Have a look at one of the GetOpt modules.  GetOpt::Simple?

For better or worse, I went with Getopt::Long, on the basis that I hope
it does the same as the similar named C routine.

> for( @filesFromCommandLine ) {
>
>   my $object = Chess::PGN::Parse->new( $_ );
>
>   $object->interesting_chess_related_method();
>
>   push @array_of_objects, $object;
> }
>
> Let us know if I have misinterpreted the question.

Thanks, I think I was just getting confused with the documentation. I'm
still slightly vague on when perl is doing file handles, and when it is
expecting file names... When they look vaguely like good old fashioned
Bourne shell file handles all is clear.

My script has gained a plethora of "options", including the ubiquitous
"--debug" ;-)

Maybe trying to learn emacs and perl at the same time was a bit
ambitious, but it will be the best indented code I've written in ages.

Next fun bit will be a signal handler, it all looks simple("use sigtrap"
?), but I never seen to find any example scripts - maybe I should
squander another book token. Hmm 15GBP book tokens, 10GBP extra if WH
Smiths... I'll go check the review section.

Then ensuring it is self documenting.... then sorting the output
routines, and I'll be ready to fix the special cases...

 Simon

BTW:

Why does "use warnings" dislike "@array[2]" and suggest "$array[2]",
seems less clear to me, or am I missing something elementary?

-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/BgHAGFXfHI9FVgYRAuJsAKDDp8gke09wKifxE0p3g6mwIeVBhwCgvQ2o
BC6P6zqyJQnntUVjIuqh9Q4=
=C4C+
-----END PGP SIGNATURE-----



More information about the Devoncornwall-pm mailing list