[7996] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1621 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 12 12:07:32 1998

Date: Mon, 12 Jan 98 09:00:29 -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           Mon, 12 Jan 1998     Volume: 8 Number: 1621

Today's topics:
     $2 and $3 are unreliably unset? <mgiroux@icon.com>
     Re: A newbie and File::Find wonders <jdporter@min.net>
     Re: A newbie's substitution question (Mike Stok)
     Re: A newbie's substitution question <merlyn@stonehenge.com>
     Activestate PerlScript and Sarathy port? <tim@hcirisc.cs.binghamton.edu>
     Re: Activestate PerlScript and Sarathy port? (Jeremy D. Zawodny)
     Re: bison for perl <jdporter@min.net>
     Re: Can Perl talk smtp protocol under NT4? (Eric T. Wienke)
     Re: Can Perl talk smtp protocol under NT4? <yamasaki@mars.dti.ne.jp>
     Re: Delay in perl... ? (Honza Pazdziora)
     Re: Delay in perl... ? <NPalmer@photographics.co.uk>
     Re: Delay in perl... ? <tchrist@mox.perl.com>
     effective perl vs. advanced perl books? (felix k sheng)
     File permissions and umask <kenvogt@sni.net>
     Re: File permissions and umask <tchrist@mox.perl.com>
     Re: File permissions and umask <jack_h_ostroff@groton.pfizer.com>
     Re: Getopt::Long caveat? (frans postma)
     How to do a substitution with the open command? <barry@megaspace.com>
     Re: How to do a substitution with the open command? <zenin@best.com>
     Re: multiple keys with same value in declaration? (M.J.T. Guy)
     Online Career Fair Tuesday <arc@flash.net>
     Re: PERL & IIS 4 (final) hanging - help!! <dpatten@dlj.com>
     Re: Perl / CGI newsgroup? (Jay Flaherty)
     Re: Perl for Engineering purposes <denicola@ll.mit.edu>
     Re: perl under windows95 (Lynchqvctc)
     Photoshop in a Nutshell (was Re: recomended Perl books  <merlyn@stonehenge.com>
     Re: POP3 (Ronald L. Parker)
     Re: prog termination by server? (Jeremy D. Zawodny)
     Range Operator <Joe.Kline@sdrc.com>
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Subroutine arguements (newbie) (John Walker)
     Re: Telnet client written in perl (frans postma)
     Truncating/trim from start an open text file <asulai@ctp.com>
     Re: Unpacking length-infor style data. (Bart Lateur)
     Re: weird problem! <ric@megsinet.net>
     WHY DOES THIS FAIL? <sjenifer@isc.mds.lmco.com>
     Re: WHY DOES THIS FAIL? <rjc@liddell.cstr.ed.ac.uk>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 12 Jan 1998 11:28:08 -0500
From: Mike Giroux <mgiroux@icon.com>
Subject: $2 and $3 are unreliably unset?
Message-Id: <34BA4498.B864E845@icon.com>

A co-worker asked me if $2 and $3 get unset if a later s// only has one
set of ().  I thought so, but I decided to test it.  That works
properly,
but what doesn't seem to work reliably is preservation of $1, $2, and $3
when a match _fails_.  From this test case, it looks like the values get
preserved across one failed match, but not always across the second, and
this
only in a while loop.  Is there an easy explanation for this??

In the test run, you can see the odd behaviour in the "testing with 'a'"
case.
"Testing with 'abc'" illustrates what happens when all regexps match (no
surprises),
while "Testing with 'ab'" shows that when the first match fails $1 and
$2 remain set.

Oh, it gets stranger; if you duplicate test 2 more times, it's still the
_last test 2_ 
in the loop that fails.  

Putting everything from chomp; to print "\n" into a sub and calling the
sub results in
"normal" behaviour, where the $1-$3 variables get cleared by the first
failed match.

I'm including the 'perl -V' output, since I did build perl with
-DDEBUGGING.
The same problem occurs with perl5.003 built without -DDEBUGGING,
though, so
that's not likely to be the cause.

Thanks for any insights you can offer...  I'm so confused!! :)

I'm almost tempted to cross-post this to rec.puzzles... :)

Please cc: me on follow-ups.
--
Mike


-------- cut here ------------
#!/usr/bin/perl 
 
# No -w flag, since we know we have undefined $3 variables...
 
while(<DATA>)
{
        chomp;
 
        print "Testing with '$_'\n";
#test 1 
        /(.)(.)(.)/ or print "/(.)(.)(.)/ failed\n"; 
        print "1=$1; 2=$2; 3=$3\n"; 
#test 2 
        /(.)(.)/ or print "/(.)(.)/ failed\n"; 
        print "1=$1; 2=$2; 3=$3\n";
#test 2 again
        /(.)(.)/ or print "/(.)(.)/ failed\n"; 
        print "1=$1; 2=$2; 3=$3\n";
 
        print "\n";
}
__END__
abc
ab
a
------ cut here ------------
Testing with 'abc'
1=a; 2=b; 3=c
1=a; 2=b; 3=
1=a; 2=b; 3=
 
Testing with 'ab'
/(.)(.)(.)/ failed
1=a; 2=b; 3=
1=a; 2=b; 3=
1=a; 2=b; 3=
 
Testing with 'a'
/(.)(.)(.)/ failed
1=a; 2=b; 3=
/(.)(.)/ failed
1=a; 2=b; 3=
/(.)(.)/ failed
1=; 2=; 3=
 
Testing with ''
/(.)(.)(.)/ failed
1=; 2=; 3=
/(.)(.)/ failed
1=; 2=; 3=
/(.)(.)/ failed
1=; 2=; 3=
------ cut here ------------
> perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos iconrnd65 5.5.1 generic_103640-09 sun4m sparc
sunw,sparcstation-20 '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O', gccversion=
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include -DDEBUGGING'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/opt/gnu/lib'
    libpth=/usr/local/lib /opt/gnu/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-Kpic', lddlflags='-G -L/usr/local/lib -L/opt/gnu/lib'
 
 
Characteristics of this binary (from libperl): 
  Compile-time options: DEBUGGING
  Built under solaris
  Compiled at Dec 23 1997 09:48:42
  @INC:
    /usr/local/lib/perl5/sun4-solaris/5.00404
    /usr/local/lib/perl5
    /usr/local/lib/perl5/site_perl/sun4-solaris
    /usr/local/lib/perl5/site_perl
    .
------ cut here ------------


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

Date: Mon, 12 Jan 1998 11:04:56 -0500
From: John Porter <jdporter@min.net>
Subject: Re: A newbie and File::Find wonders
Message-Id: <34BA3F28.1AEB@min.net>

Marek Jedlinski wrote:
> 
> @file_mask = "*";
> if (@ARGV) { @file_mask = @ARGV }
> #I.e., if no commandline parameters, we will list everything
> 
> for (<@file_mask>) {
>         print "$_\n";
> }
> 

First,
	@file_mask = "*";
assigns a scalar value to an array variable.  This is NOT
what you want.

Second, the man page indicates that you shouldn't
use variables inside angle brackets to do filename globbing;
for that, use the function glob().  And it wants a scalar
expression, not a list.

So to fix these two problems, you have this:

	$file_mask = "*";
	for ( glob( $file_mask ) ) {
		print "$_\n";
	}


> So now I can pass the file_mask to the script and have all the
> matching files listed. This works... Except when I specify a file
> mask that "should" return NO matches. Assuming that I have no
> file called "xxx" in the current directory, and run the script as
> 
>         perl findfile.pl x*x
> 
> the script does not output anything - correctly, since no match
> exists. BUT, if I run
> 
>         perl findfile.pl xxx
> 
> the script does output "xxx" AS IF a file by that name were
> found. And, again, I go "huh??"

What is really happening here is your interactive shell is
doing the globbing, and passing the list of strings to your
perl script.  I can tell you what csh does, and other shells
may do the same thing. Namely, if you have a literal string
with no wildcards in it, such as 'xxx', then this string is
passed as is, with no globbing -- regardless of whether the
file exists.  If the string has wildcards, csh attempts to
expand (glob) it, and the resulting list is passed as arguments
to your script; in this case, 'x*x' globs to an empty list, so
no args are passed to the script.  The loop in your code just
prints the args passed in.

In order to keep your shell from doing the globbing for you
(if that's really what you want), you need to escape the
wildcards:

	perl findfile.pl x\*x

hth,
John Porter
jporter@logicon.com


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

Date: 12 Jan 1998 10:14:42 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: A newbie's substitution question
Message-Id: <69dc12$tv$1@stok.co.uk>

In article <34bae1ba.3538268@news.tornado.be>,
Bart Lateur <bart.mediamind@tornado.be> wrote:

>>   s[([A-Z][A-Z]+?)|_(.+?)_][<b>$1$2</b>]g;
>
>Since either $1 or $2 will be empty. It might trigger the "use of
>undefined variable" warning, though (Grrr... I wish there was an easy
>way to suppress those warnings. I usually DON'T use -w, because of these
>irritating warnings).

If the warnings you don't like are caused at run time then 

  {
    local ($^W) = 0;

    ... code ...
  }

might help.

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 12 Jan 1998 09:44:48 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: tadmc@flash.net (Tad McClellan)
Subject: Re: A newbie's substitution question
Message-Id: <8cen2dhcan.fsf@gadget.cscaper.com>

>>>>> "Tad" == Tad McClellan <tadmc@flash.net> writes:

Tad> There _is_ an easy way to suppress those warnings:

Tad> $^W = 0;  # turn warnings off

Tad> s[([A-Z][A-Z]+?)|_(.+?)_][<b>$1$2</b>]g;

Tad> $^W = 1;  # turn warnings back on

Or, safer (less dangerous to the surrounding program):

    {
	local $^W;
	do_your_dangerous_thing_here;
    }

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 231 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 12 Jan 1998 09:24:06 -0500
From: Tim Gray <tim@hcirisc.cs.binghamton.edu>
Subject: Activestate PerlScript and Sarathy port?
Message-Id: <t0d8hxhit5.fsf@hcirisc.cs.binghamton.edu>


I want to do some scripting on an NT server running IIS 3.0 with
active server pages.  I would prefer to use the Sarathy port for win32
rather than the activestate one so I can get the later and fuller
distribution.  Is that port compatible with the perl for ISAPI and
PerlScript?  As it is now I installed Activestate perl for win32 then
perl for ISAPI and PerlScript.  Then I installed the Sarathy port on
top of it all.  The problem is that Active Server Pages containing
PerlScript as simple as 'print "foo";' crash the IIS process.  Any
suggestions?  Thanks.

Tim Gray


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

Date: Mon, 12 Jan 1998 15:59:31 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Activestate PerlScript and Sarathy port?
Message-Id: <34bb3d98.8190186@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On 12 Jan 1998 09:24:06 -0500, Tim Gray
<tim@hcirisc.cs.binghamton.edu> wrote:

>
>I want to do some scripting on an NT server running IIS 3.0 with
>active server pages.  I would prefer to use the Sarathy port for win32
>rather than the activestate one so I can get the later and fuller
>distribution.  Is that port compatible with the perl for ISAPI and
>PerlScript?  As it is now I installed Activestate perl for win32 then
>perl for ISAPI and PerlScript.  Then I installed the Sarathy port on
>top of it all.  The problem is that Active Server Pages containing
>PerlScript as simple as 'print "foo";' crash the IIS process.  Any
>suggestions?  Thanks.

I've just decided to avoid PerlScript and PerlIS until they're more
stable. I've been bitten too many times.

I'm in the process of converting to Sarathy's Perl5.004 across the
board and just coming up with other ways to do things.

The merger in Perl5.005 can't come soon enough.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 12 Jan 1998 09:43:05 -0500
From: John Porter <jdporter@min.net>
Subject: Re: bison for perl
Message-Id: <34BA2BF9.5446@min.net>

Jack H. Ostroff wrote:
> 
> > > They kind of have to for solaris, as Solaris doesn't bloody come
> > > with a C compiler standard! :(
> >
> John Porter wrote:
> > So? As long as gcc is available, you don't need binaries... at least
> > for the common unix flavors (including Solaris).
> >
> On many platforms, there are times when you DO need binaries - it's
> a bootstrapping problem.  GCC is available, but how do you compile it
> without a compiler?  (whether gcc or native)

Of course, you always have this bootstrapping issue with a new platform.
But we're talking about Solaris...


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

Date: Mon, 12 Jan 1998 13:25:05 GMT
From: eric@NOSPAM_liquidsilver.com (Eric T. Wienke)
Subject: Re: Can Perl talk smtp protocol under NT4?
Message-Id: <34ba1921.53578561@192.168.0.1>

 ...or just get form2mail from
http://www.liquidsilver.com/scripts/form2mail which does exactly that,
using sockets to talk to a SMTP server, works with both win and unix
btw...

On Mon, 12 Jan 1998 05:30:16 +0100, martin@RADIOGAGA.HARZ.DE (Martin
Vorlaender) wrote:

>Neil Sedley (neil@nsedley.dircon.co.uk-antispam) wrote:
>: Cool Yam wrote in message <34B787D3.5344@mars.dti.ne.jp>...
>: >I need to make Form2Mail.pl under WindowsNT4.
>: >But,I can't use any sendmail aplication.
>: >I hear Perl can talk smtp protocol,but I don't know
>: >how to make it.
>: >Anybody know how to make that script??
>: Get hold of the SMTP RFC ( 821 ISTR) and implement it yourself by opening a
>: socket on port 25 (provided it is not already opened by another
>: application). The protocol is very easy to implement ( I have written one to
>: receive SMTP so one to send it should by quite easy).
>
>No need to re-invent the wheel. Have a look at the Net::SMTP module.
>
>cu,
>  Martin
>--
>                          | Martin Vorlaender | VMS & WNT programmer
> Ceterum censeo           | work: mv@pdv-systeme.de
> Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
>                          | home: martin@radiogaga.harz.de

Eric T. Wienke

To send email remove "NOSPAM_" from the address.


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

Date: Tue, 13 Jan 1998 01:46:43 +0900
From: MasashiYamazaki <yamasaki@mars.dti.ne.jp>
Subject: Re: Can Perl talk smtp protocol under NT4?
Message-Id: <34BA48F3.649E@mars.dti.ne.jp>

Hi! Thanks!

I'll try Net::SMTP.

Because,Firewall is working bettween otherNT4 and our server.

thanks!

----
yamasaki@mars.dti.ne.jp.


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

Date: Mon, 12 Jan 1998 12:54:28 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Delay in perl... ?
Message-Id: <adelton.884609668@aisa.fi.muni.cz>

udta@rz114s1.rz.uni-karlsruhe.de (Tobias Poppe) writes:

> Hello...
> 
> I want to print every 10 seconds "Hello World" to standart output.
> Is there a "delay-statement2 in perl to wait maybe 10 or
> more seconds ?
> Like "delay(100000) in pascal ?

It's named after Un*x system call sleep, see man perlfunc for it.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 12 Jan 1998 15:57:47 GMT
From: "Nick Palmer" <NPalmer@photographics.co.uk>
Subject: Re: Delay in perl... ?
Message-Id: <01bd1f73$098d7ed0$47c809c0@nic>



Tobias Poppe <udta@rz114s1.rz.uni-karlsruhe.de> wrote in article
<69d10a$f8s$1@nz12.rz.uni-karlsruhe.de>...
> Hello...
> 
> I want to print every 10 seconds "Hello World" to standart output.
> Is there a "delay-statement2 in perl to wait maybe 10 or
> more seconds ?
> Like "delay(100000) in pascal ?
> 
> Thnx..
> 
> --
> MfG Tobias Poppe - Informatik HQ Karlsruhe
>   *** eMail udta@rz.uni-karlsruhe.de ***
>           ** sysop@hmc-bbs.org **
> 

In case you haven't already sussed, use sleep...... e.g. 

print "Hello ";
sleep 1;
print "World!\n";


Sorry but it only works in seconds.


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

Date: 12 Jan 1998 16:31:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Delay in perl... ?
Message-Id: <69dgg8$jg3$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    "Nick Palmer" <NPalmer@photographics.co.uk> writes:
:In case you haven't already sussed, use sleep...... e.g. 
:
:print "Hello ";
:sleep 1;
:print "World!\n";

Buffering.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

"I woudn't recommend sex, drugs, or Unix for everyone, but they work for me."
    Jim Thompson (jthomp@tadpole.com), paraphrasing Hunter S. Thompson


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

Date: 12 Jan 1998 15:25:02 GMT
From: felix@chance.em.nytimes.com (felix k sheng)
Subject: effective perl vs. advanced perl books?
Message-Id: <slrn6bkdcf.n50.felix@chance.em.nytimes.com>

hello,

i was reading some reviews of effective perl and was wondering
whether anyone has done any comparisons of it and advanced perl
programming?  that is, are they about at the same level? 
do they cover the same topics or does each have it's own focus?
any thoughts would be appreciated!

'lx

--- felix sheng                                       pager     800 979 2171
 programmer                                           tel       212 597 8069
 the new york times electronic media company          e    felix@nytimes.com


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

Date: Mon, 12 Jan 1998 08:07:55 -0700
From: Kenneth Vogt <kenvogt@sni.net>
Subject: File permissions and umask
Message-Id: <34BA31CA.E8E2D7A0@sni.net>

How does OPEN know what file permissions to assign to a new file it
creates? I am told to use UMASK, but the man pages leave something to be
desired when describing UMASK, as noted below. Would I enter something
like:

umask 755;

The man pages report:

NAME
umask - set file creation mode mask



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

SYNOPSIS
umask EXPR
umask




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

DESCRIPTION
Sets the umask for the process and returns the old one. If EXPR is
omitted, merely returns current umask.

--
Kenneth Vogt
KenVogt@sni.net

http://ModernShopping.com
Buy Tupperware(r) products right on the WWW!




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

Date: 12 Jan 1998 16:12:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: File permissions and umask
Message-Id: <69dfcm$ihk$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Kenneth Vogt <kenvogt@sni.net> writes:
:umask 755;

You forgot many things, like a leading 0 for octal, and
remembering that umask specifies bits to turn off, not on.

You usually want one of these:

    umask 022;
    umask 002;
    umask 027;
    umask 007;

I suggest the first one.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    Hey, I had to let awk be better at *something*...  :-)
            --Larry Wall in <1991Nov7.200504.25280@netlabs.com>1


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

Date: Mon, 12 Jan 1998 11:25:16 -0500
From: "Jack H. Ostroff" <jack_h_ostroff@groton.pfizer.com>
To: Kenneth Vogt <kenvogt@sni.net>
Subject: Re: File permissions and umask
Message-Id: <34BA43EC.170@groton.pfizer.com>

[reply posted and mailed]
Kenneth Vogt wrote:
> 
> How does OPEN know what file permissions to assign to a new file it
> creates? I am told to use UMASK, but the man pages leave something to be
> desired when describing UMASK, as noted below. Would I enter something
> like:
> 
> umask 755;
> 
I think this depends (at least somewhat) on your operating system.  
However, on most Unix type systems, the umask value specifies
permissions
excluded at creation.  umask 0 allows all permissions appropriate for
the
file, umask 077 allows all for owner but nothing for others.

Also, since you are specifying by bits, it is most common to use a 
leading 0 to specify in octal.

Good luck.

jack_h_ostroff@groton.pfizer.com


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

Date: Mon, 12 Jan 1998 13:23:53 GMT
From: fpostma@xs4all.nl (frans postma)
Subject: Re: Getopt::Long caveat?
Message-Id: <34ba18a2.18490838@hdxf08.telecom.ptt.nl>

On 10 Jan 1998 06:10:30 GMT, darlenem@PAS.DE.SPAM.flash.net (Jeeves)
wrote:

>use GetOpt::Long;
>%optctl = ( 'n' => \$num,);
>&GetOptions(%optctl);
># lots_of_code
>
>Suppose the above snippet was run with '-n 10'. That's nice, $num is now 10.
>But if no number is given? I cannot find an example of this *anywhere* in the
>Camel book! I can only assume that it would set $num to 1. But what if the
>script was run with 'n=1'? Am I missing something? If not, how do I deal with
>that?

It's set to zero. (0) So you have to test optional option-values with
defined() instead of $a=$value||some_default_value 

It's most definitly NOT set to one, at least not with perl 5.004pl1 it
ain't. (we do a $value=1 if defined $option && !$option in most of the
parsing of optional values)




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

