Re: running a perl app

2006-04-19 Thread Sisyphus

- Original Message - 
From: "Chris Wagner"
.
.
>
> Actually the Cygwin commands are independent exe's and don't have to be
run
> from any certain shell.  I run cygwin commands from cmd.exe all the time.
> The key difference is that they act and return output in the context of
the
> cygwin system.  But it's not too hard to flip /c/perl/bin/perl into
> c:\perl\bin\perl in ur mind.  But for the most part they act just like any
> other shell app.
>

Interesting - I don't have Cygwin, but I do have an msys shell (which is,
roughly speaking, a derivative of Cygwin's shell). It has a 'which' command,
but that works only in the msys shell. If I execute it from a cmd.exe shell
it just hangs and renders the cmd shell unresponsive.

There are, of course, other msys commands that are independent exe's - and
they can be run from any shell.

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: running a perl app

2006-04-19 Thread Chris Wagner
At 04:32 PM 4/19/2006 +1000, Sisyphus wrote:
>On windows the same command could successfully be run in the msys shell, or
>in Cygwin's bash shell - and perhaps some other shells, too - but not the
>cmd.exe shell, unless you've installed a which.exe such as that available
>from http://gnuwin32.sourceforge.net/packages.html (as I have done):
>
>E:\downloads>which perl
>D:/perl58_M/5.8.8/bin/perl.EXE

Actually the Cygwin commands are independent exe's and don't have to be run
from any certain shell.  I run cygwin commands from cmd.exe all the time.
The key difference is that they act and return output in the context of the
cygwin system.  But it's not too hard to flip /c/perl/bin/perl into
c:\perl\bin\perl in ur mind.  But for the most part they act just like any
other shell app.






--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: running a perl app

2006-04-19 Thread Peter Eisengrein
Title: RE: running a perl app






> > >To determine the correct path for your perl interpretor, use:
> >
> > >    which perl
> >
> > >--
> >
> > Please give me a context.
> >
> 
> Note that the original post pertained to a Unix-like system 
> (not Windows) -
> and the answer you've quoted above pertains primarily to 
> Unix-like systems.
> 
> On Unix -like systems if you were to enter 'which perl' at 
> the command line,
> then the fully qualified path to the perl executable would be 
> returned.
> 
> On windows the same command could successfully be run in the 
> msys shell, or
> in Cygwin's bash shell - and perhaps some other shells, too - 
> but not the
> cmd.exe shell, unless you've installed a which.exe such as 
> that available
> from http://gnuwin32.sourceforge.net/packages.html (as I have done):
> 



Here's a perl version of 'which'. But it looks not only in $ENV{PATH} but also in @INC directories. I also created a which.bat file which calls which.pl because I am THAT lazy ;-)

###


use Cwd;
@_ = @ARGV;
my $cwd = getcwd unless $cwd = $ENV{'PWD'};



my $inc = join(";", @INC);
$ENV{'PATH'} = "$ENV{'PATH'};$inc";


