perl running question

Discussion in 'Perl Misc' started by Ross, Aug 16, 2005.

  1. Ross

    Ross Guest

    Dear all,
    I find posting here may be more appropriate and so tidy up my inquiries
    and feedbacks and ask this question again:

    after installing FC3, perl script needs to be run using:

    /usr/bin/perl test.pl

    when it is in FC1, i can just type test.pl

    as both OS's are installed by me and the same conf files are to be used.

    In the test.pl,

    The first line of the script is:

    #!/usr/bin/perl

    i've even tried changing it to perl5.8.5 as i know it is in /usr/bin

    no matter i add set path = ($path .) or i run the perl directly at
    the directory containing it (no amibugous command confirmed by using
    "which"), i must use

    /usr/bin/perl test.pl

    the permission of test.pl is
    rwxr-xr-x

    as test.pl takes one argument, when typing test.pl, something like "please
    provide your filename" should be printed at the prompt but it doesn't.

    Some say it would be the fixing of a security problem of FC3, could anybody
    suggest any idea?
     
    Ross, Aug 16, 2005
    #1
    1. Advertising

  2. Ross

    Keith Keller Guest

    On 2005-08-16, Ross <> wrote:
    >
    > as test.pl takes one argument, when typing test.pl, something like "please
    > provide your filename" should be printed at the prompt but it doesn't.


    What *does* it do? Explaining what you want it to do is not helpful
    unless you also explain what it actually does. Posting a *short*,
    *complete* script that replicates the problem is also helpful.

    --keith

    --
    -francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
    see X- headers for PGP signature information
     
    Keith Keller, Aug 16, 2005
    #2
    1. Advertising

  3. Ross

    Damian James Guest

    On Tue, 16 Aug 2005 11:36:42 +0800, Ross said:
    > I find posting here may be more appropriate and so tidy up my inquiries
    > and feedbacks and ask this question again:
    >
    > after installing FC3, perl script needs to be run using:
    >
    > /usr/bin/perl test.pl
    >
    > when it is in FC1, i can just type test.pl
    >
    > as both OS's are installed by me and the same conf files are to be used.


    Did you have "." in your path in the FC1 environment? Friends don't let
    friends put "." in their path. If FC1 included this in the default path,
    and FC3 removed it, then I would certainly call it a security enhancement.

    Have you tried "./test.pl"?

    This doesn't have much to do with Perl, of course.

    --Damian
     
    Damian James, Aug 16, 2005
    #3
  4. Ross

    Ross Guest

    "Damian James" <> wrote in message
    news:...
    > On Tue, 16 Aug 2005 11:36:42 +0800, Ross said:
    >> I find posting here may be more appropriate and so tidy up my inquiries
    >> and feedbacks and ask this question again:
    >>
    >> after installing FC3, perl script needs to be run using:
    >>
    >> /usr/bin/perl test.pl
    >>
    >> when it is in FC1, i can just type test.pl
    >>
    >> as both OS's are installed by me and the same conf files are to be used.

    >
    > Did you have "." in your path in the FC1 environment? Friends don't let
    > friends put "." in their path. If FC1 included this in the default path,
    > and FC3 removed it, then I would certainly call it a security enhancement.


    ? I don't know what you mean.

    >
    > Have you tried "./test.pl"?


    i've tried.

    > This doesn't have much to do with Perl, of course.
    >
    > --Damian



    #!/usr/bin/perl

    $input = $ARGV[0];
    if($input =~ /^$/) {
    print "usage: addDB2HTML.pl [db name] \n";
    exit;
    }

    open(IN, $input) || die "Could not open $input\n";

    while($line = <IN>) {
    print "$line\n";
    }
     
    Ross, Aug 16, 2005
    #4
  5. Ross

    Paul Lalli Guest

    Ross wrote:
    > Dear all,
    > I find posting here may be more appropriate


    more appropriate than what?

    > and so tidy up my inquiries
    > and feedbacks and ask this question again:


    You asked this question before? What were the responses you got? How
    did they not satisfactorally assist you?

    > after installing FC3, perl script needs to be run using:
    >
    > /usr/bin/perl test.pl
    >
    > when it is in FC1, i can just type test.pl
    >
    > as both OS's are installed by me and the same conf files are to be used.
    >
    > In the test.pl,
    >
    > The first line of the script is:
    >
    > #!/usr/bin/perl
    >
    > i've even tried changing it to perl5.8.5 as i know it is in /usr/bin
    >
    > no matter i add set path = ($path .) or i run the perl directly at
    > the directory containing it (no amibugous command confirmed by using
    > "which"), i must use
    >
    > /usr/bin/perl test.pl


    You're saying that if your current directory is
    /usr/bin
    and you type
    perl test.pl
    then test.pl doesn't get executed? That sounds much more like an
    environment issue than it does a Perl issue to me. Of course, you
    haven't told us what actually happens when you type `perl test.pl`, so
    there's no real way of knowing.

    > the permission of test.pl is
    > rwxr-xr-x
    >
    > as test.pl takes one argument, when typing test.pl, something like "please
    > provide your filename" should be printed at the prompt


    That phrase should only be printed if your code says to print it. If
    you don't have a block very similar to:
    if (!@ARGV){
    print "Please provide your filename\n";
    chomp (my $file = <STDIN>);
    # ...
    }
    then there's no reason to expect your program to print anything of the
    sorts.

    > but it doesn't.


    Well what *does* it do? You haven't given us any indication of what
    error you receive when attempting to run the perl script directly.

    > Some say it would be the fixing of a security problem of FC3, could anybody
    > suggest any idea?


    Off hand, I would also suggest confirming that your shebang really is
    what you think it is. If, for example, your code has windows-style
    newlines, then the shebang might actually be telling your OS to try to
    run the program "/usr/bin/perl\r" rather than "/usr/bin/perl". Try
    running dos2unix on the file? It can't hurt...

    Paul Lalli
     
    Paul Lalli, Aug 16, 2005
    #5
  6. Ross

    Ross Guest

    > You asked this question before? What were the responses you got? How
    > did they not satisfactorally assist you?


    keep answering the same thing such as try ./test.pl even i stated clearly i
    have tried. no blaming but appreciation for their help. still, need to solve
    my problem


    > You're saying that if your current directory is
    > /usr/bin
    > and you type
    > perl test.pl
    > then test.pl doesn't get executed?


    no. i run the script test.pl in its own containing directory. when i input
    perl test.pl, everything is normal and
    usage: test.pl [db name]

    is printed out

    > That sounds much more like an environment issue than it does a Perl issue
    > to me.

    Well, then how should i tell the OS to execute test.pl without typing perl?
    What and where environment variable i should set? i'm doing this to let
    users (Or those who've indulged in Windows) without computer background life
    easier

    > Off hand, I would also suggest confirming that your shebang really is
    > what you think it is. If, for example, your code has windows-style
    > newlines, then the shebang might actually be telling your OS to try to
    > run the program "/usr/bin/perl\r" rather than "/usr/bin/perl".


    Try running dos2unix on the file? It can't hurt...
    I've tried....
     
    Ross, Aug 17, 2005
    #6
  7. Ross

    John Bokma Guest

    "Ross" <> wrote:

    > no. i run the script test.pl in its own containing directory. when i
    > input perl test.pl, everything is normal and
    > usage: test.pl [db name]
    >
    > is printed out


    What exactly do you get if you enter:

    test.pl

    at the prompt?

    (note that test is a bad choice for a program name :) ).

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Aug 17, 2005
    #7
  8. Ross

    Ross Guest

    "John Bokma" <> wrote in message
    news:Xns96B4EA8A5764castleamber@130.133.1.4...
    > "Ross" <> wrote:
    >
    >> no. i run the script test.pl in its own containing directory. when i
    >> input perl test.pl, everything is normal and
    >> usage: test.pl [db name]
    >>
    >> is printed out

    >
    > What exactly do you get if you enter:
    >
    > test.pl
    >
    > at the prompt?
    >


    the output is as follows:

    admin/var/www/html/test> test.pl
    admin/var/www/html/test>

    Furthermore, indeed test is just for my convenience to ask questions only
    (i've used "which" to confirm), thx
     
    Ross, Aug 17, 2005
    #8
  9. Ross

    Jon Guest

    Ross wrote:

    >
    > "John Bokma" <> wrote in message
    > news:Xns96B4EA8A5764castleamber@130.133.1.4...
    >> "Ross" <> wrote:
    >>
    >>> no. i run the script test.pl in its own containing directory. when i
    >>> input perl test.pl, everything is normal and
    >>> usage: test.pl [db name]
    >>>
    >>> is printed out

    >>
    >> What exactly do you get if you enter:
    >>
    >> test.pl
    >>
    >> at the prompt?
    >>

    >
    > the output is as follows:
    >
    > admin/var/www/html/test> test.pl
    > admin/var/www/html/test>
    >
    > Furthermore, indeed test is just for my convenience to ask questions only
    > (i've used "which" to confirm), thx


    Can you provide the output of 'echo $PATH' and 'which test.pl'?
    --
    Jon
     
    Jon, Aug 17, 2005
    #9
  10. Ross

    Ross Guest

    > Can you provide the output of 'echo $PATH' and 'which test.pl'?
    > --


    admin/home/admin> echo $PATH
    /usr/bin:/bin<snip for my security reason, here contains all the paths where
    my scripts reside, the strange thing is, some have :.:, but some just
    :>.:/usr/X11R6/bin

    admin/home/admin> which test.pl
    < for my security reason, path residing test.pl>/test.pl
     
    Ross, Aug 17, 2005
    #10
  11. Ross <> wrote:


    [ Please provide an attribution when you quote somebody ]


    >> Can you provide the output of 'echo $PATH' and 'which test.pl'?
    >> --

    >
    > admin/home/admin> echo $PATH
    > /usr/bin:/bin<snip for my security reason, here contains all the paths where
    > my scripts reside, the strange thing is, some have :.:, but some just
    >:>.:/usr/X11R6/bin

    ^
    ^
    ^

    There is a closing angle bracket (>) character in your $PATH?

    That's strange...


    > admin/home/admin> which test.pl
    >< for my security reason, path residing test.pl>/test.pl



    Due to your security reasons, we are unlikely to be able to help.

    Since you don't know what the problem is, you may have snipped
    the part that indicates what the problem is.

    The devil is in the details with computer stuff, but you are the
    only one with access to those details...


    You may need to hire someone that you can get to sign an NDA,
    so you can then provide the details to someone.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Aug 17, 2005
    #11
  12. Ross

    John Bokma Guest

    "Ross" <> wrote:

    >
    > "John Bokma" <> wrote in message
    > news:Xns96B4EA8A5764castleamber@130.133.1.4...
    >> "Ross" <> wrote:
    >>
    >>> no. i run the script test.pl in its own containing directory. when i
    >>> input perl test.pl, everything is normal and
    >>> usage: test.pl [db name]
    >>>
    >>> is printed out

    >>
    >> What exactly do you get if you enter:
    >>
    >> test.pl
    >>
    >> at the prompt?
    >>

    >
    > the output is as follows:
    >
    > admin/var/www/html/test> test.pl
    > admin/var/www/html/test>


    Try test2.pl:

    #!/usr/bin/perl

    use strict;
    use warnings;

    pwasas;

    what is the output?

    Try test3.pl

    #!/usr/bin/foo

    bar;

    what is the output?

    --
    John Small Perl scripts: http://johnbokma.com/perl/
    Perl programmer available: http://castleamber.com/
    Happy Customers: http://castleamber.com/testimonials.html
     
    John Bokma, Aug 17, 2005
    #12
  13. Ross

    Ross Guest

    >>>> no. i run the script test.pl in its own containing directory. when i
    >>>> input perl test.pl, everything is normal and
    >>>> usage: test.pl [db name]
    >>>>
    >>>> is printed out
    >>>
    >>> What exactly do you get if you enter:
    >>>
    >>> test.pl
    >>>
    >>> at the prompt?

    >>
    >> the output is as follows:
    >>
    >> admin/var/www/html/test> test.pl
    >> admin/var/www/html/test>

    >
    > Try test2.pl:
    >
    > #!/usr/bin/perl
    >
    > use strict;
    > use warnings;
    >
    > pwasas;
    >
    > what is the output?


    again, it exits and "seems" to do nothing

    >
    > Try test3.pl
    >
    > #!/usr/bin/foo
    >
    > bar;
    >
    > what is the output?


    command not found. wow! does it mean it does do something but just don't
    print anything out?!
     
    Ross, Aug 17, 2005
    #13
  14. Ross

    Ross Guest

    >>> Can you provide the output of 'echo $PATH' and 'which test.pl'?
    >>> --

    >>
    >> admin/home/admin> echo $PATH
    >> /usr/bin:/bin<snip for my security reason, here contains all the paths
    >> where
    >> my scripts reside, the strange thing is, some have :.:, but some just
    >>:>.:/usr/X11R6/bin

    > ^
    > ^
    > ^
    >
    > There is a closing angle bracket (>) character in your $PATH?


    no, just to close as i open one after bin

    >> admin/home/admin> which test.pl
    >>< for my security reason, path residing test.pl>/test.pl

    >
    >
    > Due to your security reasons, we are unlikely to be able to help.
    >

    thx anyway :)
     
    Ross, Aug 17, 2005
    #14
  15. [ Please please provide an attribution when you quote someone! ]


    Ross <> wrote:

    >> Try test3.pl
    >>
    >> #!/usr/bin/foo
    >>
    >> bar;
    >>
    >> what is the output?

    >
    > command not found. wow! does it mean it does do something but just don't
    > print anything out?!



    "command not found" means the command was not found, it cannot
    "do something" if it cannot execute, and it cannot execute if
    the command to run cannot be found by the shell.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Aug 17, 2005
    #15
    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,863
  2. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Jan 23, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    333
    PerlFAQ Server
    Jan 23, 2011
  3. PerlFAQ Server
    Replies:
    0
    Views:
    727
    PerlFAQ Server
    Feb 3, 2011
  4. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Feb 27, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    324
    PerlFAQ Server
    Feb 27, 2011
  5. Replies:
    4
    Views:
    318
    ccc31807
    Jul 29, 2011
Loading...

Share This Page