[7105] in Perl-Users-Digest
Perl-Users Digest, Issue: 730 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 13 21:17:21 1997
Date: Sun, 13 Jul 97 18:02:12 -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 Sun, 13 Jul 1997 Volume: 8 Number: 730
Today's topics:
"better" prototyping of sub with variable args. <me@anon.com>
[Q] Perl-5.004, localtime & timelocal (Wong Tsang Han)
Re: cause browser to go to a url <will@cs.ucr.edu>
Re: CGI input validation (Rubinstein Dmitry)
Complex Data Structures... <pspierce@mindspring.net>
dns lockup in perl 5,00 winnt <jahnel@xarch.tu-graz.ac.at>
Re: Example of reading data <ajohnson@gpu.srv.ualberta.ca>
Re: Gen. a random no. (within range) (Tung-chiang Yang)
Re: How can I do a 'su' command from inside a Perl scri <rootbeer@teleport.com>
Re: How do you do a 'cut -cx-y' with Perl? <larry@lccinc.com>
How to read and write an image with perl <info@servicepool.net>
Need the straight poop on setuid perl <chris@ixlabs.com>
Newbie confusion <cmattern@madman.ronin.mindspring.com>
Re: online tutorial (Matthew Burnham)
Perl 5.004 Socket from inetd (Jack Tran)
Re: Perl for Win32 and Win32::NetResource? (Marc Haber)
Re: Perl for Win32::Registry Set Value question <dave@turfpit.demon.co.uk>
PerlScript returns blank documents! <rothd@roth.netX>
Re: PerlScript returns blank documents! <rothd@roth.netX>
Re: Reading a document in www (Eric Bohlman)
Re: regex break out of while loop broken? (Craig Berry)
Re: removing every other character from a string (Dean Inada)
Selena Sol Calendar4.0 script (Melody Polakow)
Re: Webmasters??? (Melody Polakow)
Weird setuid problem <chris@ixlabs.com>
While loop question (Brian Scott Ashcraft)
While loop question (Brian Scott Ashcraft)
Re: While loop question <rootbeer@teleport.com>
windows 95 perl <addadi@ibm.net.il>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Jul 1997 01:03:44 -0700
From: Chris Hostetter <me@anon.com>
Subject: "better" prototyping of sub with variable args.
Message-Id: <33C5E8E0.691514E2@anon.com>
i write quiet a few subs that have variable number of arguementss, and
i've been doing it like so:
sub lookup_active_waiter($sid, [$type_1, $type_2, ...]) {
and that has worked fine for me so far:
@temp = lookup_active_waiter('44444444', 'cm', 'cp');
or @temp = lookup_active_waiter('33333333', 'pp');
But recently i tried doing this:
return lookup_active_waiter($sid, @comp);
and i got this:
Malformed prototype for main::lookup_active_waiter: $sid,
[$type_1, $type_2, ...] at waitlist.pm line 503.
now from reading "man perlsub" i see that:
"Not only does the ``&'' form make the argument list
optional, but it also disables any prototype checking on
the arguments you do provide. This is partly for historical
reasons, and partly for having a convenient way to cheat if
you know what you're doing. See the section on Prototypes
below."
and sure enough:
return &lookup_active_waiter($sid, @comp);
... works fine.
now i also wee from "man perlsub" that:
"Unbackslashed prototype characters have special meanings.
Any unbackslashed @ or % eats all the rest of the arguments,
and forces list context. ... A semicolon separates mandatory
arguments from optional arguments. (It is redundant before
@ or %.)"
now the way i read that, i should be saying:
sub lookup_active_waiter($sid, @types) {
but, MOST of the time (i would guess 90%) my sub is only going to be
called with one $type, and the prototype is going to be misleading. (ie:
i don't want users to think they have to provide an array)
is there any other way to prototype something like this ?
-thanx
---
------------------------ The Hoss Man --- "c4"
-------------------- Chris M Hostetter -- --Deep Blue
---------- hossman@uclink3.berkeley.edu - "Resign!"
http://www.rescomp.berkeley.edu/~hossman/ --Gary Kasparov
------------------------------
Date: 11 Jul 1997 05:36:28 GMT
From: tsanghan@genesis.contact.com.sg (Wong Tsang Han)
Subject: [Q] Perl-5.004, localtime & timelocal
Message-Id: <slrn5sbhak.im.tsanghan@genesis.contact.com.sg>
Keywords: Perl-5.004, localtime, timelocal
I wonder if anyone have come accross a failed timelocal test.
cd t && (rm -f perl; /usr/bin/ln -s ../perl perl)
cd t && ./perl TEST </dev/tty
<cut>
.
.
.
<cut>
lib/timelocal.....FAILED on test 1
lib/trig..........ok
Failed 1 test script out of 152, 96.71% okay.
The machine is a Solaris 2.5.1, using GCC 2.7.2.1
Any information will be appreciated.
Tsang Han
------------------------------
Date: Thu, 10 Jul 1997 21:14:42 -0700
From: Will Johnston <will@cs.ucr.edu>
To: "Jason D. Borneman" <jason.d.borneman@rose-hulman.edu>
Subject: Re: cause browser to go to a url
Message-Id: <33C5B332.DD864A03@cs.ucr.edu>
Jason D. Borneman wrote:
> What command do I 'print' to a web browser to get it to go to a
> specified URL?
You print "Location: http://www.server.net/newpage.html\n\n" in an http
header. Just to clarify, a header is the place where you normally put
the things like "Content-Type" and "Content-Length". These get output
to the client browser before the contents of the file that it has
requested.
--
Will Johnston Systems Administrator
will@cs.ucr.edu Department of Computer Science
http://www.cs.ucr.edu/~will University of California, Riverside
------------------------------
Date: 13 Jul 1997 12:55:06 GMT
From: dimrub@nsof.co.il (Rubinstein Dmitry)
Subject: Re: CGI input validation
Message-Id: <5qaj7a$m08$1@lnews.actcom.co.il>
Mark Schwartz (mcs@in.net) wrote:
: #!/usr/bin/perl -w
: # reg2.cgi
: # Last modified: 7-8-97
: open(DEBUGLOG, ">/tmp/debuglog$$");
: open STDERR, ">&DEBUGLOG";
: select(DEBUGLOG); $| = 1; select(STDOUT);
: print DEBUGLOG "/home/httpd/cgi-bin",join(",",@INC),"\n";
: require("cgi-lib.pl");
: &ReadParse(*regdata);
: # 1) while (($vkey, $vvalue) = each(%regdata)) {
: # 1) if ($value =~ /([;><\*\|&\$!#\(\)\[\]\{\}:'"`])/) {
^^^^^^
You've got different names inside the while condition
and inside the 'if' condition: value and vvalue.
Could it be that?
Also, not that it metters, but why do you enclose
your regexp in parens? You don't use it afterwards, right?
--
Dmitry Rubinstein
dimrub@math.tau.ac.il
http://www.math.tau.ac.il/~dimrub
------------------------------
Date: Sun, 13 Jul 1997 16:03:05 -0400
From: Patrick Scott Pierce <pspierce@mindspring.net>
Subject: Complex Data Structures...
Message-Id: <33C93418.4CEB44@mindspring.net>
Hello,
In creating complex data structures like so: (taken from Perl Data
Structures Cookbook)
%TV = (
flintstones => {
series => "flintstones",
rating => "good",
nights => [ qw(monday thursday friday) ],
members => [
{ name => "fred", role => "lead", age => 36, },
{ name => "wilma", role => "wife", age => 31, },
{ name => "pebbles", role => "kid", age => 4, },
],
},
I have successfully written the data structure to a SMDB file and been
able to retrieve it as well; however, I can't seem to get the right spin
on getting the number of elements in 'members'.
Anybody show me an example.
I had hoped something like:
$tmp = $TV{flinstones}{members};
... $#tmp;
but to no avail.
thanks
Patrick Scott Pierce
------------------------------
Date: Mon, 14 Jul 1997 01:30:57 +0200
From: Jahnel Klaus <jahnel@xarch.tu-graz.ac.at>
Subject: dns lockup in perl 5,00 winnt
Message-Id: <33C96531.CAC229B8@xarch.tu-graz.ac.at>
can anybody tell me how to make a dns lockup under perl 5 in the nt
eviroment?
TIA Klaus
------------------------------
Date: Sun, 13 Jul 1997 11:41:20 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Example of reading data
Message-Id: <33C90530.6E4B43F1@gpu.srv.ualberta.ca>
Cloy D. Tobola wrote:
>
> I'm trying to write a simple database program to read an array from data
> lines below the program code. I'm having a heck of a time getting this to
> work.
>
> Can someone point me to a working example of this procedure?
>
while (<DATA>) {
push @data,$_;
}
foreach $line (@data) {
print $line;
}
__DATA__
stuff after the '__DATA__' or '__END__' tokens
can be read using the DATA filehandle.
See also; the perldata manpage.
regards
andrew
------------------------------
Date: Mon, 14 Jul 1997 00:25:26 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Gen. a random no. (within range)
Message-Id: <tcyangEDA96F.85u@netcom.com>
Using the process ID to generate the seed can provide a better
'randomness'.
========================
Shane wrote after zapping the scum of the universe:
: >I ran this - it works. However, it seems to generate
: >[...]
: The fix: insert an srand(); at the beginning of the script (but
: not in any loops).
--
====== Try the low-crossposting robomoderated 'alt.culture.taiwan' ======
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: Sat, 12 Jul 1997 12:53:15 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Enric Rodellas <rodellas@apb.es>
Subject: Re: How can I do a 'su' command from inside a Perl script?
Message-Id: <Pine.GSO.3.96.970712125121.20720E-100000@kelly.teleport.com>
On Fri, 11 Jul 1997, Enric Rodellas wrote:
> Subject: How can I do a 'su' command from inside a Perl script?
>
> I'm trying to execute [the su command] from inside a CGI a command as a
> superuser but it doesn't work.
No, it wouldn't. You probably want to make your script setuid, so see
perlsec(1) for the security details. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 11 Jul 1997 09:47:38 -0400
From: Larry Prall <larry@lccinc.com>
To: Don Wallwork <wallwork@a1.flo.med.ge.com>
Subject: Re: How do you do a 'cut -cx-y' with Perl?
Message-Id: <33C6397A.5E21@lccinc.com>
Don Wallwork wrote:
>
> I am trying to separate the fields in a file that are grouped by
> spacing.
>
> Here is an example of how the file is set up:
>
> Name Phone Alt Ph. Description City Ctr
> ----------------------------------------------------------------------
> FLINTSTONE Fred 555 1234 Caveman Bedrock USA
> JETSON George 555 2651 Future Guy Sky USA
> LE PEW Pepe 555 2922 3421 Romantic Skunk Paris FR
> RUBBLE Barney 555 4321 Caveman's Buddy Bedrock USA
> SIMPSON Homer J. 555 9101 Nuclear Tech Springfield USA
> 0123456789012345678901234567890123456789012345678901234567890123456789
> 1 2 3 4 5 6
>
> (Bottom 2 rows of numbers just for reference here.)
>
> * Notice that number of words in each group can vary.
>
> Basically what I would like to do is read each line, then use something
> like the UNIX cut command to separate the character groupings.
>
> Something like:
>
> while(<>) {
> $name[$i] = cut -c0-20; # This doesn't work.
> $phone[$i] = cut -c21-37;
> ...
> $country[$i] = cut -c67-69;
> $i++;
> }
>
> Is there a Perl operator that will do the cutting?
>
> Thanks,
>
> DPW
I've had good luck with something like:
my $PFORMAT = "A20xA8xa7xA16xA11xA3";
my ( @name, @phone, @altph, @desc, @city, @ctr );
open IN, "input";
for ( my $i=0;<IN>;$i++ ) {
($name[$i],
$phone[$i],
$altph[$i],
$desc[$i],
$city[$i],
$ctr[$i] ) =$unpack $PFORMAT, $_;
}
I assumed a null between fields, but of course you can adjust the
format string to meet your requirements.
------------------------------
Date: Sat, 12 Jul 1997 01:24:59 +0200
From: Marco Ender <info@servicepool.net>
Subject: How to read and write an image with perl
Message-Id: <33C6C0CB.F89590DB@servicepool.net>
Hy,
does anybody know how to read an image from an URL and write it into my
dir
with perl4
Is this the right way ?
open (IMAGE, "$URL");
$IMAGE = <IMAGE>;
close (IMAGE);
$NEWIMAGE="test.gif";
OPEN (NEWIMAGE, "/USR/LOCAL...../$NEWIMAGE);
PRINT IMAGE <IMAGE>;
CLOSE (IMAGE);
CAN ANYWONE HELP ME?
CU MARCO ENDER
------------------------------
Date: Fri, 11 Jul 1997 01:17:27 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Need the straight poop on setuid perl
Message-Id: <33C5EC17.6C02D3A9@ixlabs.com>
If you are on Solaris:
What happens when you run a setuid perl script which points to the
'perl' (not sperl) executable? Does it run sperl anyway? What if sperl
has been removed?
What is taintperl and tperl? When/how are they invoked?
What about on Linux, where the kernel ignores setuid bits on scripts?
Are there differences in behaviour on v.4/5.000/5.003/5.003_07??
I can only ever find bits and pieces of info on this, and never in OS
context.
------------------------------
Date: 13 Jul 1997 11:33:00 -0400
From: Chuck Mattern <cmattern@madman.ronin.mindspring.com>
Subject: Newbie confusion
Message-Id: <m3g1tjt1ar.fsf@madman.ronin.mindspring.com>
For better or worse I am learning Perl for the Waite Groups
Interactive book. Lots of good stuff so far but I'm finding some
typos and other silly problems. The following code does not do what
the book says that it does:
#!/usr/bin/perl
while (<>) {
chomp;
($verb, $other_words, $noun) = (/\b(\w+)\b\s+\b(.*)\b\s?\b(\w+)\b/o);
if ($noun) { print "Where is $noun?\n"; }
else { print "How do I $verb?\n"; }
}
The book claims that this will print the parse the line into the
vairables $verb, $other_wrds and $noun and then if $noun is non-null
ask the first question, other wise asking the second question. All of
it works EXCEPT that after the if all three of these variables are
unset. Thus this occurs:
</home/cmattern/src/perl> ./advent
shut
How do I ?
shut the door
Where is door?
I'm using Perl 5.003 shipped with the Red Hat Linux 4.2 CD.
Any help would be appreciated.
Chuck
--
-----------------------------------------------------------------------------
|Chuck Mattern | "That which does not kill us, makes us stronger."|
|cmattern@mindspring.com | -Friedrich Nietzsche- |
-----------------------------------------------------------------------------
------------------------------
Date: Sun, 13 Jul 1997 21:56:37 GMT
From: danew@enterprise.net (Matthew Burnham)
Subject: Re: online tutorial
Message-Id: <33e141e1.2256199@194.72.192.4>
tram@olympic.seas.ucla.edu (Tri Tram) wrote:
> I've been trying to figure this out. I am trying the exercise in
>the online tutorial of perl.
>
>The sample code is:
>
>#!/usr/local/bin/perl
>#
># Program to open the password file, read it in,
># print it, and close it again.
>
>$file = '/etc/passwd'; # Name the file
>open(INFO, $file); # Open the file
>@lines = <INFO>; # Read it into an array
>close(INFO); # Close the file
>print @lines; # Print the array
> what it says to do is to print each line of the /etc/passwd
>file with a # in front. I should just add one line and modify another?
>I've tried putting $" = "#", but that didn't seem to help any.
>I've also tried
>print "#" . @lines, or something like that but it only printed the # in
>the first line. I can do this using a foreach, but I want to know what
>is the way the tutorial recommended? Thanks.
print '#' . join("\n#", @lines); is one of many ways.
--
Matthew Burnham, Manager, MindWeb | danew@enterprise.net
Commercial web design and hosting, reasonable rates
UKP24/Mb/Year for DIY space | mindweb@pobox.co.uk
FTP, CGI, password protection, etc. too!
http://www.mindweb.co.uk/
------------------------------
Date: Thu, 10 Jul 1997 21:08:43 -0700
From: Jacktran@webtv.net (Jack Tran)
Subject: Perl 5.004 Socket from inetd
Message-Id: <5q4bkb$7lu$1@newsd-104.bryant.webtv.net>
I have a socket server and client that work very well. They use port
5050 to pass a file from the server to client. Insted of running the
server module constantly, I like to run it from inetd, so when the
connection arrives from the client it wakes up and passed the file. I
made an entry in /etc/services for port 5050 and used that name to run
my server in /etc/inetd.conf. All this runs on Sun Solaris 2.5.1.
Here is my problem: When the client starts a socket connection to the
server on port 5050, the server starts ( ps -ef shows the server is
running) however nothing happens. I believe once the server and
client connect, I need to get them off port 5050 to another port but I
don't know how to do this? Can you help? Am I on the right path? Is
there a better way of doing this?
Please respont to my e-mail
Thanks,
Jack
------------------------------
Date: Sun, 13 Jul 1997 12:54:10 GMT
From: s_haber@ira.uka.de (Marc Haber)
Subject: Re: Perl for Win32 and Win32::NetResource?
Message-Id: <5qaj29$mhk$1@nz12.rz.uni-karlsruhe.de>
ron@farmworks.com (Ronald L. Parker) wrote:
>[posted and emailed]
geez, it took the article a week to get around here.
>On Fri, 04 Jul 1997 10:20:19 GMT, s_haber@ira.uka.de (Marc Haber)
>wrote:
>
>>As this seems to work under Windows NT, I suspect that NetResource is
>>incompatible with Windows 95. Can anycone confirm this?
>
>From the Perl for Win32 FAQ
>(http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html):
>
>5.4. What's the difference between running Perl for Win32 on Windows
>NT versus running it on Windows 95?
>
>Although Perl for Win32 originally did not run on Windows 95, there
>should now be little difference between the two operating systems. You
>should watch for the following, though:
>
>[...]
>
> The Win32::NetAdmin, Win32::NetResource, and Win32::EventLog
>modules will not run on Windows 95.
Sorry, I must have missed that part. While it's clear that NetAdmin
and EventLog won't work on Windows 95 [1], I'd like to ask why
NetResource doesn't work. A windows 95 machine can share resources and
can attach to resources shared by another machines. I believe these
functions are controlled via an API on Windows NT _and_ WIndows 95. Is
this API _that_ different on Windows 95 that it is not possible to
support both flavours with a single module?
Is there a module available that allows me to attach a Windows 95
machine to a share shared by an NT server with a perl program running
on the Windows 95 machine?
[1] the corresponding functions are non-existent in Windows 95
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | s_haber@ira.uka.de
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: Sun, 13 Jul 1997 15:56:08 GMT
From: "David Richards" <dave@turfpit.demon.co.uk>
Subject: Re: Perl for Win32::Registry Set Value question
Message-Id: <01bc8fa5$5492bd90$0101010a@turfpit>
Marc
Look at
http://www.inforoute.cgs.fr/leberre1/
for some useful Perl Win32 Registry documentation.
David
Marc Haber <s_haber@ira.uka.de> wrote in article
<5qaj32$mhk$3@nz12.rz.uni-karlsruhe.de>...
> The documentation on Win32::Registry is sparse at least and contains
> plain wrong information. It took me two hours of debugging before
> finding out that Open's arguments are reversed in the documentation,
> yielding "attempt to modify read-only value".
------------------------------
Date: 13 Jul 1997 04:24:48 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: PerlScript returns blank documents!
Message-Id: <01bc8f44$abc4c9c0$a8906ec6@main2>
I've installed Activeware's PerlScript for ASP but the samples that come
with the archive just will not work. It constantly returns a "Document
contains no data". The ISAPI filter works as well as perl from command line
and cgi scripts.
So, okay, what thing must I tweak in the registry or which god must I pray
to for this to work?
Any help is greatly appreciated!!!!
TIA,
dave
--
================================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
rothd@roth.net the illusion of integrity
My email address is disguised to fool automailers. Remove the
trailing 'X' 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: 13 Jul 1997 05:19:36 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: PerlScript returns blank documents!
Message-Id: <01bc8f4c$4a899bb0$a8906ec6@main2>
If you don't know the answer or have not experience with the Win32 Perl
then I respectfully ask that you don't assume. For somebody who has
experience with PerlScript and/or Win32 Perl the fact that the ISAPI filter
and command line runs scripts without incident should be enough general
background.
I am looking for anyone who has had similar problems with PerlScript.
Note: PerlScript is *not* the same as a Perl script.
Thanks for your suggestion, though. I did indeed review the Idiot's Guide
as well as the Win32 Perl FAQ. Neither were helpful, hence my question on
this forum.
dave
Tom Phoenix <rootbeer@teleport.com> wrote in article
<Pine.GSO.3.96.970712215219.14874G-100000@kelly.teleport.com>...
> On 13 Jul 1997, Dave Roth wrote:
>
> > I've installed Activeware's PerlScript for ASP but the samples that
come
> > with the archive just will not work. It constantly returns a "Document
> > contains no data". The ISAPI filter works as well as perl from command
> > line and cgi scripts.
>
> When you're having trouble with a CGI program in Perl, you should first
> look at the please-don't-be-offended-by-the-name Idiot's Guide to
> solving such problems. It's available on the perl.com web pages. Hope
> this helps!
>
> http://www.perl.com/perl/
> http://www.perl.com/perl/faq/
> http://www.perl.com/perl/faq/idiots-guide.html
>
> --
> Tom Phoenix http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com PGP Skribu al mi per Esperanto!
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
------------------------------
Date: Sun, 13 Jul 1997 10:26:34 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Reading a document in www
Message-Id: <ebohlmanED96CA.Es8@netcom.com>
Jennifer Frank (eedjef@eed.ericsson.se) wrote:
: I have the problem that I have to look for a documend on a www-server in
: a perl programm!
: The address is known and I just have to look if it is there ore not (404
: error).
: Has somebody ever tried something like this?
LWP has what you need, and can be found (of course) at www.perl.com/CPAN/
------------------------------
Date: 11 Jul 1997 06:11:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: regex break out of while loop broken?
Message-Id: <5q4iqa$ruq$1@marina.cinenet.net>
Justin Banks (justinb@cray.com) wrote:
: Why does
:
: LINE: while(<FILE> and ! /FOOBAR/g) {
: whatever();
: }
:
: not work like
:
: LINE: while(<FILE>) {
: if(/FOOBAR/) {
: last LINE;
: }
: whatever();
: }
Because the magic assignment of <> to $_ only happens if <> is the sole
condition inside a while() construct's conditional clause. And yes, this
is one of the flakier aspects of Perl, but there it is.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 11 Jul 1997 06:14:14 GMT
From: dmi@deltanet.com (Dean Inada)
Subject: Re: removing every other character from a string
Message-Id: <5q4ivm$e06$1@news01.deltanet.com>
In article <33C550A4.410A@athena.lbl.gov>, Shawn Gordon <sgordon@athena.lbl.gov> wrote:
>while(read (DATA, $_, 2)) {
> $a = unpack("aa",$_);
> print $a;
>}
>
>Tim Smith wrote:
>> ... It seems that
>> unpack() might work, but I can't figure out how to do it.
>>
{local $/;print pack 'c*',unpack 'v*',<DATA>;}
------------------------------
Date: Fri, 11 Jul 1997 05:18:52 GMT
From: melody@imp.net (Melody Polakow)
Subject: Selena Sol Calendar4.0 script
Message-Id: <33c5c18f.10555168@news.lisco.com>
I am running a neat groupware calendar script by Selena Sol
(http://selena.mcp.com/Scripts/) but having problems implementing
multiple calendars through the same script. Just wondering if anyone
out there is using the same script and could talk to me??
A helping hand would be greatly appreciated.
I am running NT4.0/Netscape and Perl 5
_______________________________
------------------------------
Date: Fri, 11 Jul 1997 05:15:29 GMT
From: melody@imp.net (Melody Polakow)
Subject: Re: Webmasters???
Message-Id: <33c5c143.10479312@news.lisco.com>
I am a fairfly experienced webmaster and may be interested!
you can see one of my main sites at fairfield.imp.net
On Thu, 10 Jul 1997 23:02:06 -0500, Rishi Bhattacharya
<rbhattac@jetson.uh.edu> wrote:
>Hello,
>
>I am looking for experienced webmasters to join my team in a new project
>I am starting. The project is www.webresource.net. Please check out the
>layout at:
>
>http://www.webresource.net
>
>Remember, it is only a layout. Most links are not functional. It will be
>a site that will help out novice to expert webmasters. Please contact me
>at rbhattac@jetson.uh.edu if you have time and are interested. I will
>not be back to check this newsgroup, so if you are interested, please
>email me. Thanks.
>
>Rishi Bhattacharya
_______________________________
------------------------------
Date: Fri, 11 Jul 1997 00:50:58 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Weird setuid problem
Message-Id: <33C5E5E2.2BAAF828@ixlabs.com>
We have some old perl code we didn't write sitting around. It is a
script which is an email alias, so it runs setuid to a privileged user
since sendmail invokes it.
Well, I pointed the perl symlink it pointed to (originally to 5.002) to
a new version I built (5.003), we had problems with some other code, so
we switched it back.
Now, obstensibly, we're pointing back to the perl this script had always
successfully used, but now the script dies with "Insecure dependancy"
problems while running setuid.
Sure enough, we found the problematic piped open, but this script has
been running fine with the bug for over a year! Why is it suddenly not
working, when before it did? We are definitely pointing back to the old
perl when we did a perl -V.
SO I asked a freind, and he said that setuid perl scripts, even if they
point to perl, actually turn around and run sperl. I cannot find an
sperl on the system (probably removed because of the security concerns).
Why is my script even trying to run if there is no sperl? I am so
confused.
------------------------------
Date: Sun, 13 Jul 1997 11:03:58 -0400
From: bashcraf@crosslink.net (Brian Scott Ashcraft)
Subject: While loop question
Message-Id: <MPG.e32064d9fb35d19989683@news.crosslink.net>
Hi,
I am writing a small program to count the number of times a string
apprears in a comma delimetered file. Here is a (very) rough outline of
my program so far...
----------
#!/usr/local/bin/perl
#initialize the string to zero
$variable = 0;
#open a comma delimetered file and define 3 fields in the file
open (FILE, file.txt);
while (<FILE>){
($field1, $field2, $field3) = split (/,/, $_);
#look for the string in field3
if($field3 = /some_string_here){
#auto incriment the previously initialized variable
$variable ++;
}#end if
}#end while
print "$variable;
OK, with that said, here is the problem. If the variable has 10
occurances in the file, my print statement at the end of the file only
prints 9 (it is always one short of the actual number of occurances of
the variable in the file). I hope this makes sense.
What gives?
Many thanks in advance for any help anyone can offer!
Brian Ashcraft
bashcraf@crosslink.net
------------------------------
Date: Sat, 12 Jul 1997 22:21:49 -0400
From: bashcraf@crosslink.net (Brian Scott Ashcraft)
Subject: While loop question
Message-Id: <MPG.e3205c42fcbe75f989682@news.crosslink.net>
Hi,
I am writing a small program to count the number of times a string
apprears in a comma delimetered file. Here is a (very) rough outline of
my program so far...
----------
#!/usr/local/bin/perl
#initialize the string to zero
$variable = 0;
#open a comma delimetered file and define 3 fields in the file
open (FILE, file.txt);
while (<FILE>){
($field1, $field2, $field3) = split (/,/, $_);
#look for the string in field3
if($field3 = /some_string_here){
#auto incriment the previously initialized variable
$variable ++;
}#end if
}#end while
print "$variable;
OK, with that said, here is the problem. If the variable has 10
occurances in the file, my print statement at the end of the file only
prints 9 (it is always one short of the actual number of occurances of
the variable in the file). I hope this makes sense.
What gives?
Many thanks in advance for any help anyone can offer!
Brian Ashcraft
bashcraf@crosslink.net
------------------------------
Date: Sun, 13 Jul 1997 08:00:59 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Brian Scott Ashcraft <bashcraf@crosslink.net>
Subject: Re: While loop question
Message-Id: <Pine.GSO.3.96.970713075630.8969G-100000@kelly.teleport.com>
On Sat, 12 Jul 1997, Brian Scott Ashcraft wrote:
> if($field3 = /some_string_here){
The equals sign and the slash are both bad. You probably want something
like one of these lines instead.
if ($field3 eq 'some exact string to match') {
if ($field3 =~ /some pattern.*to match/) {
if (index($field3, 'may be a better way') != -1) {
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 13 Jul 1997 20:05:35 +0300
From: "IBM Israel" <addadi@ibm.net.il>
Subject: windows 95 perl
Message-Id: <5qb30v$dh2$1@news.ibm.net.il>
Hi all,
Where can I get the window 32/NT/95 version for perl 5? (And I mean really
download cause all the links from yahoo -> perl are borken)
Please mail me at:
addadi@ibm.net.il
Thanks
Guy Addadi
------------------------------
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 730
*************************************