in reply to Someone please verify this.

A few things off the top of my head...

$efile isn't an array, so getting it's length in the for-loop wouldn't work. (nor should $efile[$i])

$var and $end in the regex - where do those come from? They're not declared anywhere...

Big tip here - changed my life forever when I first heard it: start every script with these two lines:
use strict; use warnings;
Your perl skills will improve immensely, as will your code logic, and your teeth and hair will gain a healthy sheen.

Replies are listed 'Best First'.
Re^2: Someone please verify this.
by GrandFather (Saint) on Jul 10, 2007 at 04:40 UTC

    The $ for $var and for $end is quoted so they are literal matches.


    DWIM is Perl's answer to Gödel