Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: joining files

by dada (Chaplain)
on Oct 17, 2002 at 13:28 UTC ( #206015=note: print w/replies, xml ) Need Help??


in reply to Re: joining files
in thread joining files

...and who's gonna chomp the lines? :-)

regarding perl6, here's how I would do it (untested code, of course :-)

require 6.0; # yeah, sure my $f1 is chomped = IO::File.new( shift ) or die("ack - $!"); my $f2 is chomped = IO::File.new( shift ) or die("ack - $!"); my @f1 is from <$f1>; my @f2 is from <$f2>; my @join = @f1 ^_ @f2;
but this way you can't have a space between the lines from $f1 and $f2...

Update: actually, this seems to work:

my @join = @f1 ^_ " " ^_ @f2;
...I'm such a newbie :-)

cheers,
Aldo

King of Laziness, Wizard of Impatience, Lord of Hubris

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2022-05-20 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?