Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: reading N files

by polettix (Vicar)
on Jul 19, 2006 at 14:42 UTC ( #562303=note: print w/replies, xml ) Need Help??


in reply to reading N files

The problem is that the IN you open is the same at each iteration, because it is the filehandle slot into the IN symbol in package main. In your case, it is the same as using global variables: you always access the same variable, and you keep writing on it.

The solutions are in Fletch's post.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2021-10-27 12:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (92 votes). Check out past polls.

    Notices?