Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: New Perl User Question

by CharlesClarkson (Curate)
on Feb 02, 2002 at 13:10 UTC ( #142909=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $process_file_name = shift @ARGV;
  2. or download this
    # file name for corrected data
    my $clean_file_name = "$processfilename.clean";
    
    ...
    # report the number of lines read, and written
    my $raw_file_length     = 0;
    my $clean_file_length   = 0;
    
  3. or download this
    &ProcessFile;
  4. or download this
    my($raw_file_length, $clean_file_length) =
        process_file(
            $process_file_name, $clean_file_name, $correct_start_char,
            $correct_start_length, $correct_clean_length, $typed_length);
    
  5. or download this
    my @args = (
            $ARGV[0],           # file to process
        
    ...
    
    
    my($raw_file_length, $clean_file_length) = process_file( @args );
    
  6. or download this
    print "$raw_file_length lines read from $args[0]\n";
    print "$clean_file_length lines written to $args[1]\n";
    
    print "\a";
    exit(0);
    
  7. or download this
    chomp $data; 
    chop $data; 
    $data = reverse ($data); 
    chop $data; 
    $data = reverse ($data); 
    
  8. or download this
    $data = substr($data, 1, -2);
  9. or download this
    chomp $data; 
    $datalengthtrack--; 
    chop $data; 
    ...
    } 
    $data = reverse ($data); 
    print CLEANFILE "$data\n";
    
  10. or download this
    print CLEANFILE substr( substr($data, 0, -2), -$correct_clean_length), "\n";
  11. or download this
    if ( $start_char == $correct_start_char ) {
        next if $data_length != $correct_start_length;
        if ( $data_length == $correct_start_length ) {
    ...
            $clean_file_length++;
        }
    }
    
  12. or download this
    my (  $file_name, $clean_file_name, $correct_start_char,
            $correct_start_length, $correct_clean_length, $typed_length) =
    + @_;
    
  13. or download this
    open RAW,   $file_name          or die "Cannot open $file_name: $!";
    open CLEAN, ">$clean_file_name" or die "Cannot open $clean_file_name: 
    +$!";
    
  14. or download this
    my($raw_lines, $clean_lines);
  15. or download this
    my($raw_file_length, $clean_file_length)
  16. or download this
    #!/usr/bin/perl
    ####################################################
    # InvClean.pl : Raw Scanned File Processing program
    ...
    }
    
    __END__
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-08-31 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls