develooper Front page | perl.beginners | Postings from February 2009

Re: perl deprecated functions and alike

Thread Previous | Thread Next
Chas. Owens
February 14, 2009 16:12
Re: perl deprecated functions and alike
Message ID:
On Sat, Feb 14, 2009 at 17:54, Kevin <> wrote:
> Could someone please direct me to some web pages where I can go through
> all deprecated perl functions and/or ways of writing perl script?  It is
> not easy for me to figure out whether an on-line example is deprecated or
> not.  I once saw:
> @files = <$path_to_directory>
> on the web and found it worked perfectly, then kept using this way of
> writing my perl script.  But I was told yesterday such a script is
> deprecated now.  I searched the internet for awhile and did not find a
> good resource.  Please give me a couple of links if you know.

Did he or she say why he or she thought it was deprecated.  I really
only see one issue (besides the lack of a semicolon): you don't have a
my in front of @files.  Now it is possible @files was declared
earlier, but most often a variable, especially and array, only gets
directly assigned a value once during its life.  This leads me to
believe you are coding without the strict pragma, which is a very
large mistake in my book.

If you are interesting in learning modern Perl style I would suggest
picking up a copy of Perl Best Practices by Damian Conway.

Chas. Owens
The most important skill a programmer can have is the ability to read.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About