[6444] in Perl-Users-Digest
Perl-Users Digest, Issue: 69 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 7 06:15:54 1997
Date: Fri, 7 Mar 97 03:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 7 Mar 1997 Volume: 8 Number: 69
Today's topics:
@INC and NT Perl <ronen_lazar@ccm.jer.intel.com>
@INC and NT Perl <ronen_lazar@ccm.jer.intel.com>
@INC and NT Perl <ronen_lazar@ccm.jer.intel.com>
@INC and NT Perl <ronen_lazar@ccm.jer.intel.com>
@INC and NT Perl <ronen_lazar@ccm.jer.intel.com>
@INC and NT Perl <ronen_lazar@ccm.jer.intel.com>
Re: Creating a new empty file from within Perl.. (Brian Menke)
Debugger and my variables. (Mark A. Lehmann)
Debugging. Setting a breakpoint for a line in another (Mark A. Lehmann)
Re: Debugging. Setting a breakpoint for a line in anot (Ilya Zakharevich)
Directory traversal and symbolic links (David M Holmes)
Re: Formatting numbers <walter@wbriscoe.demon.co.uk>
HELP!?! - Perl from UNIX shell??? (Steve)
Re: How to make perl scripts appear locally on the brow <dak@brigadoon.com>
Re: Knowing the pid of a fork()'ed child, really <roderick@argon.org>
Multiline Strings into a List/Array <schajer@dircon.co.uk>
Need a programmer webmaster@gcmassociates.com
Re: newbie question: check if a number is in a list (Dave Thomas)
Re: newbie question: check if a number is in a list (Daniel Macks)
Perl Basic ( DOS/Win) (Sun Tong)
Re: Perl on Windows 95 (Hans Schrader)
Re: PLEASE HELP! I don't wanna get fired tomorrow!! My (MegaZone)
Possible bug in regular expression form /\d{x,x}/ <wjsand01@starbase.spd.louisville.edu>
SSI with PERL and win95/NT <vidar5@tott.hibu.no>
Re: using perl to check for plug-ins? (Nathan V. Patwardhan)
Re: using perl to check for plug-ins? <mgjv@comdyn.com.au>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 07 Mar 1997 10:46:13 +0200
From: Ronen Lazar <ronen_lazar@ccm.jer.intel.com>
Subject: @INC and NT Perl
Message-Id: <331FD5D4.44D8@ccm.jer.intel.com>
hello to you all good people
If any of you could please answer this question, I'd be more than
thankful:
I understand that '@INC' is the path for the perl scripts library,
but how can I change it in a permanent way to another path, just like I
can do with environment variables on NT?
A silly question???
Thanx,
Ronen.
------------------------------
Date: Fri, 07 Mar 1997 10:46:18 +0200
From: Ronen Lazar <ronen_lazar@ccm.jer.intel.com>
Subject: @INC and NT Perl
Message-Id: <331FD5DA.61DE@ccm.jer.intel.com>
hello to you all good people
If any of you could please answer this question, I'd be more than
thankful:
I understand that '@INC' is the path for the perl scripts library,
but how can I change it in a permanent way to another path, just like I
can do with environment variables on NT?
A silly question???
Thanx,
Ronen.
------------------------------
Date: Fri, 07 Mar 1997 10:51:44 +0200
From: Ronen Lazar <ronen_lazar@ccm.jer.intel.com>
Subject: @INC and NT Perl
Message-Id: <331FD720.1F76@ccm.jer.intel.com>
hello to you all good people
If any of you could please answer this question, I'd be more than
thankful:
I understand that '@INC' is the path for the perl scripts library,
but how can I change it in a permanent way to another path, just like I
can do with environment variables on NT?
A silly question???
Thanx,
Ronen.
------------------------------
Date: Fri, 07 Mar 1997 10:44:56 +0200
From: Ronen Lazar <ronen_lazar@ccm.jer.intel.com>
Subject: @INC and NT Perl
Message-Id: <331FD587.3825@ccm.jer.intel.com>
hello to you all good people
If any of you could please answer this question, I'd be more than
thankful:
I understand that '@INC' is the path for the perl scripts library,
but how can I change it in a permanent way to another path, just like I
can do with environment variables on NT?
A silly question???
Thanx,
Ronen.
------------------------------
Date: Fri, 07 Mar 1997 10:49:06 +0200
From: Ronen Lazar <ronen_lazar@ccm.jer.intel.com>
Subject: @INC and NT Perl
Message-Id: <331FD681.75B6@ccm.jer.intel.com>
hello to you all good people
If any of you could please answer this question, I'd be more than
thankful:
I understand that '@INC' is the path for the perl scripts library,
but how can I change it in a permanent way to another path, just like I
can do with environment variables on NT?
A silly question???
Thanx,
Ronen.
------------------------------
Date: Fri, 07 Mar 1997 10:49:20 +0200
From: Ronen Lazar <ronen_lazar@ccm.jer.intel.com>
Subject: @INC and NT Perl
Message-Id: <331FD68F.441@ccm.jer.intel.com>
hello to you all good people
If any of you could please answer this question, I'd be more than
thankful:
I understand that '@INC' is the path for the perl scripts library,
but how can I change it in a permanent way to another path, just like I
can do with environment variables on NT?
A silly question???
Thanx,
Ronen.
------------------------------
Date: 6 Mar 1997 18:03:14 GMT
From: bmenke@wasco.synopsys.com (Brian Menke)
Subject: Re: Creating a new empty file from within Perl..
Message-Id: <5fn0t2$7f5@hermes.synopsys.com>
In article <ByeBye-ya02408000R0303972357380001@news.ping.be>, ByeBye@www.dma.be (Aegir) writes:
|>
|> Following problem :
|>
|> I'm writing a little CGI in perl (works perfectly..). But one of the things I
|> need is to create a none existing new file (a new one for each new
|> user). I can't do this with the open command, which will die when I
|> open a none existing file..
|>
|> Ok, how do I create a new file from within perl ? It's running on an
|> UNIX server...Would this mean I have to send an UNIX command like
|> ? If yes, what command ? I can't find one..
|>
|> On the other hand..It's probably me, not noticing which powerfull
|> command Perl has hidden somewhere for me to create a file ...
|>
|> Anyone can help me out with this one...Source (small) would be
|> appreciated..
|>
|> --
|> Wondering where and how it started...
|> Bugs !....
|>
|> Warning ! Return Email address is changed to fool junk mail: return
|> through mail at Aegir@www.dma.be
I probably am misinterpreting the none existing file to mean non existing
file. If thats not true, forget the rest of this message, it won't help.
I write CGI stuff all the time that creates new files using the open
command. Example:
$path = "path_to_where_you_want_the_file";
$filename "name_of_file_to_create";
open(FILE, ">$path/$filename") || die "Can't create $path/$filename $!\n";
print FILE "Here is some text to put in the file\n";
close(FILE);
The file now exists is $path, or at least it should.
If I want to append to the file, I usually have to make it world writable.
Example: chmod(0777, "$filename"); And then of course use >> instead of
> in the open command.
Make sure that you have world write permissions in $path. This always messes
me up :-)
Hope this helps. If I didn't really understand your problem, sorry.
-Brian M.
Just another Perl wannabe.
------------------------------
Date: 06 Mar 1997 17:16:18 -0600
From: mlehmann@prismnet.com (Mark A. Lehmann)
Subject: Debugger and my variables.
Message-Id: <5bsp28ehml.fsf@smokey.prismnet.com>
Whenever I try to look at an @array or a %hash which are defined with 'my' in
a function using the debuggers X or V commands, I get an empty return.
However, I can print the @array or %hash. How can I use the X or V commands
to show me the 'my' variables?
--
Mark Lehmann.
------------------------------
Date: 06 Mar 1997 11:23:06 -0600
From: mlehmann@prismnet.com (Mark A. Lehmann)
Subject: Debugging. Setting a breakpoint for a line in another file.
Message-Id: <5b67z5sznp.fsf@smokey.prismnet.com>
I have a programs that requires 186 other perl files (about 15600 lines of
Perl Code). When debugging, I set the breakpoints in a file after the
debugger has executed a line of code in that file. However, this means that
I have to set 1 to 20 breakpoints in my debugging session every time I debug.
I would like to just indicate to the debugger, you will be using this
function in this file, and when you do, stop there. How can I accomplish
this task?
Do I need to write an extension to the debugger and specifically search for
this line?
I'm using the emacs 'perldb' debugger to do my debugging. I don't see a way
to make the emacs interface do this for me, so I think a perl debugger
extension is my only current solution.
--
Mark Lehmann.
Grateful Perl programmer.
------------------------------
Date: 7 Mar 1997 10:23:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Debugging. Setting a breakpoint for a line in another file.
Message-Id: <5foqab$olp$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Mark A. Lehmann
<mlehmann@prismnet.com>],
who wrote in article <5b67z5sznp.fsf@smokey.prismnet.com>:
> I have a programs that requires 186 other perl files (about 15600 lines of
> Perl Code). When debugging, I set the breakpoints in a file after the
> debugger has executed a line of code in that file. However, this means that
> I have to set 1 to 20 breakpoints in my debugging session every time I debug.
> I would like to just indicate to the debugger, you will be using this
> function in this file, and when you do, stop there. How can I accomplish
> this task?
>
> Do I need to write an extension to the debugger and specifically search for
> this line?
>
> I'm using the emacs 'perldb' debugger to do my debugging. I don't see a way
> to make the emacs interface do this for me, so I think a perl debugger
> extension is my only current solution.
Yes, if you consider writing a .perldbrc as writing an extension to
the debugger - but judging by the size of your program, it should not
be a case.
The command
b postponed subname [cond]
is documented in latest perls.
The simplest way to use it in your environment is to write these
commands (without "postponed", in fact), to a file, dump the file to
the terminal - thus setting the breakpoints, then `R'estart debugger
(this trick is documented) - it will setup postponed breakpoints
itself.
Less obvious (undocumented) trick is to put the commands in
@DB::typeahead (Hmm, I think I spotted a bug around, will check
later). Or you can use (kinda documented) %DB::postponed directly.
Feel free to contact me if you have better suggestions.
Ilya
------------------------------
Date: Thu, 6 Mar 1997 19:16:01 GMT
From: david.holmes@bigfoot.com (David M Holmes)
Subject: Directory traversal and symbolic links
Message-Id: <331f101e.36123102@news.is.chbs>
Hi,
I wrote this simple script a while ago, as a prelude to allowing me to do
various things on bunches of files within a directory hierarchy.
It sort of works - it outputs a tree structure for the first few
subdirectories, then stops, only printing out the names for the rest of
the directories found initially in $startdir. No error messages are
output, and so I wondered what could be wrong. But then I noticed that it
goes wrong just after it has output the entries for a symlinked directory.
It chdir's into the symlinked directory OK, and then chdir's back up to my
home directory. But the rest of the files/directories in @sortedfiles
only have their names output. Please could you take a look at it and tell
me if I'm missing the obvious or not understanding an aspect of Unix
maybe. A critical peer review of my code would be helpful too; not that
there's much to it 8^)
My perl info is here, with the code beneath it.
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
Platform:
osname=irix, osver=5, archname=IP22-irix
uname='irix esper 5.3 11091812 ip22 mips '
hint=recommended, useposix=true, d_sigaction=define
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags='-D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -DLANGUAGE_C'
ccflags ='-D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -Olimit 3000
-DLANGUAGE_C'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=1, d_casti32=define, d_castneg=
intsize=4, alignbytes=8, usemymalloc=n, randbits=15
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lmalloc -lsun -lm -lc -lcrypt -lbsd -lPW
libc=/usr/lib/libc.so, so=so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags=' ', lddlflags='-shared -L/usr/local/lib'
@INC: /usr/local/lib/perl5/IP22-irix/5.003 /usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/IP22-irix /usr/local/lib/perl5/site_perl .
#!/usr/local/bin/perl -w
#
#**************************************************************
# traverse
#
# A program to output a directory structure listing.
# The starting directory can be specified on the command
# line, otherwise the current directory is the default.
#
# Copyright (c) 1996 David M Holmes <david.holmes@bigfoot.com>
#**************************************************************
use strict;
use vars qw($depth);
use diagnostics;
my $startdir;
#--------------------
# function prototype
#--------------------
sub scandir($);
#------
# main
#------
unless (defined($startdir = shift)) { $startdir = '.' }
$depth = 0;
scandir $startdir;
#----------------------------------------------------------------
# scandir
# Recursively steps through directories to output a directory
# structure listing.
#----------------------------------------------------------------
sub scandir($) {
my $thisdir = shift;
local *THISDIR;
my (@allfiles, @sortedfiles) = ();
my $currentdepth = $depth++;
my $file;
chdir "$thisdir" or die "Can't cd to $thisdir: $!";
opendir THISDIR, "." or die "Can't open $thisdir directory: $!";
@allfiles = grep !/^\.\.?$/, readdir THISDIR;
closedir THISDIR;
@sortedfiles = sort @allfiles;
foreach $file (@sortedfiles) {
chomp $file;
print " " x $currentdepth, "$file\n";
if (-d "$file") {
scandir "$file";
}
}
chdir ".." or die "Can't cd up a directory level: $!";
$depth--;
}
__END__
Sorry if I've been a bit verbose.
Dave
--
David M Holmes | Novartis, Inc.
david.holmes@bigfoot.com | holmes@chbs.ciba.com
----------------------------+------------------------
Dave's Origami - http://www.geocities.com/Tokyo/2162/
------------------------------
Date: Fri, 7 Mar 1997 08:17:32 +0000
From: Walter Briscoe <walter@wbriscoe.demon.co.uk>
Subject: Re: Formatting numbers
Message-Id: <0OQoLAAc88HzEwKW@wbriscoe.demon.co.uk>
In article <ken-0503971001270001@news.swarthmore.edu>, Ken Williams
<ken@forum.swarthmore.edu> writes
>In article <331C69F7.4C73@realogic.com>, Diana Duncan
><dduncan@realogic.com> wrote:
>> Use sprintf.
>> $rounded_number = sprintf("%.2f", $number);
>>
>> Now, I've heard noises that sprintf is not efficient, but haven't seen
>> any other rounding functions. Are there any? What are the many ways to
>> do this?
>
>Here's one:
>
>$rounded = &round(5164.583, 2); # Chops to 2 decimal places
>$rounded2 = &round(5164.583, -2); # Chops to hundreds place
>
>sub round {
> my $number = shift @_;
> my $n = shift @_;
>
> my $mult = 10**$n;
return int($number*$mult + $mult/2) / $mult;
# Seems better to me. It rounds >= 0.5 upwards and < 0.5 downwards
# Your code truncates or chops the digits beyond those to be printed.
# With my code &round( 5164.583, -2) == 5200 while
# &round(-5164.583, -2) == -5100.
# The fix to get 5200 and -5200 is
# my $delta = ($number >= 0) ? $mult/2 : -$mult/2;
# return int ($number*$mult + $delta)/$mult;
# Note the positioning of brackets which reinforces the meaning.
# I feel more comfortable with:
# return int(($number*$mult + $delta)/$mult);
# Apologies for any errors in this lot. It is dashed off at home
# where I have news and no perl; at work I have perl and no news.
>
> return int($number * $mult) / $mult;
>}
That truncates rather than
--
Walter Briscoe
------------------------------
Date: Fri, 07 Mar 1997 09:59:46 GMT
From: steve@alexandros.cperi.forth.gr (Steve)
Subject: HELP!?! - Perl from UNIX shell???
Message-Id: <331fe632.3140332@news-the.forthnet.gr>
A simple question I hope - but I can't even get a basic PERL script or
CGI to run from any UNIX shell. If I type in for example menu.cgi or
menu at the prompt it would return menu.cgi - Command not found.
I know the program works because it runs ok from within webpages.
Thanks in advance.
Steve
------------------------------
Date: Fri, 07 Mar 1997 01:40:14 -0500
From: "Dmitriy A. Kropivnitskiy" <dak@brigadoon.com>
Subject: Re: How to make perl scripts appear locally on the browser
Message-Id: <331FB84E.1E08@brigadoon.com>
herryh@xs4all.nl wrote:
Hi,
I have a problem getting my perl-scripts to output to my browser.
presently I test my scripts by copying them to the perl\bin dir. and
run
perl myfile.pl > myfile.html
and then have my browser read myfile.html.
But what I really want is having my browser read the perl script
directly. But all that happens is a unreadably quick appearing
and disappearing dos-box saying Bad Command or Filename.
I want the same output as when I run it manually at the dosprompt
and I want the output being directed to my browser.
I installed O'reilly's Website, Netscape 3.01 and Win32 Perl.
Please help me!!!
thank in advance
Herry
OK I have Perl5 for Win32 and WebSite. It works for me and here are the
directions.
1. Add directory where your perl.exe resides to your path
2. Associate .pl extention with Perl.
3. Remove any MIME types for .pl files if your browser has any.
4. Put your scripts in the directory specified for Standard CGI.
5. run your scripts like this
http://localhost/your_standard_cgi_directory/your_script.pl
CGIs can only run from designated directory by default it is
c:\website\cgi-shl which has virtual mapping as /cgi-shl/ and /cgi-bin/
if you did not change it you should run fine if you follow directions
above. From you leter I figure you forgot step 2 or did not do it right.
If you have problems E-mail me.
Dmitriy
------------------------------
Date: 6 Mar 1997 20:16:03 -0500
From: Roderick Schertler <roderick@argon.org>
To: Elliott McCrory <mccrory@fnal.gov>
Subject: Re: Knowing the pid of a fork()'ed child, really
Message-Id: <pzbu8wld6i.fsf@eeyore.ibcinc.com>
On Wed, 05 Mar 1997 09:14:19 -0600, Elliott McCrory <mccrory@fnal.gov> said:
>
> For example, if you do `exec("some-process 2> errorlog")` [...]
> exec() recognizes the ">" shell metacharacter and says "sh -c
> some-process 2>errorlog" (in this case), creating a new pid number.
Have the shell you're running exec the final process you're interested
in.
exec "exec some-process 2>errorlog";
Another approach would be to have the shell save it's $! (pid of last
child forked) somewhere for you to read it.
--
Roderick Schertler
roderick@argon.org
------------------------------
Date: Fri, 07 Mar 1997 10:21:22 +0000
From: Alex Schajer <schajer@dircon.co.uk>
Subject: Multiline Strings into a List/Array
Message-Id: <331FEC22.ABD@dircon.co.uk>
Hi,
I've created a variable that contains a web page (LWP library). However
I want to be able to follow the links on that page and retrieve the next
set of pages.
I thought about pattern matching <A HREF> or grep'ing. For grep I need a
list to work through, which I don't know how to do...
So, if anyone can shed any light or point me in the right direction I
would be most grateful,
Thanks in advance,
Alex
------------------------------
Date: Thu, 06 Mar 1997 19:51:13 -0600
From: webmaster@gcmassociates.com
To: webmaster@gcmassociates.com
Subject: Need a programmer
Message-Id: <857699028.14918@dejanews.com>
I am looking for an experienced programmer in Perl. I wil pay for some
scripts to be made. Serious inquiries only.
Just reply to this posting if you are interested. Provide your telephone
number and I will call you long distance on my dime!
I am in need of 3-6 perl scripts, some very advanced.
Thank You,
Gabriel Murphy
GCM & Associates LCC.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 7 Mar 1997 04:42:39 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: newbie question: check if a number is in a list
Message-Id: <slrn5hv6vh.lbo.dave@fast.thomases.com>
On Thu, 06 Mar 1997 19:32:04 -0600, brz@hotmail.com <brz@hotmail.com> wrote:
> Say I have a list of numbers {1, 2 ,4, 6, 9}
OK, you have a list of numbers.
> and I want to check if $a is in this list...
> how do i do it?
You could use 'grep', which will return any matches it finds (or a count in
scalar context).
if (grep($a, @list)) {
...
}
However, if this kind of test is happening a lot in your program, you might
want to investigate using a hash (associative array) where the keys are the
numbers in your list (and the values are something other than zero). Then
you can test in a single hit:
my %lookup;
my @list = (1,2,3,4,5);
# Set $lookup{1} = 1, $lookup{2} = 1 etc.
map { $lookup{$_} = 1 } @list;
if ($lookup{$a}) {
...
}
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 7 Mar 1997 07:44:04 GMT
From: dmacks@netspace.org (Daniel Macks)
Subject: Re: newbie question: check if a number is in a list
Message-Id: <5foh04$cun@cocoa.brown.edu>
brz@hotmail.com wrote:
: Say I have a list of numbers {1, 2 ,4, 6, 9}
: and I want to check if $a is in this list...
: how do i do it?
If you only have to check one number, you just loop through the list until
you either find it or run out of values in the list (or if you know the
list is sorted or sort if yourself, you can stop when you encounter a
number less than the test value, or start with the middle value and do a
binary search or somesuch).
If you're gonna be checking a lot of values, it would be faster to
generate a hash of the values, since perl can quite efficiently check for
the existence of a key in a hash. IIRC there's an example in the Pink
Camel, but since I can't find it in the new version...
@numbers = (1,2,4,6,9); # (or however your program defines 'em)
foreach $value (@numbers) { # do this loop once
$seen_it[$value]++; # to set up the hash %seen_it
};
$seen_it[$a] ? print "$a is in" : print "not"; # test a value
dan
--
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks
------------------------------
Date: Fri, 7 Mar 1997 01:33:00 -0600
From: tsun@fs.com (Sun Tong)
Subject: Perl Basic ( DOS/Win)
Message-Id: <cUSapFSFTlInternetMail-970307073315Z-133@email.fs.com>
Hi,
I am new to perl but I want to learn and use it very much. I've got
several questions. First let me say I've done my best to solve them and
they are not silly questions. For:
1. I am a good C programmer. 2. I use Awk quiet well. 3. I've gone over
perl manual twice. 4. I've gone over perl FAQ.
Please help me. My questions followed:
====
Why can not I install Perl Win32 on my Win95?
I downloaded it from ZD net (PERLFR.ZIP 1,061,020 04-04-93 8:48a),
with:
PERL EXE 61,952 04-17-96 12:13p
PERL100 DLL 506,368 04-16-96 4:50p
(My machine: P133/32M/1.6G)
The following is the result when I tried to install:
E:\Collect\perl5>del perl.exe
E:\Collect\perl5>copy ntt\perl.exe .
1 file(s) copied
E:\Collect\perl5>if not exist ntt\perl100.dll goto perlnotthere
E:\Collect\perl5>del perl100.dll
E:\Collect\perl5>copy ntt\perl100.dll .
1 file(s) copied
E:\Collect\perl5>if exist perl.exe goto perlhere
E:\Collect\perl5>if exist perl100.dll goto perldllhere
E:\Collect\perl5>perl.exe -S install.bat
Can't execute install.bat.
E:\Collect\perl5>goto endofperl
----
Then I tried and got:
E:\Collect\perl5>perl -de 0 -S install.bat
Can't execute pla26953.
Then I tried and got:
E:\Collect\perl5>perl -de 0 -e 'print "Hello, world\n"'
Can't locate perl5db.pl in @INC.
BEGIN failed--compilation aborted.
Do I have to "set" anything? I didn't find any in the readme.txt and
install.txt.
----
Feeling much disappointed, I went to ntt directory and tried to run
test.bat and got the following.
"Failed 2/76 tests, 97.37% okay."
This is really encouraging. I think I am not too far from success.
----
Then I tried and got:
E:\Collect\perl5>set perl5lib=e:/collect/perl5/lib
E:\Collect\perl5>set perl5db=e:/collect/perl5/lib
E:\Collect\perl5>perl -de 0 -e 'print "Hello, world\n"'
Bare word found where operator expected at -e line 0, near
"/collect/perl5"
(Missing operator before perl5?)
syntax error at -e line 0, near "/collect/perl5"
Number found where operator expected at -e line 1, near "0"
(Missing semicolon on previous line?)
String found where operator expected at -e line 2, at end of line
(Missing operator before ?)
Can't find string terminator "'" anywhere before EOF at -e line 2.
----
Then I tried and got:
E:\Collect\perl5>perl -w -e 'print "Hello, world\n"'
Can't find string terminator "'" anywhere before EOF at -e line 1.
E:\Collect\perl5>perl -w -e 'print "Hello, world\n" '
Can't find string terminator "'" anywhere before EOF at -e line 1.
You see. I've tried everything I could think about. What's wrong?
Help me. Please. I just need a kick off.
====
Another simple question:
As you know, I am new to perl. and though the manual is well written, it
is not a step by step guide. Any clue or hint for perl beginners,
please?
====
Another simple question, sorry for so many. This is the last.
As for a perl beginner, which is better, perl5 for dos or perl5 for
win32?
Which and where is the latest perl5 for dos version? -- You see, I've
got email only access to internet, and the faq merely says looks into...
Many Thanks.
Sun Tong
------------------------------
Date: Fri, 07 Mar 97 08:39:11 GMT
From: hans.schrader@geol.uib.no (Hans Schrader)
Subject: Re: Perl on Windows 95
Message-Id: <5foktn$egd$1@toralf.uib.no>
In article <331edf96.298657866@news.airmail.net>, millsjw@airmail.net (Walt Mills) wrote:
NEVER place the perl executable anywhere into your server tree! You are
calling for trouble! And it is ABSOLUTELY NOT neccessary! The file
association takes care of the perl location plus you can have the path set
in the autoexec.bat file!
>On Fri, 28 Feb 1997 09:16:18 -0500, Charlie Wu
>>
>>I have Perl5.003 and pws1.0 - and also associated .pl with
>>c:\perl5\bin\perl.exe, and in the registry added an entry
>>".pl c:\perl5\bin\perl.exe" (as suggested in one of the dejanews
>>articles) but still no luck...
>>
>
>The short answer:
>
>1) Put Perl in the /cgi directory. (dangerous)
>2) Call your script with
>http://yourserver.com/cgi/perl.exe?script.pl
> or use a batch file that has:
>
>@perl.exe script.pl
>
>as the only line.
>
>There are also some clever ways to have the batch file call itself and
>invoke Perl on itself and execute. Saves one file and is cleaner.
>
>Steps 1 & 2 will tell you if Perl is going to work. Perl should also
>work at the command prompt in the /cgi directory. You will see the
>HTML output when you invoke perl.exe script.pl
>
>add a -w for some troubleshooting hints (perl.exe -w script.pl)
>
Hans Schrader-Eureka's SySop:
"nglhs@alf.uib.no"--"http://hjs.geol.uib.no/"
------------------------------
Date: 7 Mar 1997 05:56:44 GMT
From: megazone@livingston.com (MegaZone)
Subject: Re: PLEASE HELP! I don't wanna get fired tomorrow!! My girlfriend leaves me last week now this! Ugh!
Message-Id: <5foams$hn0@news9.noc.netcom.net>
Steve.Karr@Media-Link.Com shaped the electrons to say:
>SOLUTION: to be able to click on a file and have a browser pop up
>dialog to save it locally (no matter the file type) for the user to
>download it with out having to right click save as. I need to serve
>up files. No biggie? I've been working on this since Monday morning
>and I'm way burned out.
>
>PROBLEM: (1) when the save box appears, the default save as filename
>is my script name...I need to be able to suggest file name (2) this
>script works with (successfully downloads) text files, but nothing else.
>It trys, but the files are corrupt. They end up being the same size
This is from a source code download form I have where the user can pick 3
types: tar, tar.Z, tar.gz
Content-Disposition seems to work for Netscape and a few others, but I don't
believe MSIE has a way to set the save name.
# Sends the tarfile to the end user as a octet-stream
sub DownLoad {
if ($in{'version'} eq Gzip) {
$dlfile = "radius.tar.gz";
}
elsif ($in{'version'} eq Compress) {
$dlfile = "radius.tar.Z";
}
else {
$dlfile = "radius.tar";
}
# You don't care about this...
# &SetUserDataCookie;
print "Content-Type: application/octet-stream\n";
print "Content-Disposition: attachment; filename=\"$dlfile\"\n\n";
open (TARFILE, "<$dlfile") || die "Can't open TARFILE: $!";
while ($data = <TARFILE>) {
print $data;
}
}
-MZ
--
Livingston Enterprises - Chair, Department of Interstitial Affairs
Phone: 800-458-9966 510-426-0770 FAX: 510-426-8951 megazone@livingston.com
For support requests: support@livingston.com <http://www.livingston.com/>
Snail mail: 4464 Willow Road, Pleasanton, CA 94588
------------------------------
Date: Fri, 7 Mar 1997 00:16:23 -0500
From: "William J. Sandman" <wjsand01@starbase.spd.louisville.edu>
Subject: Possible bug in regular expression form /\d{x,x}/
Message-Id: <Pine.HPP.3.91.970307000525.20984B-100000@romulus.spd.louisville.edu>
Greetings,
I may have found a bug (or then again it could be pilot error)
When I implement a regular expression evaluation of the form:
if( @dog =~ /\d{5,5}/){
do stuff
}
where dog is $dog = 12345; the if evaluates to true.
When $dog is less that 5 digits the if evaluates to false. Since the
upper limit is also 5. If there are more that 5 digits the if SHOULD
evaluate to false. In my applications it is evaluating to true in cases
where the upper limit (second value is either the same as the first of if
different.
What's the gig. Am I stoned?(read pilot error).
Community feedback on this is welcom, as I'm fairly comfortable with
Perl, I've always had conceptual problems with regular expressions.
THANKS!
--
W.J. Sandman III Linux...
Speed Scientific School It's not just for
Univ. of Louisville, Louisville, Ky. USA Breakfast anymore
wjsand01@starbase.spd.louisville.edu
------------------------------
Date: Fri, 07 Mar 1997 08:55:01 +0100
From: Vidar Markussen d2b <vidar5@tott.hibu.no>
Subject: SSI with PERL and win95/NT
Message-Id: <331FC9D5.61C7@tott.hibu.no>
How do you implement Server Side Include in a script
on a WIN95 server?
Can you do something with Content-type?
--
Vennlig hilsen / Best regards:
Vidar Markussen E-mail: vidar5@tott.hibu.no
Skolegata 17 Phone: +47-327363333
3600 KONGSBERG
NORWAY
------------------------------
Date: 7 Mar 1997 05:36:53 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: using perl to check for plug-ins?
Message-Id: <5fo9hl$omn@fridge-nf0.shore.net>
Calvin (calvin@grin.net) wrote:
: Hi, can perl (as cgi) detect what plug-ins are installed on a users
: machine?
Plug-ins and the like are on the client (your) side, which means that
you can't, as the information should only by visible to the local
machine.
I'd suggest reading about %ENV and CGI on http://hoohoo.ncsa.uiuc.edu.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Fri, 07 Mar 1997 16:03:56 +1100
From: Martien Verbruggen <mgjv@comdyn.com.au>
Subject: Re: using perl to check for plug-ins?
Message-Id: <331FA1BC.327B@comdyn.com.au>
Calvin wrote:
>
> Hi, can perl (as cgi) detect what plug-ins are installed on a users
> machine?
Ask on any of the cgi groups. This has nothing to do with perl.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 69
************************************