Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Help with import of module

by choroba (Cardinal)
on Sep 21, 2015 at 16:18 UTC ( [id://1142642]=note: print w/replies, xml ) Need Help??


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]; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1142642]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-19 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found