Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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'

Replies are listed 'Best First'.
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'
        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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012762]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2018-06-23 06:37 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.