Results 1 to 2 of 2

Thread: PERL to PHP translator needed

  1. #1
    I'm a farmhand on your dad's rooster ranch. haganxy's Avatar
    Join Date
    Dec 2004
    Location
    Seattle, WA
    Posts
    379

    PERL to PHP translator needed

    i'm an old school PERL programmer and still write a lot of code in PERL and C. however, i'm expanding my horizons and starting to write a significant amout of stuff in PHP as well.

    i find myself running into a lot of situations where i'm like "this is how i would do it in PERL, how do you do it in PHP?"

    example: how do i do this in PHP?

    Code:
    if (-d /home/whatever) {  ... }
    in any case, i was wondering if there was a good site out there that has a lot of PERL to PHP translations.

    something similar to this site, but in more detail:

    http://www.cs.wcupa.edu/~rkline/perl2php/


    thanks
    hagan - IT nerd
    PrideBucks.com
    ICQ: 49962103


  2. #2
    Life is a dick and when itīs get hard---just fuck it... DEVELISH's Avatar
    Join Date
    Jul 2005
    Posts
    2,367
    Quote Originally Posted by haganxy View Post

    Code:
    if (-d /home/whatever) {  ... }
    that "-d" checks if the /home/whatever is a file or a directory

    you can use is_file or is_dir to chech that before actually doing the if-stuff

    example

    if (is_dir($path)) {
    echo "Is Directory\n";
    }

    if (is_file($path)) {
    echo "Is File\n";
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •