Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: read(x,y,z)

by tadman (Prior)
on Jun 28, 2002 at 21:49 UTC ( [id://178163]=note: print w/replies, xml ) Need Help??


in reply to read(x,y,z)

First, check that you're using strict and -w. I think you're getting errors that you can't see. In that case, check your log file.

Second, the way this operates depends a lot on how you're calling it. If you're opening a pipe, it could break, and then things could fall apart.

I have a sneaking suspicion, though, that you're doing something like this:
my $file = "foo.txt"; my $data; read($file, $data, 1024);
Note that read operates on a file-handle, not a file name. These need to be opened:
my $file = "foo.txt"; open ($fh, $file) || die "Could not open file $file\n"; my $data; read($fh, $data, 1024);
If you're feeling more progressive, you might try and use IO::Handle instead of the read anachronism.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-23 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found