Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: state and file perms confusion

by Kenosis (Priest)
on Aug 04, 2012 at 02:18 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-03-28 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found