[17768] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5188 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 23 09:05:31 2000

Date: Sat, 23 Dec 2000 06:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977580311-v9-i5188@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 23 Dec 2000     Volume: 9 Number: 5188

Today's topics:
        Active Perl/Windows ME problem? (Buck)
    Re: Active Perl/Windows ME problem? <johnroth@ameritech.net>
    Re: chdir and UNC path nobull@mail.com
    Re: chdir and UNC path nobull@mail.com
    Re: compiler <bart.lateur@skynet.be>
    Re: file size - outside url? <karol@imm.org.pl>
    Re: file size - outside url? <jhelman@wsb.com>
        Hostname? <rittirsch@gmx.de>
    Re: Hostname? <b@man.com>
    Re: Hostname? (Garry Williams)
    Re: Hostname? <jhelman@wsb.com>
    Re: Hostname? (Garry Williams)
    Re: how to install a module (a newby on modules) <karol@imm.org.pl>
    Re: Is there a standard, current Perl for Win32 (withou <bart.lateur@skynet.be>
    Re: Language evolution C->Perl->C++->Java->Python (Is P <pulsar@qks.com>
        Need help finding a space in a string with "index" <ryanc@nci1.net>
    Re: problem with awk in perl script (Garry Williams)
    Re: PWS - perl (ATTN: cwrites) <snef@soneramail.nl>
    Re: PWS - perl <snef@soneramail.nl>
    Re: Reverse "append to file" <cyner.mail@sweden.com>
        what's the 1st line os perl script ? <peter.cch@excite.com>
    Re: what's the 1st line os perl script ? <jhelman@wsb.com>
    Re: what's the 1st line os perl script ? <mtaylorlrim@my-deja.com>
    Re: Why are multiple zeroes true? <bart.lateur@skynet.be>
    Re: Why are multiple zeroes true? <iltzu@sci.invalid>
    Re: yet another question: is ' more efficient than "? <iltzu@sci.invalid>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 23 Dec 2000 13:25:17 GMT
From: mrsnitch@ksc.co.th (Buck)
Subject: Active Perl/Windows ME problem?
Message-Id: <3a44a699.16102894@news.ksc.co.th>

I've just installed the latest version of Active Perl on my Windows ME
operating system but when I run the "example.pl" file in a DOS window,
I get "Bad Command or File Name". 
When I installed, I chose the "add to path" option, etc. Funny thing
is that it will work if you double-click the example.pl file but the
"Hello World" message only flashes in a DOS window for a second.
Can't understand why I can't run the files from a command line in DOS.
I've moved to the correct directory and even tried the "perl -v"
command. Still, that same "Bad Command or File Name" message.
Is it a Windows ME problem? Any help would be greatly appreciated!


------------------------------

Date: Sat, 23 Dec 2000 07:54:05 -0600
From: "John Roth" <johnroth@ameritech.net>
Subject: Re: Active Perl/Windows ME problem?
Message-Id: <t49bc6muif4s19@news.supernews.com>

I've heard that Windows ME does not use the Autoexec.bat
file any more. Your best bet is to set up a batch file that sets
the path to the Perl executable, execute a DOS session,
invoke that first, and then invoke your Perl script. It's a pain,
but it works for me.

There's supposed to be a Registry key with the global path
information, but I don't know where it is.

The reason that double-clicking works is that Windows knows
where .pl is supposed to go - however, there doesn't seem to be
any way of making the DOS session stay around after the command
finishes executing.

John Roth

Buck <mrsnitch@ksc.co.th> wrote in message
news:3a44a699.16102894@news.ksc.co.th...
> I've just installed the latest version of Active Perl on my Windows ME
> operating system but when I run the "example.pl" file in a DOS window,
> I get "Bad Command or File Name".
> When I installed, I chose the "add to path" option, etc. Funny thing
> is that it will work if you double-click the example.pl file but the
> "Hello World" message only flashes in a DOS window for a second.
> Can't understand why I can't run the files from a command line in DOS.
> I've moved to the correct directory and even tried the "perl -v"
> command. Still, that same "Bad Command or File Name" message.
> Is it a Windows ME problem? Any help would be greatly appreciated!




------------------------------

Date: 23 Dec 2000 12:56:48 +0000
From: nobull@mail.com
Subject: Re: chdir and UNC path
Message-Id: <u9wvcrz46n.fsf@wcl-l.bham.ac.uk>

arysul@my-deja.com tries to vindicate the peole who killfile the whole
of my-deja by posting untrimmed and upside-down:

> This is the error message I got:
> CMD.EXE was started with '\\rbubld05red\SharedDir' as the current
> directory path.  UNC paths are not supported.  Defaulting to Windows
> directory.

This message contains two very clear facts:

  1) The chdir() to the UNC path succeded.
  2) CMD.EXE does not support UNC paths for CWD.

