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).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: print and extract the line
by ww (Archbishop) on Jul 07, 2010 at 18:25 UTC |
In Section
Seekers of Perl Wisdom