Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: removing square brackets

by softworkz (Monk)
on Oct 20, 2005 at 23:42 UTC ( #501849=note: print w/ replies, xml ) Need Help??


in reply to Re^2: removing square brackets
in thread removing square brackets

I agree with kwaping, I would use tr/// for this solution.

#!/usr/bin/perl -w use strict; while (<DATA>) { chomp; tr/[]//d; $_ = join(" ",split " ", $_); print "$_\n"; } __DATA__ [ [ 0.039543323] [ 0.068993981] [ 0.086558227] [ 0.12252527] [ 0.14724698] [ 0.16631099] [ 0.18877556] [ 0.20234162] [ 0.18110326] [ 0.13155017] [ -4.0316574] [ -3.6178487] [ -3.1186917] ]


Comment on Re^3: removing square brackets
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2015-07-04 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls