Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^3: state and file perms confusion

by Kenosis (Priest)
on Aug 04, 2012 at 02:18 UTC ( #985374=note: print w/replies, xml ) Need Help??

in reply to Re^2: state and file perms confusion
in thread state and file perms confusion

What am I seeing?

33188 decimal = 100644 octal (first printf) 07777 octal = 0000111111111111 binary (mask)-| +- & (bitwise AND) 33188 decimal = 1000000110100100 binary (mode)-| 0644 octal = 0000000110100100 binary (printf after mask) ^^^^ | + - file type masked out

How can store the number in a scalar rather than printing it?

use Modern::Perl; my $mode = 33188; my $modeResult = sprintf '%04o', $mode & 07777; say $modeResult; # prints 0644

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2016-10-21 22:44 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.