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

[SOLVED] Pack/unpack - understanding the '@' and '.' templactes

by ateague (Monk)
on Mar 30, 2013 at 19:14 UTC ( #1026297=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    say unpack '(C.*/X/xa@1)3', "\003\003\003abcdef"; # prints 'aaa'
    say unpack '(C.*/X/xa@1)3', "\005\004\003abcdef"; # prints 'cba'
    
  2. or download this
    say unpack '(C/xa@)3', "\003\003\003abcdef"; # prints 'bcd'
    say unpack '(C/xa@)3', "\005\004\003abcdef"; # prints 'ddd'
    
  3. or download this
    say unpack '(C/xa@)3', "\003\003\003abcdef"; # prints 'bcd' - would li
    +ke 'aaa'
    say unpack '(C/xa@)3', "\005\004\003abcdef"; # prints 'ddd' - would li
    +ke 'cba'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1026297]
Approved by toolic
Front-paged by davido
help
Chatterbox?
[marioroy]: Corion, start and start_child in MCE::Hobo::Manager return a MCE::Hobo object, whereas P::FM returns the PID. I can have it return the PID though. I tried Hobo::Manager with several P::FM modules, just changed P::FM to MCE::Hobo::Manager and it works.
[marioroy]: I also have a Hobo driver for Forklift allowing folks to use in multiple classes, no conflicts with one another. That's not possible for P::FM.
[Discipulus]: congrats marioroy!
[marioroy]: CORE::wait works well eventhough multiple instances or classes using Hobo::Manager.
[Corion]: marioroy: I'm not sure what the normal use for the PID is in P:FM, but I guess that most programs just ignore or log it
[Corion]: Oh, yes, programs could call wait $pid, but if your $pid is an object, then you could add a ->wait method to it and wait $pid would call that automatically "thanks" to indirect object notation
[marioroy]: Just documentation edits is all that remains. Hobo::Simple provides foreach and forseq with identifier capability -- all transparently supporting array, hash, file handle, and seq 1 .. N.
[marioroy]: Corion Regarding PID, that's great. So will leave it so compatible with MCE::Hobo. e.g. ->create returns a Hobo object. Folks can get ->pid from it. So, that's not a problem.
[choroba]: ad readdir: 5.12 needed
[marioroy]: CORE::wait can block if another process reaps a worker from another class. MCE::Hobo takes care of that and transparently.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2017-05-26 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?