Date: Mon, 12 Jan 1998 08:39:43 -0500
From: "Barry Kaplan" <barry@megaspace.com>
Subject: How to do a substitution with the open command?
Message-Id: <01bd1f5f$7ca78730$0ed0afce@bazzle>

Using the following open command, I can append to a new.list, but I can't
do a substitution. How can I open new.list so that I can do a substitution
as well as append to the file?

open(DATABASE, ">>new.list") || die "Can't open list: $!\n";
print DATABASE "sonny\n" || die "Can't write to list: $!\n";		#Will append
to new.list
s/larry//g || die "Can't replace in list: $!\n";		#Will not substitute in
new.list 
close(<DATABASE>);


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

Date: 12 Jan 1998 14:15:15 GMT
From: Zenin <zenin@best.com>
Subject: Re: How to do a substitution with the open command?
Message-Id: <884614764.512099@thrush.omix.com>

Barry Kaplan <barry@megaspace.com> wrote:
: Using the following open command, I can append to a new.list, but I can't
: do a substitution. How can I open new.list so that I can do a substitution
: as well as append to the file?

	Hmm, sounds like you may want to look at the -i (edit Inplace) runtime
	flag.  See the perlrun man page for details.

	If that's to limiting, you'll have to do it manually by either
	writing to a temp file and moving it in place, coping the file into
	memory (like an @array) and writing it back when youre done, and
	a few other (less useful) options. 

