Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: print and extract the line

by Hugmeir (Sexton)
on Jul 07, 2010 at 15:37 UTC ( #848490=note: print w/ replies, xml ) Need Help??


in reply to Re^2: print and extract the line
in thread print and extract the line

I can't quite make head or tails of your posts, but I'm bored anyhow, so here's my take:

#! /usr/bin/perl -w use strict; die "Not enough arguments" if $#ARGV < 2; my ($start, $end, $file) = @ARGV; open FILE, $file or die "Couldn't open file"; while (<FILE>) { my @chars = split //; print @chars[$start..$end], "\n" if @chars >= $end; }

It's quite a derail, but if someone could point me towards a node with examples or some sort of documentation of autodie, I'd be grateful (my Super Search-fu isn't strong).


Comment on Re^3: print and extract the line
Download Code
Re^4: print and extract the line
by ww (Bishop) on Jul 07, 2010 at 18:25 UTC

    + + for effort & brevity

    Note, however, that this code prints six-character strings, whereas OP's example output (in the narrative) looks for only five.

    As for autodie and your search fu, Super Search doesn't require a whole lot of fu;
    here's the output where the only input was "autodie": ?node_id=3989;BIT=autodie

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-08-20 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls