Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: put file content into a string

by ptum (Priest)
on Dec 19, 2005 at 16:14 UTC ( [id://517776]=note: print w/replies, xml ) Need Help??


in reply to put file content into a string

First, you don't seem to check to see if the open works. This seems a critical flaw. Try something like this:

open IN, "<myFile" or die "Could not open myFile: $!";

Second, you will only get the first line of the file, unless you muck with the record separator. You may want to append to your $str variable inside a while loop.

Hope that helps. :)


No good deed goes unpunished. -- (attributed to) Oscar Wilde

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found