file name in perl script?

Discussion in 'Perl Misc' started by Nico, Mar 9, 2005.

  1. Nico

    Nico Guest

    Hi, I'm a bit of newby.
    Someone created some pl files for me.
    I have them on my pc in de dir: c:/perl
    The script must do some editting
    When I start a pl file, a black box appaers, (c:\perl\bin\perl.exe)
    The pl-file must start some editting in a file called: editme.txt
    Here are the first line of the pl-script

    #!c:\perl\bin\perl!
    #
    # EI2.pl - 1st pass to prepare for conversion dbtext
    # indonesica database to MY format
    # Piet J, 2/5/2005
    #

    $onder = 0 ;
    $boven = 100000 ;
    --
    where to give the name "editme.txt" ?
    so the script can make the changes in the txt file..?
    Please advice
    Nico
    Nico, Mar 9, 2005
    #1
    1. Advertising

  2. Nico

    Guest

    Try something like this:

    $path = 'c:\editme.txt' ;
    open ( EDITME, ">>$path" ) or die "no such file" ;
    # Write to it.
    close EDITME ;
    , Mar 9, 2005
    #2
    1. Advertising

  3. <> wrote:


    > $path = 'c:\editme.txt' ;



    Or,

    $path = 'c:/editme.txt';

    You are not required to use silly slashes in paths.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 9, 2005
    #3
  4. Nico <> wrote:

    > Someone created some pl files for me.



    > where to give the name "editme.txt" ?



    Ask the Someone who wrote the program.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
    Tad McClellan, Mar 9, 2005
    #4
  5. Nico wrote :
    > Here are the first line of the pl-script
    >
    > #!c:\perl\bin\perl!
    > #
    > # EI2.pl - 1st pass to prepare for conversion dbtext
    > # indonesica database to MY format
    > # Piet J, 2/5/2005
    > #
    >
    > $onder = 0 ;
    > $boven = 100000 ;
    >
    > where to give the name "editme.txt" ?
    > so the script can make the changes in the txt file..?
    > Please advice


    This question can not be answerded if only the first few lines of code
    are presented.
    Best thing would be to ask the author of the script.

    It could be, that you are supposed to pass the filename on the command
    line like this
    EI2.pl c:/path/editme.txt
    But this is only a wild guess and I would not dare to try without a
    backup of "editme.txt" if I didn't understand what the script really
    does with "editme.txt".

    Best regards
    Martin

    --
    perl -e '$|=1;&p(7.74.117.115.116.32);&s();&p(97.110.111);&p(116.104.101
    ..114);&s;&p(32.112.101.114.108);&s();&p(32.104.97.99.107.101.114.10);sub
    s{sleep 1};sub p(){print "@_"}'
    Martin Kissner, Mar 9, 2005
    #5
  6. Nico

    Nico Guest

    Hi Martin,
    Thanks for you advice, I can now see the script working and making the
    changes,however, I can not find the result?
    I think there must be another command to put the result in a output
    directory?
    EI2.pl c:/path/editme.txt ..?
    I tried this in the script, "$outputdir='output';",but it did not
    work.
    I guess that I must type something at the command line.

    The creator of the scripts can not be found, otherwise...


    Thanks in advance,
    Nico





    Martin Kissner <> wrote in message news:<>...
    > Nico wrote :
    > > Here are the first line of the pl-script
    > >
    > > #!c:\perl\bin\perl!
    > > #
    > > # EI2.pl - 1st pass to prepare for conversion dbtext
    > > # indonesica database to MY format
    > > # Piet J, 2/5/2005
    > > #
    > >
    > > $onder = 0 ;
    > > $boven = 100000 ;
    > >
    > > where to give the name "editme.txt" ?
    > > so the script can make the changes in the txt file..?
    > > Please advice

    >
    > This question can not be answerded if only the first few lines of code
    > are presented.
    > Best thing would be to ask the author of the script.
    >
    > It could be, that you are supposed to pass the filename on the command
    > line like this
    > EI2.pl c:/path/editme.txt
    > But this is only a wild guess and I would not dare to try without a
    > backup of "editme.txt" if I didn't understand what the script really
    > does with "editme.txt".
    >
    > Best regards
    > Martin
    Nico, Mar 10, 2005
    #6
  7. Nico wrote :

    Please read http://learn.to/quote to learn how to properly quote in
    usenet. - Thank you.

    > Hi Martin,
    > Thanks for you advice, I can now see the script working and making the
    > changes,however, I can not find the result?
    > I think there must be another command to put the result in a output
    > directory?
    > EI2.pl c:/path/editme.txt ..?
    > I tried this in the script, "$outputdir='output';",but it did not
    > work.


    I think it's a waste of time and effort to add code you do not
    understand (or somthing that looks like code) to a script which you do
    not understand.
    It's like soldering some cables into a TV which does not show the
    desired program, without any clues of electronics.

    > I guess that I must type something at the command line.


    This might be or might not be true.
    If you see the results in the commandline window try

    EI2.pl c:/path/editme.txt > c:/path/result.txt

    This is how it would work on Unix then; I have no idea if this works on
    windows, since I do not use it.

    > The creator of the scripts can not be found, otherwise...

    ?

    Best regards
    Martin

    --
    perl -e '$|=1;&p(7.74.117.115.116.32);&s();&p(97.110.111);&p(116.104.101
    ..114);&s;&p(32.112.101.114.108);&s();&p(32.104.97.99.107.101.114.10);sub
    s{sleep 1};sub p(){print "@_"}'
    Martin Kissner, Mar 10, 2005
    #7
  8. Nico

    Nico Guest

    Hello Martin,
    Thanks again for your advice, it worked!
    It's like an old Dos command.
    I know what the script is doing, its converting records from a
    database format to an other database format. The script has 565 lines,
    that's why I only send the first lines, I knew that I only needed to
    know how to start the script, and were to put the results, I did not
    found the answers in handbooks...
    This line: "$outputdir='output';", was a suggestion from an other on
    this list.
    I apologize for my poor English.

    Best regards,
    Nico


    Martin Kissner <> wrote in message news:<>...
    > Nico wrote :
    >
    > Please read http://learn.to/quote to learn how to properly quote in
    > usenet. - Thank you.
    >
    > > Hi Martin,
    > > Thanks for you advice, I can now see the script working and making the
    > > changes,however, I can not find the result?
    > > I think there must be another command to put the result in a output
    > > directory?
    > > EI2.pl c:/path/editme.txt ..?
    > > I tried this in the script, "$outputdir='output';",but it did not
    > > work.

    >
    > I think it's a waste of time and effort to add code you do not
    > understand (or somthing that looks like code) to a script which you do
    > not understand.
    > It's like soldering some cables into a TV which does not show the
    > desired program, without any clues of electronics.
    >
    > > I guess that I must type something at the command line.

    >
    > This might be or might not be true.
    > If you see the results in the commandline window try
    >
    > EI2.pl c:/path/editme.txt > c:/path/result.txt
    >
    > This is how it would work on Unix then; I have no idea if this works on
    > windows, since I do not use it.
    >
    > > The creator of the scripts can not be found, otherwise...

    > ?
    >
    > Best regards
    > Martin
    Nico, Mar 10, 2005
    #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. Wet Basement
    Replies:
    1
    Views:
    2,505
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,767
  3. pj
    Replies:
    3
    Views:
    274
  4. J M
    Replies:
    2
    Views:
    103
    Tad McClellan
    Nov 6, 2004
  5. Petterson Mikael

    Execute another perl script from my perl script

    Petterson Mikael, Jan 5, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    127
    Paul Lalli
    Jan 5, 2005
Loading...

Share This Page