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

Re^2: chmod in perl

by Anonymous Monk
on Mar 11, 2011 at 06:18 UTC ( #892591=note: print w/ replies, xml ) Need Help??


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

I am getting the following error with the above code

my $filename = q{deletefiles.txt}; chmod 0777, $filename or die $! open my $OUTPUT, q{+>}, $filename or die $!; Missing comma after first argument to die function at perl.pl line 135 +, near "$filename or" Execution of qdepot_upload.pl aborted due to compilation errors.


Comment on Re^2: chmod in perl
Download Code
Re^3: chmod in perl
by ikegami (Pope) on Mar 11, 2011 at 07:27 UTC
    You miscopied the code.

      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.

        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 $!;
Re^3: chmod in perl
by Anonymous Monk on Dec 19, 2011 at 10:17 UTC
    Try and put the semicolon after first die statement. Because of that its throwing that error because it's gonna continue till the end of file if you dont specify where to exactly end.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-08-27 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls