Octavian Râsnita wrote:
From: "John W. Krahn" <jwkr...@shaw.ca>
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.

AFAIK that is not deprecated.

Can you explain how it works?

It is a file glob that returns a list of file names. If $path_to_directory contains '/path/to/file' then:

@files = <$path_to_directory>

is the same as saying:

@files = '/path/to/file'

Whereas if $path_to_directory contains '/path/to/*' then @files will be assigned a list of non-hidden file names.

perldoc -f glob
perldoc File::Glob
perldoc File::DosGlob



John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to