Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: confused

by davorg (Chancellor)
on May 15, 2002 at 15:26 UTC ( [id://166747]=note: print w/replies, xml ) Need Help??


in reply to Re: confused
in thread @ARGV / Command Line Arguments

If it was my script, I'd write it like this:

#! /usr/local/bin/perl -w use strict; die "Not enough params!!!\n" if @ARGV < 3; my ($input, $output, $length) = @ARGV; open INPUT, $input or die "unable to open $input: $!\n"; open OUTFILE, ">$output" or die "unable to open $output: $!\n"; my $count = 1; while (<INPUT>) { chomp; ++$count if />/; if (length >= $length) print ">$count\n$_\n\n"; print OUTFILE ">$count\n$_\n\n"; } } close INPUT; close OUTFILE;
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://166747]
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-04-25 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found