Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: chmod in perl

by atcroft (Monsignor)
on Mar 11, 2011 at 07:51 UTC ( #892604=note: print w/replies, xml ) Need Help??


in reply to Re^3: chmod in perl
in thread chmod in perl

Actually, I did. I fixed it, and put a note at the bottom to indicate it had been updated, but have no idea if the OP has seen it or tried with the missing semicolon in place.

Replies are listed 'Best First'.
Re^5: chmod in perl
by Anonymous Monk on Mar 11, 2011 at 09:19 UTC

    The problem with the below code is if the file doesnot exist,you will get an error "No such file or directory at perl.pl line 135

    my $filename = q{deletefiles.txt}; chmod 0777, $filename or die $!; open my $OUTPUT, q{+>}, $filename or die $!;

      Either ignore that error,

      my $filename = q{deletefiles.txt}; chmod 0777, $filename or $!{ENOENT} or die $!; open my $OUTPUT, q{+>}, $filename or die $!;

      Or change the permissions after creating the file.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://892604]
help
Chatterbox?
[davido]: And remember; time is hard. :) As soon as you think, I've got this, you'll discover that time is harder than that. :)
[1nickt]: TCLion are you parsing the dates with DateTime or another tool?
[1nickt]: I note DateTime::Format:: Flexible, announced immediately below this box in the CPAN feed
[Corion]: 1nickt: That one sounds sensible as it will tell you when it found an error
[1nickt]: Throws on error, I believe
[1nickt]: But should handle month as number or word

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (19)
As of 2017-03-23 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (287 votes). Check out past polls.