|
|
| go ahead... be a heretic | |
| PerlMonks |
How do i take the first 4 characters of any file name in a specified directory?by Anonymous Monk |
| on Sep 17, 2008 at 06:02 UTC ( #711881=perlquestion: print w/ replies, xml ) | Need Help?? |
|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
Hi
How do i take the first 4 characters of any file name in a specified directory? I have tried this. #!/usr/bin/perl -w @namearr = `ls -l /usr/C`; foreach $nameline (@namearr) { print ("$nameline\n"); @name1 = $nameline; print ("$name1 [3]"); } where C is a directory. Thanks
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||