-- 
-Zenin
 zenin@best.com


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

Date: 12 Jan 1998 13:46:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: multiple keys with same value in declaration?
Message-Id: <69d6r4$fbp$1@lyra.csx.cam.ac.uk>

In article <EMny1L.Inx@unx.sas.com>, Chris Sherman <sherman@unx.sas.com> wrote:
>I want several keys in a hash to have the same ref to a value.
>
>Is there way of doing that in the declaration of the hash, or do
>I have to set it up afterwards?  
>
>In my case, doing afterwards will be very ugly and awkward, and I'm trying
>to get away from that. 

I'd do it like this:

my $array_ref = [ "one", "two" ];

my %hash = ( foo => $array_ref, bar => $array_ref );

i.e. build up your complex structure a layer at a time from the bottom.


Mike Guy


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

Date: Mon, 12 Jan 1998 08:47:08 -0600
From: Apex <arc@flash.net>
Subject: Online Career Fair Tuesday
Message-Id: <34BA2CEB.61C16CB2@flash.net>

CyberNet Online Career Fair

CyberNet is a real-time interactive forum between Dallas' top technical
recruiters and qualified candidates interested in exploring new
employment opportunities online.
 Tuesday, January 13th 9:00 a.m. - 7:00 p.m. CDT
 Register to win a FREE trip (for 2) to Las Vegas!
 Interview with the nation's top technical companies from the comfort of
