Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: write command failing (perlform IO::Handle ->format_write)

by Anonymous Monk
on May 10, 2018 at 21:00 UTC ( [id://1214353]=note: print w/replies, xml ) Need Help??


in reply to write command failing

Hi,

Since @_ is global, you can use constants to NAME your variables

package X10::Config; use constant +{ qw{ TYPE 0 NAME 1 ACTION 2 } }; use namespace::clean; # "undefine" TYPE/NAME...outside of this scope format outputFormatGroup = @<<<<<<<< @<<<<<<<<<<<<<<<<<<<< @<<<< $_[TYPE], $_[NAME], $_[ACTION] . sub printConfigGroup { use IO::Handle; OUTPUT_HANDLE->format_write('outputFormatGroup'); }

Then later on something akin to

printConfigGroup( $struct->type, $struct->name, $struct->hu );

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-20 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found