Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -wT
    use strict;
    ...
    };
    
    print "length = $length\n";        # "length = 331" on my machine
    
  2. or download this
     ($string =~ /\d+/g)[0];
    
  3. or download this
    my $length = (`wc -l $filename` =~ /\d+/g)[0];  # get output of wc
    die "wc error $?" if $?;        # die if wc chokes for some reason