Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I am using the following code:
use stritct; use Tie::File; tie my @lines, Tie::File, $infile; delete $lines[-1];

and I get an error:
Bareword "Tie::File" not allowed while "strict subs" in use

Can you tell me what I am doing wrong?

Replies are listed 'Best First'.
Re: Can you help as to why I get this error?
by choroba (Cardinal) on Mar 17, 2016 at 16:16 UTC
    Under strict, you can't use class names as first-class citizens. You have to quote them:
    tie my @lines, 'Tie::File', $infile;

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      Damn! silly me... thank you very much!