Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
go ahead... be a heretic
 
PerlMonks  

Re^2: help neeed in unpack

by uva (Sexton)
on Feb 10, 2006 at 02:55 UTC ( [id://529298]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: help neeed in unpack
in thread help neeed in unpack

unpack counts spaces as characters of their own.so when unpacking,'A' removes only the trailing spaces.is it correcet?

Replies are listed 'Best First'.
Re^3: help neeed in unpack
by Corion (Patriarch) on Feb 10, 2006 at 02:58 UTC

    Please read the documentation for pack and unpack. It says there:

    ... When unpacking, "A" strips trailing spaces and nulls, "Z" strips everything after the first null, and "a" returns data verbatim. ...
      $line="123456789"; @w=unpack('Z3Z3Z3',$line); print "@w";
      it worked nicely by giving outout as 123 456 789 in the command prompt but it is not working in the perl buider. not even execute the print statement while debugging.

        Your problem might be that when printing with double quotes an implicit call to join (using $") is made. Dropping the double quotes would cause print to print the contents using $, as a seperator. So you man need to use join.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://529298]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.