your own home!
As a first time ever event in Dallas, you will have the opportunity to
hold a private chat session with some of Dallas' largest high-tech
companies. Visit our website:
http://www.CyberNetCareer.com
and check out current opportunities available with companies such as
Southwestern Bell, Raytheon, MCI, NCR, Worldcom, Sprint, Oracle, and
FedEx.
Tell a friend and remember Attend the fair on January 13 (9:00 a.m. CDT
to 7:00 p.m.CDT) and be automatically entered in a drawing for a FREE
weekend vacation getaway for two in Las Vegas!!
Thanks for passing the word around.





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

Date: Mon, 12 Jan 1998 11:20:29 -0500
From: "Dave Patten" <dpatten@dlj.com>
Subject: Re: PERL & IIS 4 (final) hanging - help!!
Message-Id: <#eiSDZ3H9GA.154@uppssnewspub05.moswest.msn.net>

After rewriting the way perl.exe was getting the post Data, my
perl.exe works fine on IIS 4.0....


Jan Versteeg wrote in message <34baafc3.1773540@news.worldonline.nl>...
>Use PerlIS.dll from www.activestate.com in stead of Perl.exe. For some
>reason IIS4 can't handle perl.exe. Run the PlISi315.exe but do not run
>the install.bat because it ads a line to your script mapping in your
>registry. Register the dll (.pl and .cgi without the %s) through
>Internet Service Manager (Master Properties -> www service -> edit ->
>home directory -> configuration).
>
>This should do the trick. After I installed the PerIIS.dll all my cgi
>scripts that wouldn't work with perl.exe running perfectly!
>
>Jan.
>
>
>
>
>
>
>nospam@XX.co.uk wrote:
>
>>We are running PERL (build 315) and IIS 4 (the final release).  When
>>we call a simple perl script, the browser shows server contacted,
>>waiting for reply, but just hangs forever.  When we look in the
>>process monitor a copy of perl.exe is open.  Even after we stop the
>>request this does not go away.  If you then request the perl script
>>again, it hangs again, and a new copy of perl.exe (along with the
>>original) is visible in process monitor.
>>
>




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