So why did you post to a Perl newsgroup?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 23 Dec 2000 12:59:51 +0000
From: nobull@mail.com
Subject: Re: chdir and UNC path
Message-Id: <u9vgsbz41k.fsf@wcl-l.bham.ac.uk>

nobull@mail.com writes:

> So why did you post to a Perl newsgroup?

Hmmm... sorry that was a bit harsh.  I kinda lost tack of the
chronology in this thread.  Guess this has something to do with the
jeopary posting.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Sat, 23 Dec 2000 11:22:58 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: compiler
Message-Id: <5n294t4u6cu2kglbevdudrlkh8vf9trhqm@4ax.com>

chrisain wrote:

>is there a program / compiler for win that turns perl scripts in .exe mode?

Only commercial. <http://www.indigostar.com/perl2exe.htm>. And it's not
a real EXE: it's a combination of a PERL.EXE plus your script stored as
text, probably as a resource.

-- 
	Bart.


------------------------------

Date: Sat, 23 Dec 2000 14:13:49 +0100
From: "Karol Nowakowski" <karol@imm.org.pl>
Subject: Re: file size - outside url?
Message-Id: <3a44a539$1@news.home.net.pl>


Uzytkownik "Tony Curtis" <tony_curtis32@yahoo.com> napisal w wiadomosci
news:871yv0f36m.fsf@limey.hpcc.uh.edu...
> > but when I wan't: $urlzd =
> > "http://www.server.com/catalogue/catalogue/file.txt"; it doesn't
> > work
> A URL is not (necessarily) a file.
> You need to fetch it (perldoc lwpcook) and then see how much data gets
> returned, if any.

Could You give some more info, maybe an example?


Best Regards,
Karol

Marry Christmas and a Happy New Year





------------------------------

Date: Sat, 23 Dec 2000 13:51:31 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: file size - outside url?
Message-Id: <3A44ADFD.BC59EAE2@wsb.com>

Karol Nowakowski wrote:

> Uzytkownik "Tony Curtis" <tony_curtis32@yahoo.com> napisal w wiadomosci
> news:871yv0f36m.fsf@limey.hpcc.uh.edu...
> > > but when I wan't: $urlzd =
> > > "http://www.server.com/catalogue/catalogue/file.txt"; it doesn't
> > > work
> > A URL is not (necessarily) a file.
> > You need to fetch it (perldoc lwpcook) and then see how much data gets
> > returned, if any.
> 
> Could You give some more info, maybe an example?

Go to a command prompt (or DOS prompt or whatever) and type:

perldoc lwpcook

There are several examples in there.

JH


------------------------------

Date: Sat, 23 Dec 2000 13:54:57 +0100
From: "Bernhard Rittirsch" <rittirsch@gmx.de>
Subject: Hostname?
Message-Id: <92275e$5h2e1$1@ID-26625.news.dfncis.de>

Hello!

I have a script which collects the IP-addresses of my homepage-visitors.

Can someone tell me how I can automatically (with a perl-script) resolve the
hostname of these IPs?

