in reply to Help with import of module

If you want to use subroutine names as barewords, you have to declare them in the compilation phase, i.e. through use or in a BEGIN block. Otherwise, just add the parentheses around the subroutine's arguments.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Help with import of module
by panman (Initiate) on Sep 21, 2015 at 21:02 UTC
    In case someone googles this, here is how I fixed it
    if (eval { require IO::Compress::Gzip } ) { use subs qw (gzip); use vars qw ($GzipError); IO::Compress::Gzip -> import ( qw (gzip $GzipError) ); $status = gzip "${FileName}" => "${FileName}.gz" or _error "gzip f +ailed: $GzipError\n"; } else { system qq[gzip -c ${FileName} > ${FileName}.gz]; }