Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Broken Write function? Does anyone have Magic fixer ability?

by tobyink (Abbot)
on Jan 10, 2013 at 23:55 UTC ( #1012762=note: print w/ replies, xml ) Need Help??


in reply to Broken Write function? Does anyone have Magic fixer ability?

open(IN2 , '>', $filename2); ### "IN2" print IN "Invalid Addresses:\n\n\n"; ### "IN" !!!

(Of course, why you're calling an output file "IN" is another mystery...)

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Broken Write function? Does anyone have Magic fixer ability?
Download Code
Re^2: Broken Write function? Does anyone have Magic fixer ability?
by ProgrammerJutsu on Jan 11, 2013 at 00:01 UTC
    it worked the first time =D, I still don't see the error...
    will changing the name really matter?

      "I still don't see the error..."

      You are opening one file handle (called "IN2") and then trying to print to another file handle (called "IN"). They are two different handles.

      Imagine that file handles are closed doors. You open one door, but try to walk through another door. Does that work? If you are in any way unsure, find a room with two doors and try it.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
        Thanks,
        xD but its still not getting any values to the doc

      No, naming doesn't matter at all. You just name file handles because stuff looks way cooler that way. It's got nothing to do with being able to tell one entity from another.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-07-30 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (231 votes), past polls