Regards,
Bernhard

-----
Bernhard Rittirsch - Am Eisberg 10 - 86476 Neuburg - Deutschland
Tel.: +49/(0)8283/1324 - Mobile: +49/(0)174/9136870
E-Mail: rittirsch@gmx.de - Homepage: www.uni-ulm.de/~s_britti/




------------------------------

Date: Sat, 23 Dec 2000 13:08:03 GMT
From: Toni Heinonen <b@man.com>
Subject: Re: Hostname?
Message-Id: <MPG.14aed03491ec56698968a@news.inet.fi>

In article <92275e$5h2e1$1@ID-26625.news.dfncis.de>, rittirsch@gmx.de 
says...
> Hello!
> 
> I have a script which collects the IP-addresses of my homepage-visitors.
> 
> Can someone tell me how I can automatically (with a perl-script) resolve the
> hostname of these IPs?
> 
> Regards,
> Bernhard
> 
> -----
> Bernhard Rittirsch - Am Eisberg 10 - 86476 Neuburg - Deutschland
> Tel.: +49/(0)8283/1324 - Mobile: +49/(0)174/9136870
> E-Mail: rittirsch@gmx.de - Homepage: www.uni-ulm.de/~s_britti/
> 
> 
> 
Net::DNS
-- 
uuden talouden broileri


------------------------------

Date: Sat, 23 Dec 2000 13:08:31 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Hostname?
Message-Id: <jt116.967$Kk5.47183@eagle.america.net>

On Sat, 23 Dec 2000 13:54:57 +0100, Bernhard Rittirsch
<rittirsch@gmx.de> wrote:

>I have a script which collects the IP-addresses of my homepage-visitors.
>
>Can someone tell me how I can automatically (with a perl-script) resolve the
>hostname of these IPs?

See gethostbyaddr() in the perlfunc manual page.  

-- 
Garry Williams


------------------------------

Date: Sat, 23 Dec 2000 13:32:30 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: Hostname?
Message-Id: <3A44A988.2E9088A0@wsb.com>

Bernhard Rittirsch wrote:
> 
> Hello!
> 
> I have a script which collects the IP-addresses of my homepage-visitors.
> 
> Can someone tell me how I can automatically (with a perl-script) resolve the
> hostname of these IPs?

Use the gethostbyaddr function.  Here's an example:

## CALL IT LIKE THIS
HostnameLookup('216.32.74.55');

sub HostnameLookup {
    my $IPAddress = shift;

    ## USE THE APPROPRIATE LINE DEPENDING 
    ## ON YOUR VERSION OF PERL

    ## UNDER PERL 5.6.0 OR GREATER
    my $PackedIP = eval($IPAddress);

    ## UNDER OLDER PERLS
    #my $PackedIP = join('', map{chr($_)} split(/\./, $IPAddress));

    ## DO THE LOOKUP
    my $Hostname = gethostbyaddr($PackedIP, AF_INET);

    ## RETURN APPROPRIATE VALUE
    if (defined($Hostname)) {
        $Hostname;
    } else {
        $IPAddress;
    }
}

Hope this helps,
JH


------------------------------

Date: Sat, 23 Dec 2000 13:44:09 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: Hostname?
Message-Id: <J_116.968$Kk5.47442@eagle.america.net>

On Sat, 23 Dec 2000 13:32:30 GMT, Jeff Helman <jhelman@wsb.com> wrote:
>Bernhard Rittirsch wrote:
>> 
>> Hello!
>> 
>> I have a script which collects the IP-addresses of my homepage-visitors.
>> 
>> Can someone tell me how I can automatically (with a perl-script) resolve the
>> hostname of these IPs?
>
>Use the gethostbyaddr function.  Here's an example:
>

use Socket;