Date: 12 Jan 1998 14:07:00 GMT
From: fty@hickory.engr.utk.edu (Jay Flaherty)
Subject: Re: Perl / CGI newsgroup?
Message-Id: <69d824$l7v$1@gaia.ns.utk.edu>

Scott Vetter (svetter@ameritech.net) wrote:
: Is there a Perl / CGI newsgroup around?  Or one that is strictly CGI?

comp.infosystems.www.authoring.cgi

Jay
--
**********************************************************************  
Jay Flaherty                                               fty@utk.edu
"Once in awhile you get shown the light, in the strangest of places if
you look at it right" - R. Hunter
**********************************************************************



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

Date: Mon, 12 Jan 1998 10:03:03 -0500
From: Lane DeNicola <denicola@ll.mit.edu>
Subject: Re: Perl for Engineering purposes
Message-Id: <34BA30A3.39C264AD@ll.mit.edu>

Frank Buntschuh wrote:
> 
> Although I am quite
> interested in what others are doing in the scientific/engineering sense with
> perl, I get the most value by lurking in the existing perl groups, persusing
> CPAN, etc.  IMHO, a separate newsgroup or mailing list wouldn't be of much
> value (to me) - I spend enough time and get enough value from what is out
> there already.
> 

I also have (and will continue to) put Perl to use in engineering-type
applications.  Most recently I've been developing a front-end for a monolithic
piece of legacy FORTRAN code (specifically, an IR signature prediction code
used within the ballistic missile defense community).  Other generic data
characterization and management tasks for which I've used Perl are too
numerous to list.  I won't waste any time preaching to the choir about how
much Perl has made possible...

