Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: What is the most efficient way to split a long string (see body for details/constraints)?

by jwkrahn (Abbot)
on Jun 19, 2019 at 18:14 UTC ( [id://11101586]=note: print w/replies, xml ) Need Help??


in reply to What is the most efficient way to split a long string (see body for details/constraints)?

You can do what you want without creating an array by using a list slice:

# Copy only the desired fields to create a new # line in TSV format # This can be done in one simple step in Perl, using # list slices and the join() function my $new_line = join "\t", ( split /\t/, $_ )[ 2, 3, 12 .. 18, 25 .. +28, 31 ]; # ...

Replies are listed 'Best First'.
Re^2: What is the most efficient way to split a long string (see body for details/constraints)?
by Anonymous Monk on Jun 21, 2019 at 18:39 UTC
    If this in fact prevents a list temporary object from being created (i.e., slices in-place), it is an interesting approach I will consider...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found