>sub HostnameLookup {
>    my $IPAddress = shift;
>
>    ## USE THE APPROPRIATE LINE DEPENDING 
>    ## ON YOUR VERSION OF PERL
>
>    ## UNDER PERL 5.6.0 OR GREATER
>    my $PackedIP = eval($IPAddress);
>
>    ## UNDER OLDER PERLS
>    #my $PackedIP = join('', map{chr($_)} split(/\./, $IPAddress));

    my $PackedIP = inet_aton($IPAddress);

-- 
Garry Williams


------------------------------

Date: Sat, 23 Dec 2000 14:16:26 +0100
From: "Karol Nowakowski" <karol@imm.org.pl>
Subject: Re: how to install a module (a newby on modules)
Message-Id: <3a44a5b2$1@news.home.net.pl>


Uzytkownik "Tad McClellan" <tadmc@metronet.com> napisal w wiadomosci
news:slrn947p8a.8lq.tadmc@magna.metronet.com...
> >I still don't know where to write all this commands.
> >My computer is on Win Millenium
> >But where do I wan't install a module is the virtual server by my ISP
with
> >Unix OS
> >do I have to connect with a telnet to put all this commands?
>               ^^^^^^^^^^^^^^^^^^^^^
> Yes.

Sop that's all my Friends,
I don't have acces to telnet, at least during Xmas.
I see I'll have to talk with admin.

Isn't any other possibility? My good.

Thank You very much for help.
With Regards,
Karol Nowakowski

Marry Christmas and a Happy New Year




------------------------------

Date: Sat, 23 Dec 2000 11:19:16 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Is there a standard, current Perl for Win32 (without ActivePerl?)
Message-Id: <vv194t027aguphemlt7abg0u5lnfugj70i@4ax.com>

John Nagle wrote:

>  Is there a current, standard version of Perl for Win32?  By this I
>mean one without all the "ActivePerl/Active-X/Internet Explorer
>scripting" crap in it?  The only non-ActivePerl binary distributions
>at CPAN seem to be either old versions or have a built-in Apache server.

There's IndigoPerl, <http://www.indigostar.com/indigoperl.htm>. I would
be surprised if there's wasn't a binary port in Cygwin (GPP for Win32),
too. AH, yes: <http://cygutils.netpedia.net/>. Perl 5.6.0 exists for
V1.1.

-- 
	Bart.


------------------------------

Date: Sat, 23 Dec 2000 11:25:38 GMT
From: "David Simmons" <pulsar@qks.com>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the  ULTIMATE oflanguages??)
Message-Id: <SY%06.27144$A06.982705@news1.frmt1.sfba.home.com>



--
-- Dave Simmons [www.qks.com / www.smallscript.com]
  "Effectively solving a problem begins with how you express it."
"Just Me" <just_me@nowhere.com> wrote in message
news:3A41076D.23A764FC@nowhere.com...
> First let me say that I don't want to start yet another religious war
about
> languages, but in Smalltalk this would be:
>
>   |x|
>   x=1.
>
> Notice the same amount of keystrokes? ;-)
>
> Now, let's see a case where Smalltalk is clearly better. Take this code
> from Java for example:
>
>   java.util.Enumeration enum=allEmployees.elements();
>   while( enum.hasMoreElements() ) {
>     Employee eachEmployee=(Employee)enum.nextElement();
>     eachEmployee.firstMethod();
>     eachEmployee.secondMethod();
>   }
>
> ...into Smalltalk:
>
>   allEmployees do: [:eachEmployee |
>      eachEmployee
>         firstMethod;
>         secondMethod ].

In SmallScript (a language that encompasses Smalltalk) this can also be
written as:

    for(each employee in allEmployees)
       employee firstMethod; secondMethod.


Or, if the "allEmployees" supports different iterators by <type> we can
distinguish them:

    for(each <Employee> e in allEmployees)
       e firstMethod; secondMethod.


We also have the options within the iteration to:
---------------------------
    break.
    continue.
    leave.
    redo.

