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

Re: perl deprecated functions and alike

Thread Previous | Thread Next
From:
Octavian Râsnita
Date:
February 14, 2009 23:56
Subject:
Re: perl deprecated functions and alike
Message ID:
5D024DF13AEA4142AF93B5095BBE2827@teddy
From: "John W. Krahn" <jwkrahn@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?

I have tried the script below, and of course it doesn't print anything:

use strict;

my $path_to_directory = '/';

my @files = <$path_to_directory>;

foreach my $file(@files) {
print "$file\n";
}

Thanks.

Octavian


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