Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Adding '#' in the beginning of each line

by Hofmator (Curate)
on Aug 16, 2006 at 09:56 UTC ( [id://567647]=note: print w/replies, xml ) Need Help??


in reply to Re: Adding '#' in the beginning of each line
in thread Adding '#' in the beginning of each line

davorg++

Concerning the usage of $", one could augment your solution by doing

my @file = <>; $" = '#'; print "#@file"; # ^^^
but that just adds obscurity to an already obscure solution. So I agree with your assessment of the homework-giver.

On a funny sidenote, something like the following also uses $" :)

$" = '#'; print $", $_ while <>;

-- Hofmator

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2024-04-25 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found