And, assuming we have an <Iterator> interface and a class
called EmployeeCollection. We could write it with the
following scriptlets: (each is fully self contained and
their text could be evaluated as is)
----------------------------------------------------------

<!--
==========
ASSUMES:
==========

There is some other script that references or defines the
<EmployeeCollection> and <Employee> classes. It also assumes
the existence of the <Iterator> interface within the visible
set of namespaces for this project (or the default if no
explicit project/assembly was specified). Finally, it
assumes that somewhere within the visible namespace scopes
there is a shared (namespace/pool) variable called
"allEmployees".

========== -->

<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees as: Iterator for: Employee.
    [iterator next] whileNotNil: [:e| e firstMethod; secondMethod].
]

<!-- OR -- possibly: -->
<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees#Iterator.for: Employee.
    while(iterator next) [:e| e firstMethod; secondMethod].
]

<!-- OR -- possibly: -->
<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees::Iterator.for(Employee).
    while(iterator next) [:e| e firstMethod; secondMethod].
]

<!-- OR -- possibly: -->
<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees.asFor(Iterator,Employee).
    while(iterator.next) [:e| e firstMethod; secondMethod].
]

<!-- OR -- possibly: -->
<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees.asFor(Iterator,Employee).
    1 to: iterator limit do: [:i| iterator[i] firstMethod; secondMethod].
]

<!-- OR -- possibly: -->
<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees.asFor(Iterator,Employee).
    until(iterator.atEnd) iterator.next firstMethod; secondMethod.
].


<!-- OR -- not at all clear but the message #::(<Behavior>)
           could be written in <Iterator> to provide: -->
method class=Iterator scope=ThisProject [
(<Behavior> doType)
    ^for(doType)
]
<class name=EmployeeCollection interfaces="+Iterator"/>
[
    |iterator| := allEmployees(Employee).
    "" also writeable as 'allEmployees::Iterator.(Employee)'
    while(iterator next) [:e| e firstMethod; secondMethod].
]

-- Dave Simmons [www.qks.com / www.smallscript.com]
  "Effectively solving a problem begins with how you express it."

>
> In Smalltalk it's simple, elegant and easy to read whereas in Java one can
get
> headaches from all these braces. I mean what are braces for anyway if a
> method has no arguments?
>
> And as you can see, no types mean less typing!
>
>
> Kenny Pearce wrote:
>
> > I haven't used SmallTalk, but from this conversation it seems that the
only difference
> > between "everything is an object" and having primitives is that the
latter requires
> > less typing. Ex.
> > int x =1;
> > as opposed to
> > Integer x = new Integer(1);
> >
> > I can't c y there would be any other difference...
>




------------------------------

Date: Sat, 23 Dec 2000 09:02:18 -0500
From: "Ryan & Treena Carrier" <ryanc@nci1.net>
Subject: Need help finding a space in a string with "index"
Message-Id: <3a44b017_1@news.cybertours.com>

I'm trying to determine the first occurrence of a space character in a
string. It seems to me

my $string = "Hello World";
my $spaceLocation = index($string, " ");

should give 5 to $string, but it doesn't work.

Help!





------------------------------

Date: Sat, 23 Dec 2000 12:51:07 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: problem with awk in perl script
Message-Id: <%c116.966$Kk5.47186@eagle.america.net>

On Fri, 22 Dec 2000 18:37:45 -0000, Chris Stith
<mischief@velma.motion.net> wrote:

>`awk '{print $10,$1}' statdata.dat `; # this should work

If you had tried it, you would know it doesn't "work".  

-- 
Garry Williams


------------------------------

Date: Sat, 23 Dec 2000 13:26:44 +0100
From: snef <snef@soneramail.nl>
Subject: Re: PWS - perl (ATTN: cwrites)
Message-Id: <MPG.14aeb86e4910cd969896f4@news.soneraplaza.nl>

