Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: loop da loop chomp chomp loop chomp blurp oops

by lidden (Curate)
on Feb 02, 2008 at 19:06 UTC ( #665758=note: print w/replies, xml ) Need Help??


in reply to loop da loop chomp chomp loop chomp blurp oops

You want something like this (untested):
use strict; use warnings; my $num_of_sim = shift; my $me; chomp($me = `id -un`); my $PATH = "/home/$me/src/Tc/Scheme4/Simulation$num_of_sim"; open my $fh ,'<', "$PATH/subfile" or die "Cannot open subfile: $!"; my @row_data = <$fh>; close $fh or die $!; my $i = 0; for my $line (@row_data) { open my $file_out, '>', "$PATH/subfile$i" or die "Cannot open subf +ile$i: $!"; print $file_out $line; $i++; # last if $i > 2967 # Needed if the file has more then 2968 lines }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2023-12-02 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (13 votes). Check out past polls.

    Notices?