[8657] in Perl-Users-Digest
Perl-Users Digest, Issue: 2274 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 8 11:18:21 1998
Date: Wed, 8 Apr 98 08:00:33 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 8 Apr 1998 Volume: 8 Number: 2274
Today's topics:
[Summary] Re: Variable interpolation problems <sbekman@ilx374.iil.intel.com>
Re: Clever algorithms for generating robots.txt from li (Abigail)
directory help and cmod help tiles@pyramidtile.com
directory/cmod tiles@pyramidtile.com
Re: Easy Search Engine...? (Greg Bacon)
Error Running CGI with FastTrack cipa@cipa.com.br
Re: Getting the subroutine name from within a sub <Scott.L.Erickson@HealthPartners.com>
Re: HELP ME PLEASE (Greg Bacon)
Re: Help: Sending a command to another command... (Andrew M. Langmead)
Re: How do I strip newlines from a var (John Moreno)
Re: HOW TO DETERMINE EXECUTABLE VERSION IN WIN95 (Joshua J. Kugler)
Re: How to find modules in WinNT <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: MKDIR problem (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Re: Open Read File of size GT 2 Gig (Casper H.S. Dik - Network Security Engineer)
Re: perl win 32 : asterisk on command line <rothd@xrxoxtxhx.xnxextX>
Re: perl win 32 : asterisk on command line <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: perl win 32 : asterisk on command line <WS010@dvvlap.be>
pidof (Michele Beltrame)
REQ: CGI Banner Exchange <xiphias@dds.nl>
running `ls $file` on a nt workstation in a search scri (tim pickup)
serpinski gasket almost-1-liner needs polishing (Jack Siler)
Re: Tail-like functionality (Greg Bacon)
Re: Tail-like functionality (Andrew M. Langmead)
Timeout script <pr1@club-internet.fr>
Re: Trouble running html2ps perl script on NT4.0 (Joshua J. Kugler)
Re: Win32 ODBC error - object not found <rothd@xrxoxtxhx.xnxextX>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 8 Apr 1998 16:49:49 +0300
From: Stas Bekman <sbekman@ilx374.iil.intel.com>
Subject: [Summary] Re: Variable interpolation problems
Message-Id: <Pine.A41.3.96.980408163845.36778A-100000@ilx374.iil.intel.com>
Thanks a lot for the help!
A few of you suggested things without reading the whole question,
I told that I've already heave 'This is $abc' single quoted, so I couldn't
make it double quoted at first place...
BTW, the solutions people suggested were completely non RTFMable, I RTFMed
before I posted a question. and non eval() help page talked about this
case, or did I miss something?
The following solutions worked:
$abc = 345;
$a = 'This is $abc';
as before
now :
1. $b = eval '"' . $a . '"'; (thanks to Charles G. Margolin )
or
2. $b = eval qq/"$a"/; (thanks to Ronald Schmidt)
which is almost the same
(BTW $b = eval "$a"; didn't work)
print $b,"\n";
produced:
This is 345
exactly what I needed!
Thanks a lot !!!
> > Hi,
> >
> > I'm trying to make the following. But in vain...
> >
> > $abc = 345;
> > $a = 'This is $abc';
> > $b = eval {$a};
> > print $b,"\n";
> >
> > I want to get :
> > This is 345
> > but I get
> > This is $abc
>
______________________________________________________________________
Stas Bekman mailto:sbekman@iil.intel.com http://www.eprotect.com/stas
A must visit: http://www.eprotect.com/stas/TULARC (Java,CGI,PC,Linux)
Linux receives a 'Product of the Year Award' for Best Technical Support
http://www.infoworld.com/cgi-bin/displayTC.pl?97poy.supp.htm
------------------------------
Date: 8 Apr 1998 14:11:26 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Clever algorithms for generating robots.txt from list of allowed files?
Message-Id: <6gg0ie$mib$1@client3.news.psi.net>
Ronald J Kimball (rjk@coos.dartmouth.edu) wrote on MDCLXXXI September
MCMXCIII in <URL: news:352B0235.ECF527D5@coos.dartmouth.edu>:
++ [posted and mailed]
++
++ Ernest Mueller wrote:
++ >
++ > This works fine, except it makes a bigger robots.txt than it needs to (and by
++ > that I mean 600K) - it doesn't understand that if there are no files to be
++ > included under /foo/bar than it should just say Disallow: /foo/bar and not
++ > recursively list every subdirectory and file in /foo/bar.
++
++ Okay, you've got two lists of files. One is a list of files to include, and
++ the other is the list of files in the current directory. What you need to do
++ is compare the two lists. If any of the files in list A are present in list
++ B, then you need to remove them from list B and disallow all the remaining
++ files. If none of the files in list A are present in list B, then you ignore
++ all of list B and just disallow the current directory. You will still need to
++ take into account all the subdirectories.
That fails on infinite webs.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: Wed, 08 Apr 1998 08:40:52 -0600
From: tiles@pyramidtile.com
Subject: directory help and cmod help
Message-Id: <6gfup4$trk$1@nnrp1.dejanews.com>
comp.lang.perl.misc
Correct Directory Paths/Correct Prompts In Telneting to My Shell
Working in Selena Sols shopping cart is starting to be interesting to me.
Even though I am in the beginning stages and making mistakes.
In the read out of the Installation of the Shopping Cart instructions. it it
mentions to put in the correct urls in your browser. To see what you uploaded
through Fetch WS-FTP (Windows).
So I see in the installation instructions the correct path url :
http://www.pyramidtile.com is my domain name so the url goes on to ....
http://www.pyramidtile.com/cgi-bin/Web_store/etc...........
Even though I cant remember the last file name etc. (the instructions arent
with me so I left out the last file name because I cant remember it. But the
important point is that they instrcuctions want /cgi-bin/ my question is
: does cgi-bin (or related name) have to be there?
Can it be http:www.pyramidtile.com//Web_store/ or does it have to be
www.pyramidtile.com/cgi-bin/ or related name.
Can that related name be scripts? So the correct path would be
www.pyramidtile.com/SCRIPTS/Web_store/etc.html
Do you think that would be the reason that the url, when I press enter shows
up an error?
Am I fouling up in telneting to my shell account. I am suppose to make the
various files readable-writeable-executable (which I am JUST beginning to
learn).
So far I typed in my 1***login and password. then type in*** ls then **
*cd public_html. I believe by doing this I received all my *** html
files!!
But what I gather is I am supposed to make all these files that I uploaded
from Selena Sols Web_store executable, readable and writeable (gulp). So
after I recieved all my html files from the telnet prompt.
HOW DO I GET FURTHER FROM JUST MY REGULAR HTML FILES?
Is it chmod 775 Web_store???????
. What code am I supposed to type in to get further, which would be the
Web_store directory.
Being that I have Web_store directly under public_html and not cgi_bin. Is
that whats fowling me up?????:)
Should I contact my ISP to ask them what the correct prompt is, or is it
universal?
I think I am getting close to going on to the next step. Please if you can,
tell me a few more things to get me more aquainted with the chmod telneting
situation:) And of course the correct url:
http://www.pyramidtile.com/?/?/etc.html
Thanks so much for reading :)
and have a nice day!
Bill
http://www.pyramidtile.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 08:31:36 -0600
From: tiles@pyramidtile.com
Subject: directory/cmod
Message-Id: <6gfu7p$t44$1@nnrp1.dejanews.com>
Correct Directory Paths/Correct Prompts In Telneting to My Shell
Working in Selena Sols shopping cart is starting to be interesting to me.
Even though I am in the beginning stages and making mistakes.
In the read out of the Installation of the Shopping Cart instructions. it it
mentions to put in the correct urls in your browser. To see what you uploaded
through Fetch WS-FTP (Windows).
So I see in the installation instructions the correct path url :
http://www.pyramidtile.com is my domain name so the url goes on to ....
http://www.pyramidtile.com/cgi-bin/Web_store/etc...........
Even though I cant remember the last file name etc. (the instructions arent
with me so I left out the last file name because I cant remember it. But the
important point is that they instrcuctions want /cgi-bin/ my question is
: does cgi-bin (or related name) have to be there?
Can it be http:www.pyramidtile.com//Web_store/ or does it have to be
www.pyramidtile.com/cgi-bin/ or related name.
Can that related name be scripts? So the correct path would be
www.pyramidtile.com/SCRIPTS/Web_store/etc.html
Do you think that would be the reason that the url, when I press enter shows
up an error?
Am I fouling up in telneting to my shell account. I am suppose to make the
various files readable-writeable-executable (which I am JUST beginning to
learn).
So far I typed in my 1***login and password. then type in*** ls then **
*cd public_html. I believe by doing this I received all my *** html
files!!
But what I gather is I am supposed to make all these files that I uploaded
from Selena Sols Web_store executable, readable and writeable (gulp). So
after I recieved all my html files from the telnet prompt.
HOW DO I GET FURTHER FROM JUST MY REGULAR HTML FILES?
Is it chmod 775 Web_store???????
. What code am I supposed to type in to get further, which would be the
Web_store directory.
Being that I have Web_store directly under public_html and not cgi_bin. Is
that whats fowling me up?????:)
Should I contact my ISP to ask them what the correct prompt is, or is it
universal?
I think I am getting close to going on to the next step. Please if you can,
tell me a few more things to get me more aquainted with the chmod telneting
situation:) And of course the correct url:
http://www.pyramidtile.com/?/?/etc.html
Thanks so much for reading :)
and have a nice day!
Bill
http://www.pyramidtile.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 8 Apr 1998 14:29:24 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Easy Search Engine...?
Message-Id: <6gg1k4$201$2@info.uah.edu>
In article <352AC8ED.3520@mhv.net>,
Lovette <jlovette@mhv.net> writes:
: What would be the best way to make a search engine? I am working for a
: local hospital and they would like me to build a search engine that
: locates and highlites the text, but this is beyond my abilities.
Perhaps if you posted small samples of your attempts so far, the group
may be able to help point out where you went wrong or suggest better
solutions to your problems.
: Please
: reply via e-mail
What entitles you to free private consulting?
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 08 Apr 1998 08:28:11 -0600
From: cipa@cipa.com.br
Subject: Error Running CGI with FastTrack
Message-Id: <6gfu1b$ssn$1@nnrp1.dejanews.com>
I have Netscape's FastTrack Server 3.0 running in a Novell Netware 4.11
Everything is configured ok, but when i run my cgi file (xxx.pl or xxx.cgi)
my browser returned the following message:
"Server Error
This server has encountered an internal error which prevents it from
fulfilling your request. The most likely cause is a misconfiguration.
Please ask the administrator to look for messages in the server's error log."
and my server's log message is:
"Invalid Format loading file.
Module xxx.cgi was not loaded."
Does anyone know what's going on???????
Please help me!!!!!!
return to:
cipa@cipa.com.br
rodrigorm@altavista.net
angra@usa.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 07:14:43 -0500
From: "Scott L. Erickson" <Scott.L.Erickson@HealthPartners.com>
Subject: Re: Getting the subroutine name from within a sub
Message-Id: <352B6A33.247732B1@HealthPartners.com>
Mark,
Thank you for your help. I admit, prior to your mentioning the caller
function, I was completely unaware of its existence and I did not think
to look in the index for such a function. And to think that it appears
so early in the Camel book. *sigh* Time to re-read the Camel book.
Regarding writing a better Log subroutine, I am calling it from a
library file and it logs more than just the activities of just my code,
it also logs the activities of many other lines of code, so at this
time, I am not inclined to tamper with it. But, I will forward your
suggestion to the code maintainer.
Again, thank you!
Scott.
Mark-Jason Dominus wrote:
> use
> @stuff = caller(0);
> You can do a lot better than that.
> Don't have every function figure out its own name and pass it to the
> logger; instead, have the *logging* subrountine figure out where it
> was called from and include that automatically:
>
> sub Log {
> my $caller = (caller(1))[3];
> print @_, ': ', $caller, "\n";
> }
>
> Then the call just looks like this:
> Log("Begin") if $DEBUG == 2;
------------------------------
Date: 8 Apr 1998 14:31:42 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: HELP ME PLEASE
Message-Id: <6gg1oe$201$3@info.uah.edu>
In article <6gevb2$ppp$1@ionews.ionet.net>,
"Twister" <twrq@usa.net> writes:
: I need some help. How can I do this: when somebody put a the right
: password in a blank, and click "Submit" he or she will receive a file. Thank
: you very much.
This is not a Perl question. You should ask this question in a CGI
newsgroup if (and only if!) you cannot find your answer in the relevant
FAQs or documentation.
Followups set.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 8 Apr 1998 14:20:15 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Help: Sending a command to another command...
Message-Id: <Er3MHs.H7C@world.std.com>
KHAI <khn@engr.uark.edu> writes:
>I'm having a problem sending a command within another command.
Like I said to you last week, telnet is especially tough since some
versions open the controlling terminal rather than reading from
standard input. Most version throw away typeahead too. On programs
that read from STDIN and write to STDOUT, you may be able to use
open() with the pipe option (for controlling one filehandle only), or
the IPC::Open2 module (if you need to handle both.)
For your help with telnet, have you looked at the IO::Expect module
like I suggested? <URL:http://www.perl.com/CPAN-local/modules/
by-authors/Austin_Schutz/Expect.pm-1.04.tar.gz>
Is there are reason why you can't use the LWP modules? If there is,
have you considered opening a TCP connection yourself instead of using
telnet to open one on your behalf? (see the perlipc man page for
details.)
--
Andrew Langmead
------------------------------
Date: Wed, 08 Apr 1998 14:34:53 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: How do I strip newlines from a var
Message-Id: <1d75x00.gzfaza15k2o0rN@roxboro0-025.dyn.interpath.net>
Lasse Hillerxe Petersen <lassehp@imv.aau.dk> wrote:
> rjk@coos.dartmouth.edu wrote:
>
> >And you're propagating another fallacy. "Newbies" are not treated this way.
> >People who post questions which have clear and simple answers in the
> >documentation are treated this way. Not all newbies post such questions, and
> >not all such questions are posted by newbues.
>
> Pardon me for using the word newbie to denote a person who posts questions
> with obvious answers, and not making that usage clear. If you prefer a
> different word, please suggest one. And, no, "troll" will not do, I think
> it connotes a malicious intent which I still refuse to believe is present
> in the general case.
I think "bum" should be the proper term, as in "lazy bum" - these
questions are usually asked by people who don't want to engage their
brains and think about the problem and how to solve it (looking at the
docs is always the second step in trying to do something you don't
understand - right after trying what you think should work. At least
with programming - you just are NOT going to randomly guess the
parameters and their order to various functions)
--
John Moreno
I am trying to convince the author of YA-NewsWatcher that the latest
version should be released to the public. He doesn't think there's much
interest in a new version. Help me prove him wrong. To do so, send me
mail <mailto:phenix@interpath.com> with a Subject of New YA. Comments
on what you like/dislike in the current version will be appreciated.
------------------------------
Date: Wed, 08 Apr 1998 13:54:10 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: HOW TO DETERMINE EXECUTABLE VERSION IN WIN95
Message-Id: <352b8156.1943795@news.inreach.com>
Have you tried 'perl -h'? That will tell you you can type 'perl -v'
or 'perl -V' to get the version number and compile info.
HTH
j----- k-----
On Mon, 30 Mar 1998 15:08:04 -0600, qvanegeren@frxsoft.com wrote:
()I have a bunch of executables in a directory and I need a way to
figure out
()the Version of each of these executables. I know there has to be a
way to do
()this in PERL! I have looked in the Win32::AdminMisc package and
found
()nothing. If anyone has an idea, PLEASE let me know... Thanks in
advance for
()any suggestions you may have...
()
()Quenten Van Egeren
()
()qvanegeren@frxsoft.com
()
()-----== Posted via Deja News, The Leader in Internet Discussion
==-----
()http://www.dejanews.com/ Now offering spam-free web-based
newsreading
I read this group. Sometimes my ISP doesn't. Please e-mail too.
Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!
------------------------------
Date: Wed, 8 Apr 1998 06:21:30 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: How to find modules in WinNT
Message-Id: <6gftks$r64@bgtnsc02.worldnet.att.net>
Assuming you have a file called C:\perl\bin\getopt\std.pm (if you don't you
need to get one), I think the problem is that your path points to the
version of Perl that came with the NT Resource Kit, which is way out of date
and probably doesn't include getopt\std.pm. Try editing your PATH (or have
your sysadmin do it for you if necessary) so that C:\NTRESKIT is behind
C:\perl\lib. NT searches the directories in the PATH variable until it finds
the file you're trying to run, and it's safe to assume that since you have
C:\perl\lib in your path you want to run *that* version of Perl.
This may be a Frequently Asked Question, but if it is I don't know which
one. (Probably not the one about how to search an array for a value,
though.)
Hope this helps,
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
mitchmcc@concentric.net wrote in message
<6geglt$m2o$1@nnrp1.dejanews.com>...
>I just installed Perl on my WinNT WS 4.0. When I try
>to run a test program which loads a library/module,
>I get the following error:
>
>Can't locate Getopt/Std.pm in @INC at test2.pl line 1.
>BEGIN failed--compilation aborted at test2.pl line 1.
>
>My program is simply
>
>use Getopt::Std;
>
>if ($opt_h eq 1) {
> $usage();
> exit 0
>}
>
>My PATH environment variable is set to:
>
>PATH=C:\WINNT\system32;C:\WINNT;C:\NTRESKIT;C:\NTRESKIT\Perl;c:\perl\bin;c:
\pe
>rl\lib
>
>What do I have to do to get Perl to find the library?
>
>THanks in advance,
>
>Mitchell McConnell
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 13:18:13 +0100
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: MKDIR problem
Message-Id: <lassehp-0804981318130001@ra.imv.aau.dk>
In article <Pine.GSO.3.96.980407173416.1034U-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> "A program is written for the computer to interpret, and for the human
> to interpret as well. We hope that they will agree on its meaning!"
Well said. Anyway, I have been corresponding with BJF, and it turns out
the problem was probably that the permissions given with mkdir are subject
to the umask setting. An explicit chmod afterwards is necessary. I'm a
little surprised noone has mentioned this yet?
-Lasse
------------------------------
Date: 8 Apr 1998 12:13:50 GMT
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
Subject: Re: Open Read File of size GT 2 Gig
Message-Id: <casper.892037578@uk-usenet.uk.sun.com>
[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]
Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de> writes:
>> My call to open is failing in attempting to open a file of greater than
>> 2 Gig. Any way around this other than using split?
>Is the call for open failing, or do you try to read
>everything at once in an array? Please provide us an
>example of your code and be more specific. Normally,
>if you do
If this is on Solaris 2.6, you will need to recompile perl to
get access to large files. (This will also redefine lseek and others)
Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
------------------------------
Date: 8 Apr 1998 10:29:09 GMT
From: "Dave Roth" <rothd@xrxoxtxhx.xnxextX>
Subject: Re: perl win 32 : asterisk on command line
Message-Id: <01bd62d9$9ce2daa0$0101a8c0@main2>
WS010 <WS010@dvvlap.be> wrote in article
<01bd62d2$1fa47e10$8c7479c1@dvvbeint0ws010>...
> context: perl for win 32 port
> problem: perl -w somescript.pl -l thisarg -p * -u thatarg
> perl seems to expand the '*' command line argument to the
current directory
> contents.
> in other words: upon invocation the following expression
holds (on my
> systems) :
> @ARGV == ('-l','thisarg','-p','firstfile','secondfile'
..,'-u','thatarg')
> where firstfile and secondfile ... are present in the
current directory.
> question: To my knowledge no such feature is documented
(Yes, I checked the
> canonical documentation resources before posting this).
Any rational
> explanation ?
> Many thanks from: Jos Snellings, Jos.Snellings@1cd4u.com
>
Put the asterisk in quotes and it won't expand:
perl -w somescript.pl -l thisarg -p "*" -u thatarg
dave
--
============================================================
====
Dave Roth ...glittering
prizes and
Roth Consulting endless compromises,
shatter
rxoxtxdxxrxoxtxhx.xnXeXt the illusion of
integrity
My email address is disguised to fool automailers. Remove
the
X's to send me email.
************************************************************
****
Use of this message or email address for commercial
purposes
(including "junk" mailings) is strictly prohibited and
protected
under current international copyright laws and United
States
Code, Title 47, Chapter 5, Subchapter II.
------------------------------
Date: Wed, 8 Apr 1998 06:32:55 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: perl win 32 : asterisk on command line
Message-Id: <6gfua8$id@bgtnsc02.worldnet.att.net>
This is a guess. If it is wrong someone will set us both straight. :D
-p means "loop through all of the lines in the specified file." (Like
the -pi.bak we see in all those oneliners.) You're specifying "*", which to
Win32 is the wildcard matching all filenames in a directory. So, Perl
apparently thinks you want it to run through whatever directory you happen
to be in and do somescript.pl to all of them.
Hope this helps,
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
WS010 wrote in message <01bd62d2$1fa47e10$8c7479c1@dvvbeint0ws010>...
>context: perl for win 32 port
>problem: perl -w somescript.pl -l thisarg -p * -u thatarg
>perl seems to expand the '*' command line argument to the current directory
>contents.
>in other words: upon invocation the following expression holds (on my
>systems) :
> @ARGV == ('-l','thisarg','-p','firstfile','secondfile' ...,'-u','thatarg')
>where firstfile and secondfile ... are present in the current directory.
>question: To my knowledge no such feature is documented (Yes, I checked the
>canonical documentation resources before posting this). Any rational
>explanation ?
>Many thanks from: Jos Snellings, Jos.Snellings@1cd4u.com
------------------------------
Date: 8 Apr 1998 14:37:17 GMT
From: "WS010" <WS010@dvvlap.be>
Subject: Re: perl win 32 : asterisk on command line
Message-Id: <01bd62fc$c434d7c0$8c7479c1@dvvbeint0ws010>
Thank you, Mr Lambard.
Your explanation certainly makes sense. It is odd though, that such
assumption would be made, and be coded as an 'undocumented feature'.
Who knows why this feature has been deliberately added to Perl for Win32?
Maybe there is a way
to disable this behavior? (got one: see previous answer).
Jos Snellings <Jos.Snellings@1cd4u.com>
------------------------------
Date: 8 Apr 1998 13:11:43 GMT
From: mick@io.com (Michele Beltrame)
Subject: pidof
Message-Id: <slrn6imtms.e74.mick@caladan.weird.net>
Hallo!
Is there a Perl function which allows to know the pid of a process matching
a certain name? Something like the "pidof" unix command.
Thanks, Mickey.
--
Michele Beltrame
mick@io.com
http://www.italpro.com/mb/
------------------------------
Date: Wed, 08 Apr 1998 15:50:22 +0200
From: "Michael W. Rosa" <xiphias@dds.nl>
Subject: REQ: CGI Banner Exchange
Message-Id: <352B809E.DEDC7961@dds.nl>
This is a multi-part message in MIME format.
--------------1E6607C426B53E461DE62BAA
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<HTML>
<P>Hi,
<P>Can anybody help me on a CGI Banner like Link Exchange?
<BR>I currently have a JavaScript banner on my page but I want one in CGI
so
<BR>it can easely run on other homepages also like LE...
<P>Could somebody mail me one...?
<P>Thanx,
<BR>
<P>XiPHiAS '98/TKD
<BR>xiphias@dds.nl</HTML>
--------------1E6607C426B53E461DE62BAA
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for XiPHiAS '98/TKD
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: XiPHiAS '98/TKD
n: ;XiPHiAS '98/TKD
org: Hakkuh.ORG/TKD
email;internet: xiphias@dds.nl
title: Webmaster
note: http://businessweb.csi.com/www.hakkuh.org
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------1E6607C426B53E461DE62BAA--
------------------------------
Date: Wed, 08 Apr 1998 11:36:34 GMT
From: tim@interactive1.easynet.co.uk (tim pickup)
Subject: running `ls $file` on a nt workstation in a search script problem?
Message-Id: <352b60ce.5413851@news.easynet.co.uk>
I have to implement a standard search script on a nt workstation and
am
using a version of Matts search script. The script runs ok but
returns no
hits. The problem is that no files are gathered to search through.
the relevent bits of code are
....
$basedir = "C:/inetpub/wwwroot/pages/";
@files = ('*.htm','*/*.htm');
....
sub get_files {
chdir($basedir);
foreach $file (@files) {
$ls = `ls $file`;
@ls = split(/\s+/,$ls);
foreach $temp_file (@ls) {
print $temp_file;
#===============this prints out nothing on execution==========
if (-d $file) {
$filename = "$file$temp_file";
if (-T $filename) {
push(@FILES,$filename);
}
}
elsif (-T $temp_file) {
push(@FILES,$temp_file);
}
}
}
}
the key line is $ls = `ls $file`;
What exactly does this line do. I figure it is saying something like
get a
list of all files that are of the type <*/*.htm> for example.
If so then it isn't getting hold of any files.
Have tried several variations on the $basedir but i don't think this
is the
problem.
Have run the script fine on other servers. This leads me to believe
that it
isn't the code at fault, but rather the implementation of this file
gathering technique on the nt workstation.
The perl interpreter is version 5.004.. downloaded from perl.com
Thanks
tim
------------------------------
Date: 8 Apr 1998 14:29:43 GMT
From: root@compstat.wharton.upenn.edu (Jack Siler)
Subject: serpinski gasket almost-1-liner needs polishing
Message-Id: <6gg1kn$urn$1@netnews.upenn.edu>
Inspired by J. Reed's article in TPJ on L-Systems I used substitution
to produce a Serpinski gasket fractal. I was unhappy about putting the
substitutions inside functions but since substitutions return
number-of-subs instead of the string I couldn't figure out how to put
the subs in the print line (like I did for the appending) nor how to
make the functions less clunky. Comments appreciated.
$x="*";$y=" ";$s=$x;$reps=16;
sub D {($t) = @_; $t =~ s/./$&$&/g;$t}
sub C {($t) = @_; $t =~ s/../(($& eq $y.$y)||($& eq $x.$x))?$y:$x/ge;$t}
for ($i=1;$i<$reps;$i++) {
print ' ' x ($reps-$i),(join ' ',split //,$s=&C($y.&D($s).$y)),"\n"
}
* *
* *
* * * *
* *
* * * *
* * * *
* * * * * * * *
* *
* * * *
* * * *
* * * * * * * *
* * * *
* * * * * * * *
* * * * * * * *
* * * * * * * * * * * * * * * *
NB: The gasket is much prettier if done large in color with GD. The
gasket is, among other things, Pascal's triangle mod 2. It's also a
reproduce-or -die-depending-on-your-neighbor process; I first saw it
that way years ago in a physics journal article by Mathematica's
S. Wolfram. He was a hot-shot young physicist and Mathematica a gleam
in his eye.
Jack Siler
------------------------------
Date: 8 Apr 1998 14:26:24 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Tail-like functionality
Message-Id: <6gg1eg$201$1@info.uah.edu>
[Posted and mailed]
In article <Er2HLy.Hw4@echelon.nl>,
kees@echelon.nl (Kees Hendrikse) writes:
: I'm looking for a way to add unix-like tail functionality to a perl
: script. As I'm only interested in the last 10-20 lines of output, I
: now run 'perlscript largfile | tail', which implies perl is doing a
: lot of work for nothing. 'tail largfile | perlscript' is not the way
: to go, because all the data in largefile is used in the caclualtions.
: In need the tail 'halway' inside the script, without buffering lots
: of data. Any suggestions?
[9:22] mork% cd /usr/local/lib/perl5/pod
[9:23] mork% tcgrep -wi tail perlfaq*
perlfaq4.pod: my @tail = @{ $_[1] };
perlfaq4.pod: print "@tail\n";
perlfaq4.pod: # for all elements in @head, move one from @head to @tail
perlfaq4.pod: # and call permut() on the new @head and @tail
perlfaq4.pod: @newtail = @tail;
perlfaq5.pod:=head2 How do I do a C<tail -f> in perl?
Read (at least) section five of the fine Perl FAQ.
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 8 Apr 1998 14:30:52 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Tail-like functionality
Message-Id: <Er3MzG.HE@world.std.com>
kees@echelon.nl (Kees Hendrikse) writes:
>I'm looking for a way to add unix-like tail functionality to a perl
>script. As I'm only interested in the last 10-20 lines of output,
How about instead of print()ing, saying:
push @output, $line;
shift @output if @output > 20;
(maybe "shift @output while @output > 20" as defensive programming)
and at the end, simply
print @output;
--
Andrew Langmead
------------------------------
Date: Wed, 08 Apr 1998 13:59:29 +0200
From: Philippe de Rochambeau <pr1@club-internet.fr>
Subject: Timeout script
Message-Id: <352B66A1.753EA8D2@club-internet.fr>
I am currently looking for a way to log off somebody from a restricted-access
server after a few minutes. For instance, once the user has typed in his user
id and password, a Perl script should let him browse through the website's
pages for a total of 3 minutes, after which the script should disconnect him.
Any suggestions on how to write such a timeout script?
I guess I should spawn some sort of process which would automatically
disconnect the user after a short while. However, I am not sure how to write a
Perl script that spawns such a process.
Philippe de Rochambeau
P.S. I plan to run this script with MacPerl first, then on a Unix machine.
------------------------------
Date: Wed, 08 Apr 1998 13:55:07 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Re: Trouble running html2ps perl script on NT4.0
Message-Id: <352b81ab.2028764@news.inreach.com>
Get posix.pm from the same place you got your perl distribution.
HTH
j----- k-----
On Mon, 30 Mar 1998 22:13:43 +0100, Georg Lenz <lenz@innosoft.de>
wrote:
()Hei everybody out there,
()
()I want to run a perl script to convert html to ps.(From Jan
Kdrrman)
()I installed perl (5.004_04) on NT4.0. The sample for the script is
not
()running and stops with the message can't find "POSIX.pm".
()It seems so that this is not standard extension to perl.
()So, how do I create that extension?????
()I don't know Perl at all!! All I want is to run that script and get
an
()output.
()Anybody out there who cloud give me a hand, how to smart up the perl
()version (5.004_04) I got from www.perl.com.
()
()Thanks a lot
()Georg
()
()
()
I read this group. Sometimes my ISP doesn't. Please e-mail too.
Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!
------------------------------
Date: 8 Apr 1998 10:33:24 GMT
From: "Dave Roth" <rothd@xrxoxtxhx.xnxextX>
Subject: Re: Win32 ODBC error - object not found
Message-Id: <01bd62da$34e4e2d0$0101a8c0@main2>
Jonathan Stowe <Gellyfish@btinternet.com> wrote in article
<35285623.5676773@news.btinternet.com>...
> On Sun, 05 Apr 1998 17:26:14 -0600, santon@nu.com wrote:
>
> <snip>
> >
> >Can't locate object method "new" via package
"Win32::ODBC" at test.pl line 4.
> >
> >I've setup the DSN etc. I temporarily renamed ODBC.PM
to ensure it is the
> >module being used, and it is. What am I missing?
> >
>
> I dont know the much about the module itself but the
error would seem
> to indicate that Win32::ODBC is intended to sub-class
from some other
> module (i.e. "new" is inherited from anotherr module) and
that module
> is missing.
>
> Take a look at the ODBC.pm file. There will be a line
something like:
>
> @ISA = qw( <some modules>);
>
> These are the modules that ODBC can inherit methods from.
Check to
> see if all the corresponding files are present somewhere
in @INC. If
> any of them are missing you will need to get and install
them.
Win32::ODBC does not inherit from other modules. Your new
syntax should look like:
$db = new Win32::ODBC("Your DSN Goes Here") || die "Can not
connect: " . Win32::ODBC::Error();
dave
--
============================================================
====
Dave Roth ...glittering
prizes and
Roth Consulting endless compromises,
shatter
rxoxtxdxxrxoxtxhx.xnXeXt the illusion of
integrity
My email address is disguised to fool automailers. Remove
the
X's to send me email.
************************************************************
****
Use of this message or email address for commercial
purposes
(including "junk" mailings) is strictly prohibited and
protected
under current international copyright laws and United
States
Code, Title 47, Chapter 5, Subchapter II.
------------------------------
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 2274
**************************************