Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Code that feels good

by Anonymous Monk
on Aug 25, 2001 at 01:46 UTC ( #107731=note: print w/replies, xml ) Need Help??


in reply to Code that feels good

Having just convinced a co-worker that:
print join('^',split(/\s+/,$_)),"\n";
was much nicer than
my ($field1,$field2,$field3) = split(/\s+/,$_);
print "$field1^$field2^$field3\n";
I can say that code can feel good. ----

Replies are listed 'Best First'.
(MeowChow) Re2: Code that feels good
by MeowChow (Vicar) on Aug 25, 2001 at 06:48 UTC
    print join('^', /\S+/g), $/

    ... feels even better :-)

       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (None)
    As of 2021-10-19 03:30 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My first memorable Perl project was:







      Results (76 votes). Check out past polls.

      Notices?