Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: csv file is not opening using use strict

by Rudolf (Monk)
on Sep 06, 2012 at 23:13 UTC ( #992207=note: print w/ replies, xml ) Need Help??


in reply to csv file is not opening using use strict

If the file exists your program should open it fine, atleast mine does (win7), however I think your mistake may be in the opening statement. the parameter '<' is the read only .. if the file has not yet been created and you want to create it use the '>' param. also the '>>' is used for appending. Sory if this doesnt help I am thinking of other reasons why you might be getting yelled at.

open(FILE,'>',"file.csv") or die;


Comment on Re: csv file is not opening using use strict
Download Code
Replies are listed 'Best First'.
Re^2: csv file is not opening using use strict
by chromatic (Archbishop) on Sep 06, 2012 at 23:30 UTC

    I don't understand; the OP clearly wants to read a file. Why suggest a change that will write a file? If the file doesn't exist, the code as posted will give an error message to that effect.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (16)
As of 2015-07-31 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls