Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Missing \t in print output

by Sophienz (Acolyte)
on Jul 15, 2015 at 09:53 UTC ( [id://1134844]=note: print w/replies, xml ) Need Help??


in reply to Re: Missing \t in print output
in thread Missing \t in print output

Hi,

Sorry if I misunderstood what you were asking earlier.

1. I have read the documentation for join, and as far as I can tell, I'm doing it properly. I have tried changing the double quotes to single quotes but that actually made printed \t instead of the tabs themselves

2. The printflush method comes from http://perldoc.perl.org/IO/Handle.html, which states that "$io->printflush ( ARGS ) Turns on autoflush, print ARGS and then restores the autoflush status of the IO::Handle object. Returns the return value from print."

However, this doesn't make any difference to my output from when I just use print:

my $printing = join("\t",@arrayToPrint); $normal_fh->print("$printing\n");

Thanks for your help, I will update with any progress.

Replies are listed 'Best First'.
Re^3: Missing \t in print output
by ww (Archbishop) on Jul 15, 2015 at 12:08 UTC

    Thank you for the clarification.

    But you never showed us parts of your code -- the hashbang, if any, and the use IO::Handle;. That would have forestalled my concern about the appearance of printflush without a predicate. Discipulus sussed that out, but obviously, I didn't... and, in any case, we often see problems such as using a function from a module without useing the module. Those cases make it very hard to help if the code presented isn't an exact copy of the code which generated anomalies or errors.

    BTW, the preceding para may have some value for you but I hope it also provides some benefit for future newcomers who stumble upon it.

    And, as has already been said, welcome to PM.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1134844]
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-26 03:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found