I would like to say, however, that I've felt something more could be added in
this particular regime (Perl scientific/engineering applications).  Techniques
for building Perl interfaces to older (and newer) FORTRAN(66|77|90) code,
building Perl-based architectures that use common analysis packages for
back-end processing/plot generation (e.g. Matlab), and discussion of modules
for handling scientific data formats (e.g. NCSA's HDF, netCDF, etc.), for example.

Some of this sort of thing can be gleaned from newsgroups
("comp.lang.fortran", "sci.data.formats") or paper publications ("Computers in
Physics", "Dr. Dobb's Journal"), but mention of Perl seems sparse in these
resources.  It seems quite possible to me that there's a critical mass of
material; maybe I just don't get around enough...

================================================================
|   Lane DeNicola
|   MIT Lincoln Laboratory
|   Group 32/System Engineering and Analysis
|   Mail Stop: S1-359
|   voice: (781) 981-3843
|   FAX: (781) 981-4739
================================================================


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

Date: 12 Jan 1998 16:19:05 GMT
From: lynchqvctc@aol.com (Lynchqvctc)
Subject: Re: perl under windows95
Message-Id: <19980112161901.LAA19247@ladder01.news.aol.com>

>Subject: Re: perl under windows95
>From: "David A. Frantz" <wizard@eznet.net>
>Date: Sun, Jan 11, 1998 01:19 EST
>Message-id: <34b86392.0@news.eznet.net>
>
>Well if your running Windows 95 why not just double click on the script you


This should work... if the .pl scripts are associated with perl.exe  (this
doesn't necessarily happen with Win95, and might have to be done manually).


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

Date: 12 Jan 1998 08:36:27 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: sitaram@diac.com (Sitaram Chamarty)
Subject: Photoshop in a Nutshell (was Re: recomended Perl books ?)
Message-Id: <8clnwlhfgk.fsf_-_@gadget.cscaper.com>

>>>>> "Sitaram" == Sitaram Chamarty <sitaram@diac.com> writes:

Sitaram> try stuff like NT system admin books, or books on Excel - ORA
Sitaram> has them too.

Actually, one of the most unusual books I've gotten from ORA is a book
called "Photoshop in a Nutshell".  I'm no artist, but I bought
Photoshop and Illustrator in hopes that somehow just having them on
disk will inspire me. :-) And I bought nearly every Photoshop and
Illustrator book on the market.

They now all sit on my shelf.  Photoshop in a Nutshell (ORA) is the
*only* reference I use.  No pretty color pictures to make it
thick... it just simply has *how* to do things, and *what* the sliders
do, from a very experienced practical perspective. Stuff like "this
filter shouldn't even be in this program... the XXX filter does the
same thing much better" and "even though this slider goes from 1 to
100, anything above 4 is useless".  Great stuff!

Sorry for the divergence, and I don't often gush about a book I didn't
write, but that's a *great* book.  (That, and "Programming Python",
also a wonderful book.)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 232 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 12 Jan 1998 16:37:13 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: POP3
Message-Id: <34ba464b.12303030@10.0.2.33>

On Sun, 11 Jan 1998 21:42:12 -0600, john@customer1st.com (John
Sievert) wrote:

>I have had a similiar problem on the mac with this same script.  Does
>this work, is there another POP3 client out there anywhere?

There's Net::POP3, available on CPAN or included with gsar's Win32
distribution (I realize this isn't useful for the mac, but the guy you
replied to is on a DOSish machine.)




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

Date: Mon, 12 Jan 1998 15:57:41 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: prog termination by server?
Message-Id: <34ba3d69.8142678@igate.hst.moc.com>

[original author automagically cc'd via e-mail]

On 12 Jan 1998 12:22:34 GMT, udta@rz114s1.rz.uni-karlsruhe.de (Tobias
Poppe) wrote:

>Hi..
>
>if i start a cgi-perl-skript by connecting to a web-site (the
>skript runs on the server in the cgi-bin-direct.), what happens, if:
>- the user (netscape) goes to an other web-page
>  and the skript is still running (maybe a loop-statement wich takes
>  1 hour to complete, but the user (netscape) terminates the connecting to the
>  internet after 2 minutes) ?
>
>Does the server automaticly terminates the skript  ???

Nope.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 12 Jan 1998 11:17:37 -0500
From: Joe Kline <Joe.Kline@sdrc.com>
Subject: Range Operator
Message-Id: <34BA4220.CA0CAE0C@sdrc.com>

This is a multi-part message in MIME format.
--------------4076ED0429F7CC266533DC3C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Folks,

I was passing a list slice into another list and got some
unexpected results.

$lines = a:1:3:5
@inputs = a 1 3 5:3
@temp = 1
Argument "" isn't numeric in aelem at rage.pl line 18, <IFILE> chunk
2.
$lines = b:2:4:6
@inputs = b 2 4 6:3
@temp = b
Argument "" isn't numeric in aelem at rage.pl line 18, <IFILE> chunk
3.
$lines = c:7:11:13:17:19
@inputs = c 7 11 13 17 19:5
@temp = c


the @temp array should hold values of the second through
the last element of the @inputs array, but it doesn't.

My script and input file are listed below. Either I have
a typo I can't see in my script or my understanding of
the range operator is messed up.

Thanks for any and all assisstance,

joe


#################
#
# scripts
#
#################


#! /usr/local/bin/perl5 -w

use strict;
use Carp;

$|=1;

my $input_file = $ARGV[0];

open (IFILE,"<$input_file") or
        confess "Can't open $input_file: $!";
my ($lines, @inputs, %env_keywords, @env_order, @temp);
@temp = ();
 ILINES:while ( $lines=<IFILE> )
{
    chomp ($lines);
        @inputs = split ':', $lines;
        @temp = $inputs[ 1 .. $#inputs ];
        print "\$lines = $lines\n";
        print "\@inputs = @inputs:$#inputs\n";
        print "\@temp = @temp\n";
    @inputs = @temp = ();
                $lines = "";
}
close (IFILE);

######
#
# input file
#
######

a:1:3:5
b:2:4:6
c:7:11:13:17:19






--
Joe Kline - joe.kline@sdrc.com

            jkline@mail.isoc.net



--------------4076ED0429F7CC266533DC3C
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Joe Kline
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Joe Kline
n:              Kline;Joe
org:            SDRC
email;internet: Joe.Kline@sdrc.com
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------4076ED0429F7CC266533DC3C--



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

Date: 12 Jan 1998 15:26:00 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <69dcm8$jl1$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 05 Jan 1998 14:56:03 GMT and ending at
12 Jan 1998 14:15:15 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.
    - Original Content Rating is the ratio of the original content volume
      to the total body volume.
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.

Excluded Posters
================

perlfaq-suggestions\@mox\.perl\.com

Totals
======

Posters:  483
Articles: 1119 (393 with cutlined signatures)
Threads:  370
Volume generated: 1790.2 kb
    - headers:    774.9 kb (15,578 lines)
    - bodies:     932.0 kb (30,100 lines)
    - original:   659.8 kb (22,721 lines)
    - signatures: 82.1 kb (1,822 lines)

Original Content Rating: 0.708

Averages
========

Posts per poster: 2.3
    median: 1 post
    mode:   1 post - 322 posters
    s:      5.0 posts
Posts per thread: 3.0
    median: 2.0 posts
    mode:   1 post - 117 threads
    s:      3.4 posts
Message size: 1638.2 bytes
    - header:     709.1 bytes (13.9 lines)
    - body:       852.9 bytes (26.9 lines)
    - original:   603.8 bytes (20.3 lines)
    - signature:  75.1 bytes (1.6 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   81   130.7 ( 70.0/ 43.8/ 26.5)  Tom Phoenix <rootbeer@teleport.com>
   36    42.7 ( 26.6/ 16.0/  7.9)  joseph@5sigma.com
   27    40.5 ( 20.8/ 15.5/  8.2)  comdog@computerdog.com (brian d foy)
   26    39.1 ( 18.5/ 15.2/ 10.5)  mgjv@comdyn.com.au (Martien Verbruggen)
   25    39.4 ( 19.1/ 20.3/ 11.8)  Eli the Bearded <*@qz.to>
   19    26.8 ( 15.0/  8.4/  5.7)  tchrist@mox.perl.com (Tom Christiansen)
   19    26.4 ( 13.3/ 13.1/  7.7)  jdporter@min.net
   17    24.8 (  9.4/ 15.3/  9.6)  mjtg@cus.cam.ac.uk (M.J.T. Guy)
   14    27.5 (  8.4/ 19.1/ 11.6)  tadmc@flash.net (Tad McClellan)
   13    19.4 (  7.7/ 11.7/  7.8)  adelton@fi.muni.cz (Honza Pazdziora)

These posters accounted for 24.8% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 130.7 ( 70.0/ 43.8/ 26.5)     81  Tom Phoenix <rootbeer@teleport.com>
  42.7 ( 26.6/ 16.0/  7.9)     36  joseph@5sigma.com
  40.5 ( 20.8/ 15.5/  8.2)     27  comdog@computerdog.com (brian d foy)
  39.4 ( 19.1/ 20.3/ 11.8)     25  Eli the Bearded <*@qz.to>
  39.1 ( 18.5/ 15.2/ 10.5)     26  mgjv@comdyn.com.au (Martien Verbruggen)
  37.4 (  6.8/ 29.3/ 25.8)     12  clay@panix.com (Clay Irving)
  27.5 (  8.4/ 19.1/ 11.6)     14  tadmc@flash.net (Tad McClellan)
  26.8 ( 15.0/  8.4/  5.7)     19  tchrist@mox.perl.com (Tom Christiansen)
  26.4 ( 13.3/ 13.1/  7.7)     19  jdporter@min.net
  24.8 (  9.4/ 15.3/  9.6)     17  mjtg@cus.cam.ac.uk (M.J.T. Guy)

These posters accounted for 24.3% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

1.000  (  3.6 /  3.6)      5  igor <igor@iprint.com>
0.987  (  7.0 /  7.1)     12  bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
0.977  (  6.5 /  6.6)      6  pudge@pobox.com (Chris Nandor)
0.880  ( 25.8 / 29.3)     12  clay@panix.com (Clay Irving)
0.862  (  8.2 /  9.5)      8  mcravit@best.com (Matthew Cravit)
0.862  (  6.5 /  7.6)      8  Mark Hazen <mhazen@franklin.uga.edu>
0.801  (  5.1 /  6.4)      7  "Stephen Warren" <swarren@eclipse.net>
0.770  (  7.7 /  9.9)      7  aml@world.std.com (Andrew M. Langmead)
0.759  (  4.9 /  6.5)      5  mike@stok.co.uk (Mike Stok)
0.757  (  8.0 / 10.5)      5  Ricky <ric@megsinet.net>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.531  (  8.2 / 15.5)     27  comdog@computerdog.com (brian d foy)
0.526  (  1.5 /  2.9)      7  "Peter J. Acklam" <jacklam@ulrik.uio.no>
0.526  (  1.2 /  2.3)      6  chip@pobox.com
0.503  (  2.4 /  4.7)      5  "Mark S. Reibert" <reibert@mystech.com>
0.493  (  7.9 / 16.0)     36  joseph@5sigma.com
0.444  (  2.0 /  4.5)      5  ilya@math.ohio-state.edu (Ilya Zakharevich)
0.394  (  2.1 /  5.3)     10  rjk@coos.dartmouth.edu
0.374  (  0.7 /  2.0)      5  mbudash@sonic.net (Michael Budash)
0.361  (  1.1 /  3.0)      5  tobez@plab.ku.dk
0.356  (  1.6 /  4.6)      5  "Mark Morgan" <mgm@gxn.net>

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   20  Re: serious post about gmtime and year-1900 (was Re: Perl not Y2K compliant)
   16  Re: sending email (Net::SMTP).. problem
   16  Lexical scope and embedded subroutines.
   16  Re: Testing for valid RegExps?
   15  Re: file glob restrictions?!
   14  Re: Review of CGI/Perl book
   12  Simple string length
   12  Perl to EXE
   11  Re: PERL: How do I overwrite output?
   10  Re: File Format Query

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  36.3 ( 14.5/ 20.8/ 13.5)     16  Re: sending email (Net::SMTP).. problem
  35.3 ( 18.2/ 15.9/ 11.2)     20  Re: serious post about gmtime and year-1900 (was Re: Perl not Y2K compliant)
  30.1 ( 11.6/ 17.3/ 13.3)     14  Re: Review of CGI/Perl book
  29.3 ( 11.7/ 15.4/ 10.0)     16  Lexical scope and embedded subroutines.
  24.2 ( 12.2/ 10.2/  7.6)     16  Re: Testing for valid RegExps?
  22.3 ( 11.7/  8.8/  5.9)     15  Re: file glob restrictions?!
  21.3 (  1.1/ 20.1/ 20.0)      2  h2n perl script
  17.9 (  6.1/ 10.0/  7.4)      9  Re: Perl for Engineering purposes
  17.5 (  2.9/ 14.5/ 10.3)      5  A newbie is trying to use perl
  16.2 (  7.2/  8.2/  5.9)     10  Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP!

Top 10 Threads by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

1.000  (  7.5/   7.5)      3  How to Configure Perl with IIS 4.0
0.962  (  1.7/   1.8)      4  Re: Server error 500
0.948  (  1.1/   1.1)      3  Database File Manipulation?
0.925  (  3.5/   3.8)      3  Re: HELP ME How I can to compare two date 01/12/1997>=01/01/1997
0.918  (  8.2/   8.9)      7  Re: Would yo explain the Perl "pack" command to me?
0.915  (  5.6/   6.1)      7  Re: regex to escape {, } except in TeX commands
0.905  (  1.9/   2.1)      4  Sorting on the xth position in a ascii file.
0.884  (  0.5/   0.6)      3  Looking for perl
0.875  (  2.5/   2.9)      3  Problem with Getopt::Std
0.864  (  8.1/   9.3)      5  Re: Help with passing parameters in URL's please

Bottom 10 Threads by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.459  (  1.2 /  2.7)      5  Re: Markees
0.457  (  1.6 /  3.6)      4  52 character string to be broken...any suggestions?
0.454  (  1.6 /  3.4)      5  Can Perl talk smtp protocol under NT4?
0.452  (  4.2 /  9.4)      9  Re: Q: search matching "(" and ")"
0.452  (  0.7 /  1.5)      3  Re: Help im stuck
0.450  (  3.3 /  7.4)      6  Re: Running  a perl script in the background on Windows(95/NT)
0.429  (  1.7 /  3.9)      9  [Help] Capturing STDOUT under DOS ?
0.426  (  1.0 /  2.4)      3  Re: Perl editor needed
0.291  (  0.7 /  2.4)      3  Re: Help on C++ extension
0.257  (  0.7 /  2.7)      3  Re: Mailing binary file

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      44  alt.fan.e-t-b
      26  comp.lang.perl.modules
      16  comp.mail.misc
       8  comp.lang.perl
       5  alt.perl
       5  comp.infosystems.authoring.cgi
       3  fj.lang.perl
       3  microsoft.public.inetserver.iis
       3  comp.lang.smalltalk
       3  comp.infosystems.www.authoring.html

Top 10 Crossposters
===================

Articles  Address
--------  -------

      28  Eli the Bearded <*@qz.to>
       8  kaz@cafe.net
       8  Guillermo Schwarz <gschwarz@its.cl>
       5  catty <spam@spam.spam>
       5  Graham Barr <gbarr@ti.com>
       5  Tom Phoenix <rootbeer@teleport.com>
       4  "Simon Kemp" <skemp@best-people.co.uk>
       4  "Ade Peel" <adee@aspects.net>
       3  "Shawn M. Nelson" <anonymous@whatever.com>
       3  "Stephen Warren" <swarren@eclipse.net>


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

Date: Mon, 12 Jan 1998 14:56:09 GMT
From: john@5points.net (John Walker)
Subject: Subroutine arguements (newbie)
Message-Id: <34ba2d49.176384051@news.capital.net>

Excuse me if this is an obvious question...

I want to write a subroutine that accepts a single arguement. This
arguement would be the name of the file to operate on, and the name of
the variable which the subroutine returns. The returned variable is an
associative array.

To put it another way... I want to call 

&snarfffile(somefile);

which manipulates the file somefile and returns a value %somefile.
Getting the varible to be named %somefile is what's giving me fits.

Thanks in advance


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

Date: Mon, 12 Jan 1998 13:19:08 GMT
From: fpostma@xs4all.nl (frans postma)
Subject: Re: Telnet client written in perl
Message-Id: <34ba182d.18373579@hdxf08.telecom.ptt.nl>

On 8 Jan 1998 11:45:48 GMT, e9427662@stud2.tuwien.ac.at (Stefan Herz)
wrote:

>Hi There !
>
>I need a telnet client (for MS NT), which is written in perl.
>Does anboy know, where to find such a telnet client ?

Net::Telnet on a friendly CPAN near you
(www.perl.com/CPAN/)

>
>TIA Tom 



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

Date: Mon, 12 Jan 1998 11:05:52 -0500
From: Ameer Sulaiman <asulai@ctp.com>
Subject: Truncating/trim from start an open text file
Message-Id: <34BA3F60.CC@ctp.com>

I am trying to use Perl to trim an application log file. I need Perl to
trim from beginning and truncate() seems to work from the end of file.
The catch is that the file will be open by the application during the
operation and may get written to.

This is the logic that I am planning to use:

- Get log file size.
- Until size
	Read line, copy to archive file.
	Substitute line with null
- Close file

The hope is that I will only be deleting stuff that I have archived and
won't effect any new entries to the log file from the app. 

I have three question:
1. Is this safe? or how unsafe is this?
2. How do I make it safer?
3. Is there an equivalent to truncate that truncate from beginning of
file to specified size?


Thoughts, comments. Thanx in advance.

Ameer
asulai@ctp.com


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

Date: Mon, 12 Jan 1998 15:33:41 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Unpacking length-infor style data.
Message-Id: <34bc3632.24704496@news.tornado.be>

Tom Phoenix <rootbeer@teleport.com> wrote:

>    while (length $data) {
>	my $len = unpack "s", $data;
>	push @list, unpack "x2a$len", $data;
>	$data = substr($data, $len+2);
>    }

Be aware that, unless you only process files that are created on the
same type of computer, there is more than one way to store a short
integer in two bytes.

To be on the safe side, hardcode the endian-ness of the integer into
your unpack template: "v" for little-endian (aka "Vax" or "Intel"), and
"n" for big-endian (aka "network" "or Motorola" order).

	Bart.


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

Date: Mon, 12 Jan 1998 09:53:46 -0600
From: Ricky <ric@megsinet.net>
To: cberry@cinenet.net
Subject: Re: weird problem!
Message-Id: <34BA3C8A.645ABEEA@megsinet.net>

thanks a lot.  but actually,  i copied the script from memory in a bit
of a rush.  when i checked the original, it didn't have those syntax
errors.  the second script has not worked at times as well.  also, i've
been working remotely.  i have a windows 95 OS, and the only thing i do
right now is just upload my scripts to the server and pray that they
work.  i just bought Linux, so i will be partitioning my disk, in which
case i will be able to check it from the command line.  really though, i
didn't have those syntax errors before.  thanks.

ricky



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

Date: Mon, 12 Jan 1998 10:46:14 -0500
From: "Shade L. Jenifer" <sjenifer@isc.mds.lmco.com>
Subject: WHY DOES THIS FAIL?
Message-Id: <34BA3AC6.6907@isc.mds.lmco.com>

hello:

when I run this code:

$x = "yes";
($x eq "yes") ? $y = "YES\n" : $y = "NO\n";
print $y;

I expect(ed) "YES\n" to be written to STDOUT.  However,
"NO\n" appears.  Why is this?

Thanks,
Shade


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

Date: 12 Jan 1998 16:46:44 +0000
From: Richard Caley <rjc@liddell.cstr.ed.ac.uk>
Subject: Re: WHY DOES THIS FAIL?
Message-Id: <eyh7m85iqrv.fsf@liddell.cstr.ed.ac.uk>

In article <34BA3AC6.6907@isc.mds.lmco.com>, Shade L Jenifer (slj) writes:

slj> $x = "yes";
slj> ($x eq "yes") ? $y = "YES\n" : $y = "NO\n";
slj> print $y;

slj> I expect(ed) "YES\n" to be written to STDOUT.  However,
slj> "NO\n" appears.  Why is this?


I believe it its taking it to mean

	( ($x eq "yes") ? $y = "YES\n" : $y) = "NO\n";

because `='  has a low precidence.

Should be
	($x eq "yes") ? ($y = "YES\n") : ($y = "NO\n");

even better (at least to my eye)

	$y = ($x eq "yes") ? "YES\n" : "NO\n";
-- 
rjc@cstr.ed.ac.uk			_O_
					 |<



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

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 1621
**************************************

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