Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Making a variable tab string

by bart (Canon)
on Feb 21, 2007 at 12:43 UTC ( [id://601316]=note: print w/replies, xml ) Need Help??


in reply to Making a variable tab string

You seem to have mistyped "tabs\t" for "$tabs\t". In that case, you can use the more elegant operator .=:
for ($i = 0; $i < $numTabs; $i++) { $tabs .= "\t"; }

But, like jwkrahn wrote: you might as well use x instead of the loop, so this becomes:

$tabs .= "\t" x $numTabs;

Replies are listed 'Best First'.
Re^2: Making a variable tab string
by sandrider (Acolyte) on Feb 22, 2007 at 00:08 UTC
    Thank you.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-18 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found