Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: split a line by control ^D character

by karlgoethebier (Parson)
on Dec 02, 2012 at 18:37 UTC ( #1006743=note: print w/replies, xml ) Need Help??

in reply to split a line by control ^D character


#!/usr/bin/perl + use strict; use warnings; use IO::All; my $io = io( shift ) || die $!; for ( $io->getlines ) { print join( qq(|), split /\x04/ ); } __END__ Karls-Mac-mini:monks karl$ perl -e 'for( 1..3 ){ print qq(foo\x04bar\x +04baz\n) };' > records.dat Karls-Mac-mini:monks karl$ cat records.dat foobarbaz foobarbaz foobarbaz Karls-Mac-mini:monks karl$ ./ records.dat + foo|bar|baz + foo|bar|baz + foo|bar|baz + + +

See IO::All

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006743]
[stevieb]: We've had so much snow here this year that the whole area is pretty much under constant avalanche warnings (and avalanches pretty much daily all over the place)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2017-02-23 17:25 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (350 votes). Check out past polls.