In article <3a43ef13.23786830@news.lig.bellsouth.net>, 
bconnats@bellsouth.net says...
> Here is the content of my autoexec.bat file:
> 
> C:\PROGRA~1\NETWOR~1\MCAFEE~1\SCAN.EXE C:\
> @IF ERRORLEVEL 1 PAUSE
> @ECHO OFF
> @REM Setup for QR, BW & HIBERNATE
> @PATH
> C:\CPQS\SAVEREST;C:\CPQS\TOOLS;C:\WINDOWS\COMMAND;C:\WINDOWS;%PATH%;C:\PERL\BIN
> @IF EXIST C:\APPL.ZIP\*.* IF EXIST C:\WINDOWS\SMARTDRV.EXE
> C:\WINDOWS\SMARTDRV.EXE
> @IF EXIST C:\CPQS\SAVEREST\QRSETUP.* CALL C:\CPQS\SAVEREST\QRSETUP
> /MFG C: D: E: F:
> CALL c:\hibernat\hibchk.bat
> CALL C:\CPQS\TOOLS\WINPATH.BAT
> @ECHO OFF
> 
> After adding "C:\PERL\BIN" to the @PATH, my PWS worked fine.
> 
> Brad
> 
> <CUT>
> 
What kind of header do you use?
#!/usr/bin/perl ?
#!perl ?

