[11570] in Perl-Users-Digest
Perl-Users Digest, Issue: 5170 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 18 19:07:29 1999
Date: Thu, 18 Mar 99 16:00:24 -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 Thu, 18 Mar 1999 Volume: 8 Number: 5170
Today's topics:
Re: /([_A-Za-z]\w*)(?!\s*=)/ <jacklam@math.uio.no>
Convert to DBF format mtcorey@my-dejanews.com
cpan <bkrichar@unity.ncsu.edu>
DBF Format mtcorey@my-dejanews.com
Re: deleting an array of words from a string (Larry Rosler)
Re: DUMB Newbie question <cassell@mail.cor.epa.gov>
Re: Editing array content (Larry Rosler)
Re: find command problem (Ken Pizzini)
Re: flock() on Alpha/VMS <sugalskd@netserve.ous.edu>
getline equivalent in Perl? <rp2885@email.sps.mot.com>
Re: getline equivalent in Perl? <rp2885@email.sps.mot.com>
How to let users of website know there are others prese <news@ntt.nl>
Re: image sizes <flanker@sonnet.ru>
Re: Macperl NEWBIE filename question <helpdesk@leedsnet.com>
Re: Macperl NEWBIE filename question (Tad McClellan)
Perl - "Command not found" <terrym@bridgewatersys.com>
Re: Perl - "Command not found" <jglascoe@giss.nasa.gov>
Re: Perl - "Command not found" <elaine@cts.wustl.edu>
Q: Perl executer, where to download? <caesar@cuci.nl>
Re: Q: Perl executer, where to download? (brian d foy)
Re: Sendmail <upsetter@ziplink.net>
Re: Sendmail (brian d foy)
Re: sigals tbhanson@startribune.com
Speeding up Multi Word Searches (Boolean OR) regnery@ix.netcom.com
Re: The truth about the Pentium III chip and ID --- **b tng@sosweb.net.nospam
Re: Variables in QUERY_STRING <jeromeo@atrieva.com>
Re: Variables in QUERY_STRING <upsetter@ziplink.net>
Re: Variables in QUERY_STRING jt@enterprise.net
Re: Why can't i create a file with >>$file? (Harold Bamford)
Windows NT Path Resolution <david@123uk.net>
Re: writing thumnails <borud@lucifer.fast.no>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Mar 1999 22:34:18 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: /([_A-Za-z]\w*)(?!\s*=)/
Message-Id: <36F1715A.9FF81121@math.uio.no>
Alex Farber wrote:
>
> I would like to extract all function names from a MATLAB file:
>
> ++$func{$1} while (/([_A-Za-z]\w*)(?!\s*=)/g); # words not followed by =
>
> But it does not work - "not followed by =" is ignored. However
>
> ++$vars{$1} while (/([_A-Za-z]\w*)(\s*=)/g);
>
> works... What's the reason?
1) Names of Matlab identifiers can not start with an underscore, so "_"
should not be included in the character class.
2) Your code will not find all function names
print foo bar % "print" is a function
3) Your code will find things that aren't function names
foo = [ 3 4 ]
foo(3) % "foo" is not a function
Peter
--
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam
------------------------------
Date: Thu, 18 Mar 1999 22:12:48 GMT
From: mtcorey@my-dejanews.com
Subject: Convert to DBF format
Message-Id: <7crtok$ctp$1@nnrp1.dejanews.com>
I was told that it was possible to use the DBD::xBase module to write data
out in DBF format. I have never used the DBD::xBase module, so I am totally
lost. What I need to do is extract the data from a Sybase SQL Server
database (this I can do using sybperl), but I have no idea how to write the
extracted data out in DBF format using DBD::xBase. Has anyone ever performed
this? If so any help would be greatly appreciated. Thanks.
I have access to this newsgroup through deja-news, so if replies could be sent
to mcorey@edoc.com that would be appreciated. Thanks again.
Michael
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 18 Mar 1999 21:18:13 GMT
From: Brian Keith Richards <bkrichar@unity.ncsu.edu>
Subject: cpan
Message-Id: <7crqil$bc9$1@uni00nw.unity.ncsu.edu>
is there a way i can update all my CPAN modules automatically?
thanks
--
-Brian
-- \:/_
__________/| North Carolina Music Central ./\O,
(_|__|_____\|________ SkAnK lOnG aNd PrOsPeR /\/
|_|_____________) bkrichar@eos.ncsu.edu :_
http://www4.ncsu.edu/~bkrichar/ska \ \/
/_
------------------------------
Date: Thu, 18 Mar 1999 22:20:38 GMT
From: mtcorey@my-dejanews.com
Subject: DBF Format
Message-Id: <7cru78$dbu$1@nnrp1.dejanews.com>
I was told that it was possible to use the DBD::xBase module to write data
out in DBF format. I have never used the DBD::xBase module, so I am totally
lost. What I need to do is extract the data from a Sybase SQL Server
database (this I can do using sybperl), but I have no idea how to write the
extracted data out in DBF format using DBD::xBase. Has anyone ever performed
this? If so any help would be greatly appreciated. Thanks.
I have access to this newsgroup through deja-news, so if replies could be sent
to mcorey@edoc.com that would be appreciated. Thanks again.
Michael
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 14 Mar 1999 18:50:11 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: deleting an array of words from a string
Message-Id: <MPG.1156153a2140b98d989748@nntp.hpl.hp.com>
In article <1donw4o.9f18vhxl964gN@bay1-410.quincy.ziplink.net> on Sun,
14 Mar 1999 15:29:44 -0500, Ronald J Kimball <rjk@linguist.dartmouth.edu
>says...
> Jason Q. <pigs_can_fly@mindless.com> wrote:
> > foreach (@ignore)
> > {
> > $string =~ s/^$_ //g;
> > $string =~ s/ $_ //g;
> > $string =~ s/ $_$//g;
> > }
...
> Don't remove the spaces before *and* after the word...
>
> $string =~ s/\b$_\b ?//g;
This answer is correct, as far as it goes. But it doesn't go far enough
to address the fact that it is 'extremely inefficient' (quoting from
perlfaq6: "How do I efficiently match many regular expressions at
once?"). Embed the loop above -- even with only one regex -- in another
loop over an array of strings, and count the number of regex
compilations: O(n * m) instead of O(1).
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 18 Mar 1999 15:54:01 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: DUMB Newbie question
Message-Id: <36F19219.C1399E79@mail.cor.epa.gov>
Jerome O'Neil wrote:
>
> David L. Cassell wrote:
> >
> > Jerome O'Neil wrote:
> >
> > > It is self evident that one cannot debug code that one cannot see.
> >
> > Perhaps they have heard of the Telnet::ESP module?
>
> I much prefer Debug::Psychic. You can chanel it from a CSPAN site near
^^^^^^
"It's a module!" "No, it's a perfume!" "It's a module!" "It's a
perfume!" "Wait, new Debug::Psychic is a *perfume* AND a *module*!"
> you.
Don't they already know I want it?
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sun, 14 Mar 1999 18:33:12 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Editing array content
Message-Id: <MPG.1156114227edb71d989747@nntp.hpl.hp.com>
In article <JnYG2.726$AI1.23@weber.videotron.net> on Sun, 14 Mar 1999
19:20:58 -0500, u4ia <u4ia@nospam.videotron.ca.nospam >says...
...
> So how I can remove the last line? The array have a static lenght, the empty
> line is the line 34.
perldoc -f pop
> I tried $chomp($ra[34]) since the last line is a carriage return but it
> didn't work and I can't see any other operators to remove array content.
> *sigh* :o) (did I already said that I'm coding Perl for two days only? :P ).
perldoc -f splice
'splice' can be used to delete an arbitrary hunk of an array. 'pop' is
a special case to delete the last element.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 18 Mar 1999 21:08:02 GMT
From: ken@halcyon.com (Ken Pizzini)
Subject: Re: find command problem
Message-Id: <slrn7f2qcu.ouh.ken@pulsar.halcyon.com>
On 18 Mar 1999 19:50:28 GMT,
Ilya <ilya_NO_JUNK_PLS_@napavlly.rose.hp.com> wrote:
>In comp.unix.admin Craig Eales <ealesc@deshaw.com> wrote:
>> find $path* -name qhelp -exec echo echo \\| {} 2\\>/dev/null \\; | sh
>It worked. Thanks. What is the second echo for and why does piping it to sh
>gets the result?
Each time find matches a qhelp file, it runs the command line:
echo echo \| {} 2>/dev/null
which winds up emitting on stdout, for each matching {path_to_qname}:
echo | {path_to_qname} 2>/dev/null
Now the whole of this output is piped to sh for interpretation.
That is, sh evaluates each line (one at a time), just as if you
had run those commands from the command line or in a shell script
file; the file here is just the piped stdin.
--Ken Pizzini
------------------------------
Date: 18 Mar 1999 05:47:49 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: flock() on Alpha/VMS
Message-Id: <7cq425$ig0$1@news.NERO.NET>
In comp.lang.perl.misc Techno <techno@umbriel.demon.co.uk> wrote:
: M.J.T. Guy wrote in message <7coqac$610$1@pegasus.csx.cam.ac.uk>...
:>Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
:>>
:>>The VMS port of perl doesn't support flock or fcntl at the moment.
:>>However... VMS has mandatory file locking--if you open a file for write,
:>>nobody else will be able to. (The open call will throw an error) You'll
:>>need a bit more checking on open to detect a locked file error, but you
:>>can skip flock entirely on VMS.
:>
:>Wouldn't it be politer, and assist portability, if flock() was implemented
:>as a no-op on this platform, since that is what it effectively is with
:>mandatory locking?
:>
:>
:>Mike Guy
: Mike,
: I couldn't agree more, especially as the error returned by flock() in $! is
: 'no more processes'. This set me and my VMS admin guy off on a red-herring
: hunt as we couldn't see any problems with the way the account was set up !!
Really? Odd. flock's *supposed* to die, not set $!.
Dan
------------------------------
Date: Thu, 18 Mar 1999 14:46:16 -0700
From: Aaron Ginn <rp2885@email.sps.mot.com>
Subject: getline equivalent in Perl?
Message-Id: <36F17428.2B5F9EB8@email.sps.mot.com>
<HTML>
Can anyone tell me if there is an equivalent command in Perl for the getline
command in awk? Specifically, when using the angled bracket operator
in a while loop to read through a file, if I find a pattern on a line,
I want to set $_ to the value of the next line in the file.
Currently, I do this by setting a flag, and checking that flag every
time through the loop. This gets messy if I have many of these
flags in the same while loop, so I'd like to grab the next line as soon
as I find the pattern I'm looking for. Here's an example:
<P>while (<RC1>) {
<BR> if ($get_net_on_next_line) {
<BR> @fields = split;
<BR> $rc1_net = $fields[0];
<BR> $get_net_on_next_line = 0;
<BR> $get_cap_on_next_line = 1;
<BR> } elsif ($get_cap_on_next_line) {
<BR> if (/^C /) {
<BR> @fields = split;
<BR> $rc1_cap = $fields[1];
<BR> $rc1_data{$rc1_net}
= $rc1_cap;
<BR> $get_cap_on_next_line
= 0;
<BR> }
<BR> } elsif (/^N /) {
<BR> @fields = split;
<BR> if (scalar(@fields) == 1) {
<BR> $get_net_on_next_line
= 1;
<BR> } else {
<BR> $rc1_net = $fields[1];
<BR> $get_cap_on_next_line
= 1;
<BR> } #ends else
<P> } # ends elsif (/^N /) {
<P>} # ends while
<P>In this code, when I find a line that matches /^N/, I want to grab
the very next line (containing /^C/) and create a hash with the two values.
When I find that pattern, I set a flag telling the code to grab
the next line, break it up, and use the values to build the hash table.
To accomplish this, I have to set and reset two flags, $get_net_on_next_line
and $get_cap_on_next_line, to do what I want to do. It works,
but it's ugly, and I always have to remind myself exactly what I was
doing when I wrote it.
<BR>
<P>Any suggestions?
<P>Thanks,
<BR>Aaron
<PRE>--
-------------------------------------------------------------
| Aaron J. Ginn Motorola SPS |
| Phone: (602) 814-4463 SemiCustom Solutions |
| Fax: (602) 814-4058 1300 N. Alma School Rd. |
| <A HREF="mailto:rp2885@email.sps.mot.com">mailto:rp2885@email.sps.mot.com</A> Chandler, AZ 85226 |
-------------------------------------------------------------</PRE>
</HTML>
------------------------------
Date: Thu, 18 Mar 1999 15:58:52 -0700
From: Aaron Ginn <rp2885@email.sps.mot.com>
Subject: Re: getline equivalent in Perl?
Message-Id: <36F1852C.3D522C00@email.sps.mot.com>
<HTML>
Never mind, I answered my own question. I forgot all about a2p!
If anyone is interested, I ran a2p on the following awk file:
<P>#!/usr/bin/nawk
<BR>getline;
<BR>
<P>and got the following output:
<BR><BR>
<BR>
<BR>#!/home/osiris3/freeSW/bin/perl
<BR>eval 'exec /home/osiris3/freeSW/bin/perl -S $0 ${1+"$@"}'
<BR> if $running_under_some_shell;
<BR>
# this emulates #! processing on NIH machines.
<BR>
# (remove #! line above if indigestible)
<BR>
<BR>eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ &&
shift;
<BR>
# process any FOO=bar switches
<BR>
<BR>#!/usr/bin/nawk
<BR>while (<>) {
<BR> print $_ if $_ = &Getline0();;
<BR>}
<BR>
<BR>sub Getline0 {
<BR> if ($getline_ok = (($_ = <>) ne '')) {
<BR> ;
<BR> }
<BR> $_;
<BR>}
<BR>
<P>Thanks,
<BR>Aaron
<BR>
<P>Aaron Ginn wrote:
<BLOCKQUOTE TYPE=CITE> Can anyone tell me if there is an equivalent
command in Perl for the getline command in awk? Specifically, when
using the angled bracket operator in a while loop to read through a file,
if I find a pattern on a line, I want to set $_ to the value of the next
line in the file. Currently, I do this by setting a flag, and checking
that flag every time through the loop. This gets messy if I have
many of these flags in the same while loop, so I'd like to grab the next
line as soon as I find the pattern I'm looking for. Here's an example:
<P>while (<RC1>) {
<BR> if ($get_net_on_next_line) {
<BR> @fields = split;
<BR> $rc1_net = $fields[0];
<BR> $get_net_on_next_line = 0;
<BR> $get_cap_on_next_line = 1;
<BR> } elsif ($get_cap_on_next_line) {
<BR> if (/^C /) {
<BR> @fields = split;
<BR> $rc1_cap = $fields[1];
<BR> $rc1_data{$rc1_net}
= $rc1_cap;
<BR> $get_cap_on_next_line
= 0;
<BR> }
<BR> } elsif (/^N /) {
<BR> @fields = split;
<BR> if (scalar(@fields) == 1) {
<BR> $get_net_on_next_line
= 1;
<BR> } else {
<BR> $rc1_net = $fields[1];
<BR> $get_cap_on_next_line
= 1;
<BR> } #ends else
<P> } # ends elsif (/^N /) {
<P>} # ends while
<P>In this code, when I find a line that matches /^N/, I want to grab the
very next line (containing /^C/) and create a hash with the two values.
When I find that pattern, I set a flag telling the code to grab the next
line, break it up, and use the values to build the hash table. To
accomplish this, I have to set and reset two flags, $get_net_on_next_line
and $get_cap_on_next_line, to do what I want to do. It works, but
it's ugly, and I always have to remind myself exactly what I was doing
when I wrote it.
<BR>
<P>Any suggestions?
<P>Thanks,
<BR>Aaron
<PRE>--
-------------------------------------------------------------
| Aaron J. Ginn Motorola SPS |
| Phone: (602) 814-4463 SemiCustom Solutions |
| Fax: (602) 814-4058 1300 N. Alma School Rd. |
| <A HREF="mailto:rp2885@email.sps.mot.com">mailto:rp2885@email.sps.mot.com</A> Chandler, AZ 85226 |
-------------------------------------------------------------</PRE>
</BLOCKQUOTE>
</HTML>
------------------------------
Date: Fri, 19 Mar 1999 00:28:56 +0100
From: "Carlo" <news@ntt.nl>
Subject: How to let users of website know there are others present
Message-Id: <36f18b11$0$26630@newton>
Hello,
im looking for a way to let visitors of my site know if there are others at
the time.
This is what i want at the bottom of my page, in a frame,
there are 3 others here at this moment
I made 2 scripts on.pl and off.pl
on.pl loads whenever someone enters the site and upps a counter
off.pl loads on an unload event when someone closes the browser or goes to
another page and lowers the counter.
It works but is very buggy, when someone reloads the page the unload event
takes place and there goes my counter number. There must be an easier way
that is less buggy.
I've been looking for a standard perl function but i cant find it.
Carlo
------------------------------
Date: Fri, 19 Mar 1999 00:41:10 +0300
From: "Michael Yevdokimov" <flanker@sonnet.ru>
Subject: Re: image sizes
Message-Id: <7crrq5$1u7$1@bison.rosnet.ru>
--
Best wishes,
Michael Yevdokimov
Email: flanker@sonnet.ru
ICQ: 30874618
-------------------------------------------------
>> Developers Support Site <<
Web: http://developer.tsx.org
http://www.basicnet.sonnet.ru
-------------------------------------------------
Richard H <"rhrh@hotmail.com,or,rhardicr"@ford.com> ohxer b qnnayemhh
<7cob9r$evh1@eccws1.dearborn.ford.com> ...
>>
>> you probably want the Image::Size
>>
>> use Image::Size;
>> ($x, $y) = imgsize("something.gif");
>>
>cunning really when you think about it !! :-)
>Richard H
begin 666 getsize.pl
M)&)A<V4](F1S<S Q+F=I9B([#0H-"B@D>"PD>2D])F=I9G-I>F4H(B1B87-E
M(BD[#0IP<FEN=" B>#H@)'@L('DZ("1Y(CL-"@T*<W5B(&=I9G-I>F5[#0H@
M(" @(" @(&UY("1F:6QE(#T@<VAI9G0[#0H@(" @(" @(&]P96X@*$@L("(\
M)&9I;&4B*3L-"B @(" @(" @*"1X+"1Y*3T@/$@^(#U^("]>1TE&+BXN*"XN
M*2@N+BDO.PT*(" @(" @("!C;&]S92A(*3L-"B @(" @(" @<F5T=7)N("AU
G;G!A8VLH(G9V(BPD>"DL=6YP86-K*")V=B(L)'DI*3L-"GT-"@T*
`
end
------------------------------
Date: Thu, 18 Mar 1999 22:22:00 -0000
From: "LeedsNet" <helpdesk@leedsnet.com>
Subject: Re: Macperl NEWBIE filename question
Message-Id: <36f17c76.0@glitch.nildram.co.uk>
>I am writing a quick script to rename long filenames so that they are
>suitable for DOS systems.
>I don't know how to change the name of the file after having worked on it!
>I'd be grateful for any advice
>Rory
>
>#!perl-w
>for ($i = 0; $i <= $#ARGV; $i++) { #get each file dropped on droplet
# ...
}
Try something like
-----
:
#!perl -w
use strict;
foreach( @ARGV ) {
# do something with $_, such as:
# print ;
};
Now would also be a good time to read about the the np and i flags.
Basically you need the MacPerl book, run don't walk to
<http://yggdrasil.com/~rdm/MP/i2.html> or <http://www.ptf.com/>
Also, you may find an Appleevent that you can send to the finder
to do what you want.
Ben.
------------------------------
Date: Thu, 18 Mar 1999 12:02:36 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Macperl NEWBIE filename question
Message-Id: <cjbrc7.bkb.ln@magna.metronet.com>
Rory Campbell Lange ('x'campbell-lange@easynet.co.uk) wrote:
: I am writing a quick script to rename long filenames so that they are
^^^^^^
^^^^^^ (hint hint)
: suitable for DOS systems.
: I don't know how to change the name of the file after having worked on it!
rename $oldname, $newname or die "could not rename $!";
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 18 Mar 1999 17:13:45 -0500
From: terrym <terrym@bridgewatersys.com>
Subject: Perl - "Command not found"
Message-Id: <36F17A99.D2497394@bridgewatersys.com>
This is a multi-part message in MIME format.
--------------EFA0B66B36C129EB186C9ADD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
The Problem
A file containing perl cmds will not execute
The Environment
OS - RedHat Linux 5.0
Perl - 5.00401
Shell - bash
The File contains
#!/usr/bin/perl
print "hello";
The error messages are:
"Command not found"
"print: Command not found"
Perl does exist in /usr/bin/perl and it does work.
Thanks,
Terry
--------------EFA0B66B36C129EB186C9ADD
Content-Type: text/x-vcard; charset=us-ascii;
name="terrym.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for terrym
Content-Disposition: attachment;
filename="terrym.vcf"
begin:vcard
n:Mac Lean;Terry
x-mozilla-html:FALSE
org:Bridgewater Systems Corporation
version:2.1
email;internet:terrym@bridgewatersys.com
x-mozilla-cpt:;0
fn:Terry Mac Lean
end:vcard
--------------EFA0B66B36C129EB186C9ADD--
------------------------------
Date: Thu, 18 Mar 1999 17:23:52 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: terrym <terrym@bridgewatersys.com>
Subject: Re: Perl - "Command not found"
Message-Id: <36F17CF8.EBCD22D5@giss.nasa.gov>
[posted and mailed]
terrym wrote:
>
> The error messages are:
>
> "Command not found"
> "print: Command not found"
did you "chmod +x" the script?
Jay Glascoe
--
MSDOS was created to keep idiots away from Unix
--anon.
------------------------------
Date: Thu, 18 Mar 1999 18:55:31 -0500
From: Elaine Ashton <elaine@cts.wustl.edu>
Subject: Re: Perl - "Command not found"
Message-Id: <36F19273.A7FDFF5A@cts.wustl.edu>
terrym wrote:
> The Environment
> OS - RedHat Linux 5.0
> Perl - 5.00401
> Shell - bash
> "Command not found"
> "print: Command not found"
>
> Perl does exist in /usr/bin/perl and it does work.
1. check the permissions on /usr/bin/perl and your script....are they
indeed executeable? by the user attempting to run the script?
2. Is /usr/bin/perl a symbolic link to somewhere else and, again, are
the permissions correct?
3. Have you checked your shell environment and path?
4. Have you looked at redhats errata and bug listings for 5.0 to see if
this is a known problem with the perl package?
5. Have you considered upgrading to 5.2?
e.
------------------------------
Date: Thu, 18 Mar 1999 22:12:49 +0100
From: "prive " <caesar@cuci.nl>
Subject: Q: Perl executer, where to download?
Message-Id: <7crqj0$25r$1@heracles.fw.cuci.nl>
Hi,
My provider doesn't provide Perl executer. That way my scripts can't be
interpret and are useless. Can I drop the executer in my own user directory?
And where can I get it?
------------------------------
Date: Thu, 18 Mar 1999 16:35:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Q: Perl executer, where to download?
Message-Id: <comdog-ya02408000R1803991635530001@news.panix.com>
In article <7crqj0$25r$1@heracles.fw.cuci.nl>, "prive " <caesar@cuci.nl> posted:
> My provider doesn't provide Perl executer. That way my scripts can't be
> interpret and are useless. Can I drop the executer in my own user directory?
> And where can I get it?
see www.perl.com.
however, it is probably easier to just change providers.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 18 Mar 1999 21:04:39 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Sendmail
Message-Id: <HTdI2.390$no1.56175@news.shore.net>
brian d foy <comdog@computerdog.com> wrote:
: Yes. but that has nothing to do with Perl. if you don't want to
: think about how sendmail works, you might want to use a Perl module
: instead.
And then all you have to do is reproduce sendmail's functionality in your
script? :)
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Thu, 18 Mar 1999 16:16:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Sendmail
Message-Id: <comdog-ya02408000R1803991616300001@news.panix.com>
In article <HTdI2.390$no1.56175@news.shore.net>, Scratchie <upsetter@ziplink.net> posted:
> brian d foy <comdog@computerdog.com> wrote:
>
> : Yes. but that has nothing to do with Perl. if you don't want to
> : think about how sendmail works, you might want to use a Perl module
> : instead.
>
> And then all you have to do is reproduce sendmail's functionality in your
> script? :)
unless you use a module that is just a wrapper around sendmail.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 18 Mar 1999 21:18:25 GMT
From: tbhanson@startribune.com
Subject: Re: sigals
Message-Id: <7crqin$9se$1@nnrp1.dejanews.com>
> This should be $SIG{CHLD} .. but from perlipc, using
>
> $SIG{CHLD} = 'sub_name';
>
> could fail in some modules. The best strategy is to use:
>
> $SIG{CHLD} = \&sub_name;
Good to know, thanks. On a related subject, does anyone know whether I can
find out if a subprocess I started using open(X, "cmd 2>&1 |") has a) ended
with a non-0 result (i.e. asserted an error of some kind); or b) written
anything to stderr ?
(e.g.
open(TMP, "rdist -f ./x.distfile 2>&1 |");
my @rdistResults = <TMP>;
close TMP;
foreach $line (@rdistResults) {
chop $line;
writeLog("($line)");
}
).
I'd be grateful!
--Tim Hanson
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 18 Mar 1999 21:54:04 GMT
From: regnery@ix.netcom.com
Subject: Speeding up Multi Word Searches (Boolean OR)
Message-Id: <7crsll$bqa$1@nnrp1.dejanews.com>
Hello,
I currently have a PERL Script that allows searching of a flat text file.
Users can select either a boolean AND or a boolean OR search. Then the
script reads each line in the flat file, parses it, and searches for the
terms in the relevant field.
Many people do boolean OR searches. The variable pulled from the database is
called $coname, and the terms that the user typed in are in @terms. Right
now, when there is an OR search, I have to look for every term in @terms as
follows:
foreach $term (@terms) {
if ($coname =~ /$term/i) {
$termhits[$termcounter]++;
$key = 'yes';
$orhits++;
}
$termcounter++;
}
(I start by having $key being "no", and if a term is found, this is set to
"yes"). The other variables up in the code above are just various tracking
functions that I have in place. Orhits tracks how many of the terms in the
search were in this particular instance of coname [I track this so that I can
put the result in bold when I print it if this is 2 or more], and the termhits
tracks the total hits for that term across all 125,000 entries.
This works, but it's fairly slow (there are about 125,000 items in the flat
file (which consists of names of companies), and the search often gets many
uses per minute).
Is there a more efficient way of doing multiple word boolean OR searches
without having to go to an index? For AND searches, if there's a multiple
word search, I first check the first term, and if it fails, then I don't
check the rest of the terms (since, by definition, if the first term fails
and the search is an AND, then obviously it doesn't matter if any of the
other terms match).
I realize that in an OR search, you have to check every term (otherwise, it
just isn't an OR search). However, is the FOREACH loop, coupled with the IF,
the most efficient way of doing this? Or is there some better way of doing
this?
Since this search routine looks through company names, many people type in
long names of companies and do an OR search, and that's why I am wondering if
there is a more efficient method of searching.
Thanks in advance for your help. You can post here or send me email, to
regnery@ix.netcom.com. The search feature, if you are curious, is located at
http://www.corporateinformation.com.
-- George M. Regnery
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 18 Mar 1999 22:19:56 GMT
From: tng@sosweb.net.nospam
Subject: Re: The truth about the Pentium III chip and ID --- **boycott info**
Message-Id: <36f17982.22019292@news.sosweb.net>
On Wed, 17 Mar 1999 10:20:04 -0700, "Michael Barnes"
<barnesm@cain-travel.com> wrote:
true. but. MAC addresses on your modem go no further than your isp.
in fact, your isp doesn't even use your modems mac address because you
are assigned an ip addres that already has the mac address of the
modem you connected to so yours never goes out into the net.
your network also has a mac address. this address is used only by
your local network. I machine on a different network send you info,
they only know the ip address, this is send to the router the router
only know the mac address and ip address in your local network. If it
cannot find the destination, it forwards it the the next router which
again only know the mac address and ip address if its local network.
it does on the otherhand know which router to send it to based on ip
routing tables. this process is repeated until it finds the router
that knows the destination ip address and sends it to the isp's router
which then looks up the mac address and places the ip packet on th
ethernet with the destination ip and mac address only knowing the
source ip not mac. mac addresses are NOT forwareded accross even
subnets.
and just to show off, ISP equipment like an ascend or 3com total
control that has 48 modems, all 48 modems have the SAME mac address.
the modem server knows which modem to send it out on based on ip
address.
>Every MODEM has a MAC address also...so your friends pc is nicless, but not
>macless
>As far as I know you cannot network anywhere without a mac address since
>IP's map directly to machine addresses at lower levels to identify your
>particular machine on any network. So, if your connected to any network via
>any hardware device (router, switch, modem, nic) those devices must have mac
>addresses.
>
>and modems are easy to replace compared to CPU's also...
>
>
>
>Bill Anderson wrote in message <36EEB3DB.779FD60D@boi.hp.com>...
>>Tim Roberts wrote:
>>>
>>> John Lehmann <johnl@axis.com.au> wrote:
>>>
>>> >Kano wrote:
>>> >>
>>> >> Oh come on. Many other standard devices (ethernet cards, for example)
>>> >> have their
>>> >> own unique serial numbers that software can use at will. Get over it.
>>> >>
>>> >
>>> >Yes - but ethernet mac cards are only broadcast over the lan, not over
>>> >the net (except by Office98, of course).
>>>
>>> The POINT here is that it is exactly as easy to embed my unique MAC
>address
>>> in an Internet transaction as it is to embed my unique Pentium-III CPU ID
>>> in an Internet transaction. Any software which will go to the trouble to
>>> fetch the unique CPU identifier and send it over the network to identify
>me
>>> could just as easily be written TODAY to use a MAC address for exactly
>the
>>> same purpose. The CPU identifier is not significantly different in
>concept
>>> from the MAC address, and yet there has not been a hue and cry to boycott
>>> NIC manufacturers.
>>
>>Ho wmany home users ar LAN connected to the internet?
>>oh, yeah, that's right, they dial up with a modem; no getting a MAC
>>address from a machine that does not have one.
>>
>>>
>>> >And what do you mean get over it??? This kind of personal information
>>> >is valuable. Business are willing to pay for it. This kind of
>>> >behavior IS DOWNRIGHT THEFT!!!
>>>
>>> But whatever they could do with a CPU ID, they are probably already doing
>>> with a MAC address. It is just as good as a unique identifier. "Get
>over
>>> it" is exactly the right attitude.
>>
>>Can you explain how they would be getting a MAC address from my friends'
>>NIC-less pc?
>>
>>A MAC address is not as good, in any event. NICs get changed mor often
>>than cpus (in most cases). IIRC MAC addresses can be changed, and there
>>have been cases of MAC addresses beinf reused?
>
>
------------------------------
Date: Thu, 18 Mar 1999 13:21:29 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Variables in QUERY_STRING
Message-Id: <36F16E59.A990B7B3@atrieva.com>
brian d foy wrote:
> they're also pedantic to the point that they don't
> know what "PERL" is, although they will talk to you about Perl or perl.
While excessive pedantia is a fine a noble goal, I haven't reached this
point, yet.
;->
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Thu, 18 Mar 1999 22:26:54 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Variables in QUERY_STRING
Message-Id: <O4fI2.397$no1.57801@news.shore.net>
jt@enterprise.net wrote:
: Oh, for goodness sakes! Are you two so new to this list that you
: can't realise the PERL implications of the simplest query?
: If there's anyone with the slightest PERL experience, perhaps you
: would help me - it's a perfectly reasonable request which doesn't
: warrant the indifference of tin gods.
Well, since you asked so nicely:
What you need to do is find the portion of your script where it
IOUdsf*&(###77978*JHf**$*&$&*&&*&**&*&*&*&
NO CARRIER
------------------------------
Date: Thu, 18 Mar 1999 23:41:39 GMT
From: jt@enterprise.net
Subject: Re: Variables in QUERY_STRING
Message-Id: <36f18e86.49963832@news.enterprise.net>
On Thu, 18 Mar 1999 16:16:23 GMT, jt@enterprise.net wrote:
Thank you to the many perl experts who offered constructive and very
helpful advice directly to me via e-mail and didn't want to becomed
embroiled in this petty and pedantic squabble.
I now have my scripts working perfectly. thanks to:
jake, George, Mary and Frances particularly.
jt
------------------------------
Date: 18 Mar 1999 23:27:07 GMT
From: hbamford@w-hbamford.lucent.com (Harold Bamford)
Subject: Re: Why can't i create a file with >>$file?
Message-Id: <7cs24b$j06@ssbunews.ih.lucent.com>
If you are executing this as a CGI script, then remember that the
web server is executing the script as somebody other than you. Such
as 'nobody'. That means (unless you have wide-open permissions on your
directory) that 'nobody' cannot create a file in your directory.
If that isn't the problem, I withdraw my comment...
>I am trying to append to a file and it won't append nor will it create the
>file if it isn't there. Why? I am using:
>
>$file = "file.dat";
>open (FILE, ">>$file") || die "Can't open $file: $!\n";
>print FILE "print all of this junk\n";
>close(FILE);
>
>I can't get it to open or append to file. Why?
--
-- Harold Bamford
mailto:hbamford@lucent.com
(630)713-1351
------------------------------
Date: Thu, 18 Mar 1999 23:23:04 +0000
From: David Twaddell <david@123uk.net>
Subject: Windows NT Path Resolution
Message-Id: <36F18AD8.94FB6D19@123uk.net>
This is a multi-part message in MIME format.
--------------8ACBEB648C4F44DC26D0001D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
If I refer to a file with no path extension, eg. "textfile.db" then my
script finds the file ok. But if I provide a path extension,
"/cgi-bin/links/textfile.db", my script says that it cannot find the
file. The file is definitely in the directory "/cgi-bin/links" and so I
deduce that for some reason Perl and Windows NT is getting the paths
confused somehow.
Please help me if you can. I am off to purchase the best book on Perl I
can find tomorrow, but your expertise may save me some time!
Appreciatively yours,
David Twaddell
--------------8ACBEB648C4F44DC26D0001D
Content-Type: text/x-vcard; charset=us-ascii;
name="david.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for David Twaddell
Content-Disposition: attachment;
filename="david.vcf"
begin:vcard
n:Twaddell;David
tel;cell:+44 (0) 7044 000 567
tel;fax:+44 (0) 7044 000 567
tel;home:+44 (0) 7044 000 567
tel;work:+44 (0) 7044 000 567
x-mozilla-html:FALSE
url:http://www.123uk.net
org:123uk.net
version:2.1
email;internet:david@123uk.net
adr;quoted-printable:;;97a Cambridge Gardens=0D=0ALadbroke Grove=0D=0A;London;;W10 6JE;UK
fn:David Twaddell
end:vcard
--------------8ACBEB648C4F44DC26D0001D--
------------------------------
Date: 19 Mar 1999 00:53:59 +0100
From: Bjorn Borud <borud@lucifer.fast.no>
Subject: Re: writing thumnails
Message-Id: <m2iubygxrc.fsf@lucifer.fast.no>
[horng@earthlink.net]
|
| Are these all possible? I appreciate any advices.
just some quick code I hacked together a few weeks ago to test
Image::Magick. it creates JPEG thumbnails from a bunch of input
formats.
#!/usr/bin/perl
#
#
use Image::Magick;
my $p = new Image::Magick;
for $infile (@ARGV) {
$infile =~ m|([^/]+)$|;
my $fname = $1;
my $thumb = "small_$fname";
print STDERR " $infile -> $thumb\n";
$p->Read(filename => $infile);
$p->Transform(geometry => '100x100');
$p->Write(filename => "jpeg:$thumb");
undef @$p;
}
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5170
**************************************