Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: IO::Tee problem (Well, problem with my brain, anyway)

by pobocks (Chaplain)
on Mar 23, 2009 at 16:26 UTC ( #752648=note: print w/replies, xml ) Need Help??


in reply to Re: IO::Tee problem (Well, problem with my brain, anyway)
in thread IO::Tee problem (Well, problem with my brain, anyway)

The problem is that the input file triples, while the output file doubles.

As far as I can tell, I'm slurping the entire file (previous to any additions), and then foreaching over a simple array and printing the file once. I should get a doubled copy in the input file, and a single copy in the output file.

I've checked (with a print statement) and @lines contains only a single copy of the input file.

for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";

Replies are listed 'Best First'.
Re^3: IO::Tee problem (Well, problem with my brain, anyway)
by apl (Monsignor) on Mar 23, 2009 at 17:15 UTC
    Why do you want to echo your input back to your input file?

      I was testing a statement made in Intermediate Perl; I don't really have a concrete use in mind. Right now, my main goal is to find out why it's doubling the output, so I can know how it works (and what I'm missing/doing wrong, assuming it's not an oddity in IO::Tee or something).

      for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2022-12-06 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?