Perl script - Linux to Windows

Discussion in 'Perl Misc' started by guru, Feb 17, 2009.

  1. guru

    guru Guest

    HI

    I have written a script which runs successfully in Linux. But When I
    took same script and ran in Windows it is failing.

    I tried to figure out if there any problem with following,

    1. Paths handling --> Wheter this should be handled.
    I came to know that perl will handle path structure depending
    on the OS.
    2. Configuration setting.

    Any other parameters I need to look while porting to Windows.

    Thanks & Regards
    Gururaja
     
    guru, Feb 17, 2009
    #1
    1. Advertising

  2. guru

    Noway Guest

    guru wrote:
    > HI
    >
    > I have written a script which runs successfully in Linux. But When I
    > took same script and ran in Windows it is failing.


    How do you know that it fails under win?
     
    Noway, Feb 17, 2009
    #2
    1. Advertising

  3. guru wrote:
    > HI
    >
    > I have written a script which runs successfully in Linux. But When I
    > took same script and ran in Windows it is failing.
    >
    > I tried to figure out if there any problem with following,
    >
    > 1. Paths handling --> Wheter this should be handled.
    > I came to know that perl will handle path structure depending
    > on the OS.
    > 2. Configuration setting.
    >
    > Any other parameters I need to look while porting to Windows.


    There is a bug at line 126 of the script.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Feb 17, 2009
    #3
  4. guru

    guru Guest

    On Feb 17, 4:20 pm, Gunnar Hjalmarsson <> wrote:
    > guru wrote:
    > > HI

    >
    > > I have written a script which runs successfully in Linux. But When I
    > > took same script and ran in Windows it is failing.

    >
    > > I tried to figure out if there any problem with following,

    >
    > > 1. Paths handling --> Wheter this should be handled.
    > >        I came to know that perl will handle path structure depending
    > > on the OS.
    > > 2. Configuration setting.

    >
    > > Any other parameters I need to look while porting to Windows.

    >
    > There is a bug at line 126 of the script.
    >
    > --
    > Gunnar Hjalmarsson
    > Email:http://www.gunnar.cc/cgi-bin/contact.pl


    Thanks Gunnar. I got the answer. This is a general question that I
    asked. While porting I faced some problem with path and configuration.
    So I asked any other I need to consider.
     
    guru, Feb 17, 2009
    #4
  5. guru

    guru Guest

    On Feb 17, 4:17 pm, Noway <> wrote:
    > guru wrote:
    > > HI

    >
    > > I have written a script which runs successfully in Linux. But When I
    > > took same script and ran in Windows it is failing.

    >
    > How do you know that it fails under win?


    Scenario is fun1.pl is calling fun2.pl, while passing it is passing
    list of files too.
    In fun2.pl i am failing to read those file.

    What I got is if file is passed like 'filename1' then fun2.pl will
    fail to open it, so I passed without '' and it worked.
     
    guru, Feb 17, 2009
    #5
  6. guru wrote:
    > On Feb 17, 4:17 pm, Noway <> wrote:
    >> guru wrote:
    >>> HI
    >>> I have written a script which runs successfully in Linux. But When I
    >>> took same script and ran in Windows it is failing.

    >> How do you know that it fails under win?

    >
    > Scenario is fun1.pl is calling fun2.pl,


    Presumably using system() or backticks.


    > while passing it is passing
    > list of files too.
    > In fun2.pl i am failing to read those file.
    >
    > What I got is if file is passed like 'filename1' then fun2.pl will
    > fail to open it, so I passed without '' and it worked.


    Sounds fragile, maybe you should convert fun2.pl to a module fun2.pm so
    that you are not dependant on the quirks of shells in various operating
    systems.

    --
    RGB
     
    RedGrittyBrick, Feb 17, 2009
    #6
  7. guru wrote:
    > On Feb 17, 4:20 pm, Gunnar Hjalmarsson <> wrote:
    >> guru wrote:
    >>> HI
    >>> I have written a script which runs successfully in Linux. But When I
    >>> took same script and ran in Windows it is failing.
    >>> I tried to figure out if there any problem with following,
    >>> 1. Paths handling --> Wheter this should be handled.
    >>> I came to know that perl will handle path structure depending
    >>> on the OS.
    >>> 2. Configuration setting.
    >>> Any other parameters I need to look while porting to Windows.

    >> There is a bug at line 126 of the script.

    >
    > Thanks Gunnar. I got the answer.


    Good.

    > This is a general question that I
    > asked. While porting I faced some problem with path and configuration.
    > So I asked any other I need to consider.


    Your problem was not general at all. Next time you ask a question,
    please make it easy to help by following the posting guidelines for this
    group.

    http://www.rehabitation.com/clpmisc/clpmisc_guidelines.html

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Feb 17, 2009
    #7
  8. guru <> wrote:
    >I have written a script which runs successfully in Linux. But When I
    >took same script and ran in Windows it is failing.
    >
    >I tried to figure out if there any problem with following,
    >
    >1. Paths handling --> Wheter this should be handled.
    > I came to know that perl will handle path structure depending
    >on the OS.


    Depends on what you mean. Obviously Windows doesn't have e.g. an
    /etc/proc and neither named pipes or sockets as part of the file system
    just as you need to consider the concept of drives.

    >2. Configuration setting.


    Again, depends on what you mean.

    >Any other parameters I need to look while porting to Windows.


    Did you read 'perldoc perlport'?

    jue
     
    Jürgen Exner, Feb 17, 2009
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,868
  2. b wreath
    Replies:
    3
    Views:
    190
    Ben Morrow
    Jun 2, 2004
  3. @
    Replies:
    3
    Views:
    135
  4. Krishna Chaitanya
    Replies:
    1
    Views:
    152
    Krishna Chaitanya
    Feb 27, 2009
  5. Harry
    Replies:
    26
    Views:
    428
    MSwanberg
    Sep 21, 2009
Loading...

Share This Page