$regexp = shift || die "usage: $0 regexp\n";
for $dir (split(/;/,$ENV{'PATH'}))
{


    if ($dir =~ /^.*[\\\/]$/)
    {
        chop($dir);
    }



    if ($dir =~ /\//)
    {
        $delim = "\/";
    }
    else
    {
        $delim = "\\";
    }




    opendir(DOT, "$dir") || &cantdo($!);


    while ($_ = readdir(DOT))
    {
        print "${dir}${delim}$_\n" if ($_ =~ /$regexp/i);
    }


    close(DOT);
 
}



sub cantdo
{
    my $error = shift;
    warn "can't opendir : $error\n";
    next;
}



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: running a perl app

2006-04-18 Thread Sisyphus

- Original Message - 
From: "Jerry Kassebaum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; 
Sent: Wednesday, April 19, 2006 1:09 PM
Subject: Re: running a perl app


> >To determine the correct path for your perl interpretor, use:
>
> >which perl
>
> >--
>
> Please give me a context.
>

Note that the original post pertained to a Unix-like system (not Windows) -
and the answer you've quoted above pertains primarily to Unix-like systems.

On Unix -like systems if you were to enter 'which perl' at the command line,
then the fully qualified path to the perl executable would be returned.

On windows the same command could successfully be run in the msys shell, or
in Cygwin's bash shell - and perhaps some other shells, too - but not the
cmd.exe shell, unless you've installed a which.exe such as that available
from http://gnuwin32.sourceforge.net/packages.html (as I have done):

E:\downloads>which perl
D:/perl58_M/5.8.8/bin/perl.EXE

Cheers,
Rob

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: running a perl app

2006-04-18 Thread Chris Wagner
It's the cygwin/unix command.  It tells u which object in ur path will be
exectued.
D:\autocrat>which perl
/c/perl/bin/perl





--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: running a perl app

2006-04-18 Thread Jerry Kassebaum

To determine the correct path for your perl interpretor, use:



   which perl



--


Please give me a context.

C: which perl

$x = which perl;

c: perl which perl

I'm missing something here.


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: running a perl app

2006-04-18 Thread John Shea
Bruce,To determine the correct path for your perl interpretor, use:    which perl-- John T SheaThere are 2 kinds of people in the world,those who finish what they start ...
On 4/18/06, Ng, Bill <[EMAIL PROTECTED]> wrote:
First,You're writing to a Win32 (Read: Windows) mailing list. =)Second,You're either missing or misspelling the path to the perlinterpreter as your first line in every script.  Your first line should
always be:-#!/usr/bin/perl (or whatever the path is to your perl binary)-Hope this helps.Bill Ng-Original Message-From: 
[EMAIL PROTECTED][mailto:[EMAIL PROTECTED]] On Behalf OfbruceSent: Tuesday, April 18, 2006 3:22 PM
To: Perl-Win32-Users@listserv.ActiveState.comSubject: running a perl apphi..using linux. when i do "perl foo.pl" everything works ok. when i do
"./foo.pl" i get errors.. i've set the exe bit "chmod 775 foo.pl"...any idea as to what's going on...thanks-bruce___Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: running a perl app

2006-04-18 Thread Ng, Bill
First,

You're writing to a Win32 (Read: Windows) mailing list. =)

Second,

You're either missing or misspelling the path to the perl
interpreter as your first line in every script.  Your first line should
always be:
-
#!/usr/bin/perl (or whatever the path is to your perl binary)
- 

Hope this helps.

Bill Ng

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
bruce
Sent: Tuesday, April 18, 2006 3:22 PM
To: Perl-Win32-Users@listserv.ActiveState.com
Subject: running a perl app

hi..

using linux. when i do "perl foo.pl" everything works ok. when i do
"./foo.pl" i get errors.. i've set the exe bit "chmod 775 foo.pl"...

any idea as to what's going on...

thanks

-bruce

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: running a perl app

2006-04-18 Thread Paikia
On 4/18/06, bruce wrote:
hi..using linux. when i do "perl foo.pl" everything works ok. when i do"./foo.pl" i get errors.. i've set the exe bit "chmod 775 foo.pl"...any idea as to what's going on...

Have you forgotten to add the shebang "#!/usr/bin/perl" (without quote
- path to your Perl executable) on the first line of your script?
 Regards
Jing Wee
thanks-bruce___Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.comTo unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
-- -Fight back spam! Download the Blue Frog.http://www.bluesecurity.com/register/s?user=amluZ3dlZQ%3D%3D

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


running a perl app

2006-04-18 Thread bruce
hi..

using linux. when i do "perl foo.pl" everything works ok. when i do
"./foo.pl" i get errors.. i've set the exe bit "chmod 775 foo.pl"...

any idea as to what's going on...

thanks

-bruce

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs