develooper Front page | perl.beginners | Postings from April 2012

chomp

Thread Next
From:
Somu
Date:
April 5, 2012 13:34
Subject:
chomp
Message ID:
CAL5VgOk7gptgGZt2yd5YKrsYVxyvGNvr1ZYEbQOZjB-dz_Khfg@mail.gmail.com
Hello everyone,

#this code works for any valid input
#
use strict;
use warnings;

print "\n\n\tEnter directory : ";
my $path = <>;
chomp($path);                           #but if this line is eliminated, it
shows d drive(current drive) for any input
my @files = glob "$path/*" or die;
print "\n\n\tReading file names in $path";
print "\n\n\tFiles are :\n";
foreach ( @files ){print;print"\n";}
print "\n\n";
system('pause');


What's going on??

Somu.


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