![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^4: a REFERENCE of array of hashesby why_bird (Pilgrim) |
on Jun 24, 2009 at 13:25 UTC ( #774392=note: print w/replies, xml ) | Need Help?? |
You need to specify a 'mode' when you use open. This means that you specify whether you want to read from or write to a particular file (you can do both, but you don't need that for now).
check out here for some more info on filehandles. Also bear in mind that you can either not declare a filehandle, and just use a plain text word, e.g. open(INPUT,"<","input_file.txt); or you can declare a variable as I did in the example above. IMO it's a better habit to get into to use a variable, as you start to get into trouble when/if you try to pass filehandles around subs (later..!) hope this helps.why_bird Those are my principles. If you don't like them I have others. -- Groucho Marx .......
In Section
Seekers of Perl Wisdom
|
|