snef.
(I now installed indigo perl with an apache ntegrated. works ok, but i've 
some problems installing modules. The modules installed fine with 
activestate/PWS....that's why I want to use PWS...)


Snef


------------------------------

Date: Sat, 23 Dec 2000 13:28:09 +0100
From: snef <snef@soneramail.nl>
Subject: Re: PWS - perl
Message-Id: <MPG.14aeb8c41020b2a99896f5@news.soneraplaza.nl>

In article <91vfp9$26e$1@nnrp1.deja.com>, richard_dobson@my-deja.com 
says...
> I had the same problem as you and eventually thought s**d this and
> downloaded Indigo Perl which has an apache web server bundled with it.
> Everything was rosy from then on.
> 
> 
> In article <91qmnt$t03$1@enterprise.cistron.net>,
>   "Sven Franke" <snefsite@hotmail.com> wrote:
> > Hi, I hope you guys can help me out.
> > I use W98(se) and I installed PWS.
> >
> > I make a virtual directory (CGI-BIN) and selected the execute and
> script
> > option.
> >
> > I wrote a little HELLO WORLD (try.cgi) and placed this file into CGI-
> BIN.
> >
> > When I go to http://localhost/CGI-BIN/try.cgi the page cannot be
> displayed
> > or the file is shown totally.
> >
> > What is wrong? I looked at activestate, but the help overthere wasn't
> > solving my problem.
> > I want to use PWS to check my scripts as if they were on the web.
> >
> > Sven.
> >
> >
> 
> 
> Sent via Deja.com
> http://www.deja.com/
> 
can you install modules like Pg.pm ?

Sven


------------------------------

Date: Sat, 23 Dec 2000 13:49:00 GMT
From: chr1st1an <cyner.mail@sweden.com>
Subject: Re: Reverse "append to file"
Message-Id: <3A44ACA7.8020602@sweden.com>

Tad McClellan wrote:

> You *do* have a manual. That is what Joe was pointing out.

Well, I did search a lot of FAQs and "manuals" on the net, including 
perl.com and perldoc.com, but I couldn't find the answer to my question. 
Therefore I thought maybe you could help me here.

> 'perldoc' is installed along with perl. If you have perl, you
> have perldoc.

I don't have perl. I'm only uploading to my home page. I'm new to this 
and was only testing to see what I could do.

> He has not displayed any anti-newbie-to-Perl that I can see.

Well, ok. He didn't, but I didn't get an answer either, only some URLs 
and commands that I either had searched before or hadn't access to.

> He showed you how to find the relevant answer (that you claim
> to have missed).

I still haven't found what I'm looking for. And YES, I've looked. If you 
don't want to answer my question, give me some hints on what to look for 
*on the Internet*, not in perldoc/man.

> You have a strange way of repaying people that answer your questions.
> That may have an effect on the responses that you can expect for
> future questions as well...

I'm sorry if I was rude, but I just thought you could spend some more 
time on me than referring to manuals. And, as I clearly stated in my 
first message, "I did check your and other's FAQs before submitting this 
question." But, sure, you don't HAVE TO help me.

-- 
|
|      chr1st1an
|      cyner.mail@sweden.com
|



------------------------------

Date: Sat, 23 Dec 2000 21:20:58 +0800
From: "Peter Chan" <peter.cch@excite.com>
Subject: what's the 1st line os perl script ?
Message-Id: <3a44a7be.0@news.tm.net.my>

i've install the ActivePerl on my windows PC, then i try to run my perl
program in the HTML that i create.
But it don't work, then i try to edit the 1st line where it state the
location of the PERL compiler to where it is.

Example:
#! /perl/bin/perl

but it doesn't work, i'd tried many times but still the same.

the PERL on my PC info:
compiler located at C:\Perl\bin\perl.exe

so, what's the 1st line that I should put in my perl program ?

Thanks for helping




------------------------------

Date: Sat, 23 Dec 2000 13:38:22 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: what's the 1st line os perl script ?
Message-Id: <3A44AAE8.F7DECF0C@wsb.com>

Peter Chan wrote:
> 
> i've install the ActivePerl on my windows PC, then i try to run my perl
> program in the HTML that i create.

Here's a potential problem.  What do you mean "run my perl program in
the HTML that i create"?  To use a Perl script as a CGI, you need to
have a web server installed and properly configured.

Assuming you have Apache (or something else) properly installed and
configured...

> But it don't work, then i try to edit the 1st line where it state the
> location of the PERL compiler to where it is.
> 
> Example:
> #! /perl/bin/perl
> 
> but it doesn't work, i'd tried many times but still the same.

Because the Perl interpreter is not there.

> the PERL on my PC info:
> compiler located at C:\Perl\bin\perl.exe
> 
> so, what's the 1st line that I should put in my perl program ?

#!c:\perl\bin\perl.exe

JH


------------------------------

Date: Sat, 23 Dec 2000 13:46:21 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: what's the 1st line os perl script ?
Message-Id: <922abd$4ck$1@nnrp1.deja.com>

In article <3a44a7be.0@news.tm.net.my>,
  "Peter Chan" <peter.cch@excite.com> wrote:
> i've install the ActivePerl on my windows PC, then i try to run my
perl
> program in the HTML that i create.
> But it don't work, then i try to edit the 1st line where it state the
> location of the PERL compiler to where it is.
>
> Example:
> #! /perl/bin/perl
>
> but it doesn't work, i'd tried many times but still the same.
>
> the PERL on my PC info:
> compiler located at C:\Perl\bin\perl.exe
>
> so, what's the 1st line that I should put in my perl program ?
>
> Thanks for helping
>
>
Although I have never tried perl on windows I would think the first
line would have to be:

#!C:\Perl\bin\perl.exe

However, I think your main problem is that you need to run the programs
from a command line to test them first. Then, you will have to have a
web server installed and configured properly, that has cgi
capabilities. Apache or something. Only then can you run them locally
through html.

Mark


--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


Sent via Deja.com
http://www.deja.com/


------------------------------

Date: Sat, 23 Dec 2000 11:34:10 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Why are multiple zeroes true?
Message-Id: <uv294t47jqb8l3fqngurl5vd5a62o98tu7@4ax.com>

Ilya Zakharevich wrote:

>The current semantic of trueness allowed the "sane numberics"
>semantic.  [As a minimum, "sane" means no change of value via
>read-only access.]  Thus *there is* at least ONE argument in favor of
>the current semantic.  ;-)

