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

Re: perl deprecated functions and alike

Thread Previous | Thread Next
From:
Chas. Owens
Date:
February 14, 2009 16:12
Subject:
Re: perl deprecated functions and alike
Message ID:
58ce48dc0902141612i382c3ba2r1b96c3434d77e3ec@mail.gmail.com
On Sat, Feb 14, 2009 at 17:54, Kevin <kevinwat@gmail.com> 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.
snip

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
wonkden.net
The most important skill a programmer can have is the ability to read.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About