Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.

by GrandFather (Saint)
on Dec 23, 2014 at 08:20 UTC ( [id://1111153]=note: print w/replies, xml ) Need Help??


in reply to Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.

'.' is the current directory and '..' is the parent directory. Neither is a file so you can't open them as a file. You can test for files and skip anything that's not a file:

for my $fileName (@files) { next if ! -f $fileName; open my $in_fh, '<', $fileName; ... }
Perl is the programming world's equivalent of English
  • Comment on Re: Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.
  • Download Code

Replies are listed 'Best First'.
Re^2: Have a multiple file in directory and want to manipulate in each files in incremental order. All the file have same value.
by graff (Chancellor) on Dec 23, 2014 at 09:05 UTC
    Or, to put that into "plain English" perl:
    for my $fileName ( @files ) { next unless -f $fileName; ... }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1111153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-23 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found