Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: Why won't say act like say when its tied?

by ELISHEVA (Prior)
on Mar 07, 2011 at 17:51 UTC ( #891871=note: print w/replies, xml ) Need Help??

in reply to Re: Why won't say act like say when its tied?
in thread Why won't say act like say when its tied?

print appends the value of $\ to the end of whatever is passed to print, so if $\="***\n", then {print "hello", "\n"; } outputs "hello\n***\n" not plain "hello\n". That's why it is important for say to set local $\="\n" and not just add "\n" to the end of the list of things to print. Hope that helps.

Replies are listed 'Best First'.
Re^3: Why won't say act like say when its tied?
by Anonymous Monk on Mar 07, 2011 at 19:45 UTC
    Thanks, it does. So the intended behavior for say is to write exactly what the programmer intended plus \n without side effects from punctuation variables. Good to know.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://891871]
[hippo]: Benchmarking?
[GotToBTru]: hippo++
erix .oO( apparently but does not GotToBFast )
[Discipulus]: now i must come back to my house/hoven monks: dont do interesting discussion in my absence!
[erix]: or apparently, now it does :)
[GotToBTru]: heh
erix prods ambrus to (re-)start cbstream...
[GotToBTru]: I've got a program with an if ... or ... statement with 80 clauses
[stevieb]: 80 clauses? dispatch table?

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2017-06-22 12:56 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (519 votes). Check out past polls.