[lug] Quick perl question

Rob Nagler nagler at bivio.biz
Thu Dec 12 08:44:44 MST 2002


Chip Atkinson writes:
> $slash = $/;
> 
> $/ = undef;
> 
> $file = <>;
> 
> $/ = $slash;
> 
> $file =~s/<(\w+)>/$substfields{$1}/g;
> 
> print $file;

Save yourself some typing (and bugs :) by:

    {
    	local($/);
	$file = <>;
    }
    $file =~s/<(\w+)>/$substfields{$1}/g;
    print $file;

Rob






More information about the LUG mailing list