in reply to [resolved] Can't use string ("0") as a symbol ref while "strict refs" in use

filehandles are SCALARs, first argument to open is a filehandle, it forces scalar context, @array in scalar context is number of elements (zero), open will try to treat 0 as a filehandle, strict refs forbids it (good)

Use a scalar ( my($fh) )

read perlintro, Tutorials: Context tutorial

  • Comment on Re: Can't use string ("0") as a symbol ref while "strict refs" in use