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

Re: write() removes trailing spaces

by ioannis (Prior)
on Jun 09, 2006 at 08:35 UTC ( #554445=note: print w/replies, xml ) Need Help??


in reply to write() removes trailing spaces

There is nothing strange. The following altered code demonstrates that your $c variable contains 13 chars , which you want displayed within 11 space holders (1+10). Two chars werer choped, as per your request .
format STDOUT = @<<<<@<<<<@<<<<<<<<<<END $a, $b, $c . $a = "a"; $b = "b"; $c = "c .bc"; print 'len=',length $c; write(STDOUT);

Produces this output:

len=13 a b c .END

Replies are listed 'Best First'.
Re^2: write() removes trailing spaces
by jesuashok (Curate) on Jun 09, 2006 at 08:41 UTC
    Hi ioannis

    Thanks for your reply.

    what will happen if $c is only

    $c = "c ";
    The last spaces are removed. This detail is not documented in any of the perl documents.

    "Keep pouring your ideas"
      if $c is set to 'c ', then it will append 9 spaces at the end, so the string can occupy the 11 posisions. (Remember, it is 1 + 10 .)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://554445]
help
Chatterbox?
[Discipulus]: LA something a little more perlish? @mts = map {qx!mp3info -p $_!} glob '/path/*.mp3 (hazarded code)
[Discipulus]: many monks want to be hired tonight, other haired and some aired
[Lady_Aleena]: Discipulus, do glob recurse?
[Lady_Aleena]: s/do/does/;
LanX wants to be fired
[Discipulus]: i fear no
[Discipulus]: i invented also 'gired'
[Lady_Aleena]: Discipulus, then that is a problem. I wanted to find total seconds of my entire .mp3 collection to do some math on it to see how many days of continuous music i have.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-04-23 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.