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

Re^5: Sort then conditionally sort

by kyle (Abbot)
on Apr 10, 2009 at 16:56 UTC ( #756873=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Sort then conditionally sort
in thread Sort then conditionally sort

Have a look at open and print. This code does nothing but copy an input file to the output file to show their use. For your application, you'll want to do a lot more "stuff" between the reading and writing.

my $in_filename = 'in.txt'; my $out_filename = 'out.txt'; open my $in_fh, '<', $in_filename or die "Can't read '$in_filename': $!"; open my $out_fh, '>', $out_filename or die "Can't write '$out_filename': $!"; while ( my $in_line = <$in_fh> ) { print {$out_fh} $in_line; } close $in_fh or die "close failed: $!"; close $out_fh or die "Close failed: $!";


Comment on Re^5: Sort then conditionally sort
Download Code
Re^6: Sort then conditionally sort
by lukez (Initiate) on Apr 13, 2009 at 02:29 UTC
    thank you Kyle , I will try to adapt to the other code you made....wish me luck.... thank you for all your help

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2014-09-17 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (57 votes), past polls