Wishful thinking. There ARE cases, where using a scalar in an expression
changes the nature of the scalar. I think that this is a bug. The whole
thing of bitwise operations acting differently on strings an on numbers,
is dubious.

	for my $skip (0, 1) {
	    $a = '1E2';
	    $b = 3;
	    $c = $skip ? '#' : $a | $b;  # conditionally execute OR
	    $d = '1E1';
	    $e = $a | $d;
	    print "\$skip=$skip: $a $b $c $d $e\n";
	}
-->
	$skip=0: 1E2 3 103 1E1 110
	$skip=1: 1E2 3 # 1E1 1E3

As you can see, if I calculate $a | $b, that changes the nature of $a
from a string to number, which modifies the result for $e.

-- 
	Bart.


------------------------------

Date: 23 Dec 2000 13:04:05 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Why are multiple zeroes true?
Message-Id: <977576019.3933@itz.pp.sci.fi>

In article <uv294t47jqb8l3fqngurl5vd5a62o98tu7@4ax.com>, Bart Lateur wrote:
>Ilya Zakharevich wrote:
>
>>The current semantic of trueness allowed the "sane numberics"
>>semantic.  [As a minimum, "sane" means no change of value via
>>read-only access.]  Thus *there is* at least ONE argument in favor of
>>the current semantic.  ;-)
>
>Wishful thinking. There ARE cases, where using a scalar in an expression
>changes the nature of the scalar. I think that this is a bug. The whole
>thing of bitwise operations acting differently on strings an on numbers,
>is dubious.
 [snip]
>As you can see, if I calculate $a | $b, that changes the nature of $a
>from a string to number, which modifies the result for $e.

Yes, but bitwise ops belong to the dark side of DWIM anyway.  Ilya was
talking about boolean context, where his claim is in fact true.

However, I do think I can see how the bitwise ops and related things
could be made (a bit more) sane as well.  It would require scalars to
carry around information about their "original type", which could not
be modified by read only access.  Feature for Perl 6?

Or should Perl 6 just have separate string and integer bitops?

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post
 something, we discuss its implications.  If the discussion happens to
 answer a question you've asked, that's incidental." -- nobull in clpm



------------------------------

Date: 23 Dec 2000 12:44:58 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: yet another question: is ' more efficient than "?
Message-Id: <977574648.1846@itz.pp.sci.fi>

In article <92107o$8dk$1@nnrp1.deja.com>, timallen449@my-deja.com wrote:
>
>   The percentages I got were based on using cmpthis, not timethis, but
>my code was essentially the same as yours.  I just included three test
>cases, one of which was a long line of about 1024 characters.  I later
>had to process the output file to get rid of the results of the print
>statements.
>   cmpthis returns straight percentage comparisons of different
>strategies.  The percentages I got were read directly from these.  I
>found that in the part about benchmarking in Programming Perl.

Right.  The point I was making that the values from Benchmark.pm are
statistical, and we all know that statistics come just after lies and
damned lies.

So you need to a) understand exactly what the code you're benchmarking
does, as opposed to what it should do, b) use enough iterations to
minimize statistical fluctuations, c) understand that there will still
be *some* fluctuation, and d) understand that some of those may not be
random, but rather a systematical result of lazy perl optimizations or
too clever task schedulers.

Actually, the corrected benchmark I sent was a perfect illustration of
the above.  You see, what I happen to know is that the two codes are
in fact precisely equal in speed, since they get compiled to the exact
*same bytecode*.

So what I was doing was benchmarking a piece of code against itself.
For 4194304 iterations.  And the results still weren't exactly equal.

Anyway, it's no mortal sin to post a bogus benchmark once.  Errare
humanum est, et cetera.  You are, however, expected to learn from the
mistake and not do it again.  My post was an attempt to help you with
that.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post
 something, we discuss its implications.  If the discussion happens to
 answer a question you've asked, that's incidental." -- nobull in clpm



------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5188
**************************************


home help back first fref pref prev next nref lref last post