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

Re: use File::Path qw(make_path); fails with php 5.6.11

by Your Mother (Archbishop)
on Jul 28, 2015 at 15:57 UTC ( [id://1136630]=note: print w/replies, xml ) Need Help??


in reply to use File::Path qw(make_path); fails with php 5.6.11

Since no one has stepped up to be serious- :P

Perl is not PHP; and this is PerlMonks, hence the monk(y) snark. PHP and Perl cannot be mixed directly. If you are trying to use a Perl module in PHP, it is going to fail. You gave no indication of how you were actually using it or what failure message you got so we're just guessing here.

Updating PHP will have no effect on your Perl installation. You might be looking for the mkdir function in PHP. There is plenty of online documentation of it and its usage. Perl also has one but they aren't the same and don't take the same arguments.

Replies are listed 'Best First'.
Re^2: use File::Path qw(make_path); fails with php 5.6.11
by windjammer (Initiate) on Jul 28, 2015 at 16:09 UTC

    Sorry I am a newbie (really big time) We have a webpage that calls our perl program and passes the appropriate parameters. It worked when we used the old version of php and failed when I upgraded. Guess I should move this question to a php forum.

      Or you can show exactly what you did, in what context, and how it failed; error messages, log, etc. If it's Perl related we'll try to help. "This fails" is a difficult error report to dig into. :P The problem does sound to be in the PHP layer to me but again, that's a total guess.

      Problem solved, changed make_path to mkpath and all is well. Sorry to have wasted everyone's time.

        Hi windjammer, the docs from File::Path say:

        mkpath( $dir ) mkpath( $dir, $verbose, $mode ) mkpath( [$dir1, $dir2,...], $verbose, $mode ) mkpath( $dir1, $dir2,..., \%opt ) The mkpath() function provide the legacy interface of make_ +path() with a different interpretation of the arguments passed. T +he behaviour and return value of the function is otherwise ide +ntical to make_path().

        So it rather seems that the only problem that could be solved by changing:

        use File::Path qw/ make_path /;

        to

        use File::Path qw/ mkpath /;

        is that your code called make_path() with deprecated argument-passing syntax, and you upgraded from an older version of File::Path to a newer one in which the make_path() syntax has changed and mkpath() offered as a legacy alternative.

        So I am guessing that when you upgraded your PHP version, you may have also upgraded your Perl libraries ... did you use a shared host's one-button upgrade tool or something similar? If so, did it say that it was going to upgrade your Perl, too?

        Just a theory, but I found the fact that you fixed your problem by only changing the File::Path method used, to be quite interesting.

        The way forward always starts with a minimal test.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found