[9850] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3443 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 14 03:07:27 1998

Date: Fri, 14 Aug 98 00:00:45 -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           Fri, 14 Aug 1998     Volume: 8 Number: 3443

Today's topics:
    Re: "newgrp" in a Perl script (Joseph Bell)
    Re: $form_data{'$variable'} question <REPLY_TO_lastronin@earthlink.net>
    Re: 5.002 and 5.004 question <kperrier@blkbox.com>
    Re: <SELECT multiple...> only returns 1st value <REPLY_TO_lastronin@earthlink.net>
        Apache mod_rewrite, perl script problem <support@rosenet.net>
    Re: changing access (but not modify) timestamp (Super-User)
    Re: changing access (but not modify) timestamp (Super-User)
    Re: DBD::Oracle compile prob on Linux (Marti Rijken)
    Re: DBI, LD_LIBRARY_PATH, and the web <mpersico@erols.com>
        DOS Perl programming <joel@aracnet.com>
    Re: Execute a program then return to perl? (Martien Verbruggen)
    Re: File updating question <REPLY_TO_lastronin@earthlink.net>
    Re: File::Find, wanted(), and parameters <jdf@pobox.com>
    Re: File::Find, wanted(), and parameters (Andre L.)
        Forked CGI process won't terminate browser connection glen_a_smith@my-dejanews.com
    Re: freeware documentation (Nathan V. Patwardhan)
    Re: freeware documentation <tchrist@mox.perl.com>
    Re: How to append at the top of the logfile ? <terrence@cs.utexas.edu>
    Re: How to append at the top of the logfile ? <anton@urc.ac.ru>
    Re: How to append at the top of the logfile ? <tchrist@mox.perl.com>
    Re: How to append at the top of the logfile ? <anton@urc.ac.ru>
    Re: IE 4.01 and flush to STDOUT or nonparsed Headers (Super-User)
    Re: Line continue character (Mark-Jason Dominus)
    Re: Mailing List scrip . Help needed (Super-User)
    Re: Matts counter - suddenly stopped working (Abigail)
        more than one recipient when emailing with sendmail (Steve .)
    Re: NT redirect to file (Tye McQueen)
    Re: NT redirect to file (Ken Irving)
    Re: Opening a file as "+>>file" <jdf@pobox.com>
    Re: Perl in DOS or Win95... (Jim Weisgram)
    Re: search text in specific columns <swhatley@blkbox.com>
    Re: Win NT Formmail and opening temporary files (Ethan H. Poole)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 14 Aug 1998 02:36:09 GMT
From: jobell@bnr.ca (Joseph Bell)
Subject: Re: "newgrp" in a Perl script
Message-Id: <6r07qp$458@crchh14.us.nortel.com>

figured this one out:

write a ksh script that calls perl with the name of the file containing your
perl prog.  chmod +s the ksh script.
voila.

In article <Pine.GSO.4.02.9808110837580.10161-100000@user2.teleport.com>,
Tom Phoenix  <rootbeer@teleport.com> wrote:
>On 11 Aug 1998, Joseph Bell wrote:
>
>> i try (i dunno if this is supposed to work):
>> 
>> $) = 266;
>> print $)."\n";
>> 
>> 276 276
>> 
>> nothing changes...
>
>It's not supposed to work. :-)
>
>Your OS sets the rules about who can change to which groups. Of course,
>/bin/newgrp is set-uid to root. Maybe you'll need to make your program
>set-id? See perlsec. Hope this helps!
>
>-- 
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>


-- 
Joseph A. Bell (NOT Cindy Wierschem) jobell@nortel.com
Northern Telecom Wireless Technologies
GSM MSC Tools Development
No funny quotes here.


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

Date: Fri, 14 Aug 1998 01:22:48 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: $form_data{'$variable'} question
Message-Id: <6r0gur$eoj$1@holly.prod.itd.earthlink.net>


>>> for($i=1,$i<=$total,$i++) {      # $total is set earlier
>>>      $new_data = $form_data{'editcol$i'};


you need semicolons instead of commas. to avoid troubles with interpolating
inside a reference to a hash array, reset it to a new variable.

    for ($i=1' $i<=$total; $i++)
    {
        $editcol .= $i;    # this interpolates it and unjunkifies the next
expression
        $new_data = $form_data{$editcol};
    }

cheers,
ha quach
mailto:info@r-go.com


>--
>-- Harold Bamford
>   mailto:hbamford@lucent.com
>   (630)713-1351




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

Date: 13 Aug 1998 18:21:07 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: 5.002 and 5.004 question
Message-Id: <ysi3eb0lb8c.fsf@blkbox.com>

Eric Sheng <shenge@ece.ucdavis.edu> writes:

> Hi all,
> 
> 	I have made the following observation:
> 
> 	In PERL 5.002, if you don't define a variable i.e. $my_string and
> do an operation such as:
> 
> 	$my_string .= "\n";
> 
> you'll get an "use of uninitialize value message".
> 
> 	But in PERL 5.004, I don't get it.  Is this a correct explaination
> for the observation I made or is it something?
> 

In the first script (using 5.002) you have a use strict; line and in the
script useing 5.004 you don't.


Kent


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

Date: Fri, 14 Aug 1998 01:31:28 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: <SELECT multiple...> only returns 1st value
Message-Id: <6r0hf5$fue$1@holly.prod.itd.earthlink.net>


Tom Christiansen wrote in message <6qav3d$16b$1@csnews.cs.colorado.edu>...
>In comp.lang.perl.misc, someone wrote:
>:EEk!!!!
>:
>:Everyone yells about using CGI.pm. People overcomplicate things and force
>:the rest of us to be lazy. It's wonderful to NOT reinvent the wheel. Then
>:again, if you don't even know the basics of wheel-ism, you're not gonna
>:learn much.
>
>Guess what?  Your code is wrong.  Better go study CGI.pm some more.

yup. that was me. guess what? it works--all the time, every time. i suppose
the way i touted wheelism wasn't explicit. i merely aimed to express that
the poster requesting the help for getting all the values for a multiselect
rather than just the first value does not need something heavy such as
CGI.pm. the module is immensely heavy for the poster's purpose. if one just
wants to parse the query string, is it wise to load up CGI.pm when a few
lines of (working, yes) code will do? IMHO, the latter is preferable over
the former.

btw, here is the subroutine. tell me where i went wrong since in my wildest
dreams i will never have my name on a book:

sub read_query_string
{
   local ($buffer, @pairs, $pair, $name, $value, %FORM);
   $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
   if ($ENV{'REQUEST_METHOD'} eq "POST")
   {
      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
   }
   else
   {
      $buffer = $ENV{'QUERY_STRING'};
   }
   @pairs = split(/&/, $buffer);
   foreach $pair (@pairs)
   {
      ($name, $value) = split (/=/, $pair);
      $value=~ tr/+/ /;
      $value=~ s/%(..)/pack("C", hex($1))/eg;
      $FORM{$name} .= "\t" if $FORM{$name};        # tab delimits a
multiselect
      $FORM{$name} .= $value;
   }
   %FORM;
}

cheers,
ha quach
mailto:info@r-go.com



>
>--tom
>--
>You want it in one line?  Does it have to fit in 80 columns?   :-)
>                --Larry Wall in <7349@jpl-devvax.JPL.NASA.GOV>




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

Date: Thu, 13 Aug 1998 22:54:41 -0700
From: Rosenet Technical Support <support@rosenet.net>
Subject: Apache mod_rewrite, perl script problem
Message-Id: <35D3D121.4643@rosenet.net>

Hello all,

I have been searching and cannot seem to find the answer to this
problem.  I hope someone can help...

I have compiled Apache 1.3.1 with PHP, the proxy module and the rewrite
module on our BSDi box.  We are running perl5.00404.

I am using Apache's rewrite module to redirect spambots to a perl script
that gives 75-100 bogus e-mail addresses and links to four pages with
75-100 bogus e-mail addresses, etc, etc, etc, until the spam bot is
littered with thousands of bad e-mail addresses.

My problem is this...

When I go directly to the page (mailinglist.pl) the script runs properly
and the bogus e-mail addresses and links are generated the way they
should be.  When I use Apache's .htaccess file redirects, the perl
script also runs fine.  When I use the rewrite module, the browser is
taken to the proper address, but the script is shown in plain text.  I
have tried renaming the file mailinglist.cgi and verified that the
header info is correct.

If anyone can point me in the right direction, I would be very grateful.

Thanks...

Christopher Ostmo
a.k.a.  support@rosenet.net
Rosenet, Inc.

For a good time,
http://modems.rosenet.net/


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

Date: 14 Aug 1998 02:43:44 GMT
From: root@comdyn.com.au (Super-User)
Subject: Re: changing access (but not modify) timestamp
Message-Id: <6r0890$9ic$2@nswpull.telstra.net>

In article <Pine.SUN.3.96.980812011149.7358A-100000@physics10.berkeley.edu>,
	Luis Bernardo <luis@physics.berkeley.edu> writes:

> I know how to modify timestamps with utime($atime,$mtime,"file"). But what
> I would like to do is to change the access timestamp without changing the
> modify timestamp. There should be an easy way to do that. Is there?

access the file without modifying it.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 14 Aug 1998 02:45:20 GMT
From: root@comdyn.com.au (Super-User)
Subject: Re: changing access (but not modify) timestamp
Message-Id: <6r08c0$9ic$3@nswpull.telstra.net>

In article <Pine.SUN.3.96.980812011149.7358A-100000@physics10.berkeley.edu>,
	Luis Bernardo <luis@physics.berkeley.edu> writes:

> I know how to modify timestamps with utime($atime,$mtime,"file"). But what
> I would like to do is to change the access timestamp without changing the
> modify timestamp. There should be an easy way to do that. Is there?

Ignore my other post. You want to set the access time to something
which is not 'now', right?

get modification time with stat. use utime() with your access time,
and the modification time you just got from stat.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 14 Aug 1998 06:33:58 GMT
From: mrijken@natrix.gld.nl (Marti Rijken)
Subject: Re: DBD::Oracle compile prob on Linux
Message-Id: <6r0lmu$rh4$1@natrix.gld.nl>

Steve Maring  <smaring@gte-es.com> wrote:
>
>The Gods were kind.  I finally got SCO Oracle 7.3.2.2.0 running on my
>RedHat5.1 box successfully.  Perl v5.004_04 and DBI are also OK.
>However, when I try to make DBD::Oracle I get this:
>
>/usr/local/oracle7/lib/libclient.a: could not read symbols: File format
>not recognized

I have no personale experience with SCO Oracle on Linux (looking forward
to the announced native version...).  But since the Oracle library is an
SCO library, I suppose you would need an SCO loader to link it.
Eventually you would have to run the resulting binary under iBCS, so I
suspect even the perl binary would have to be made with a set of SCO
tools (cc, ld).  
-- 
   @..@    Marti Rijken <mrijken@prv.gelderland.nl>
  (`--')   private mail: mrijken@natrix.demon.nl
 ( >__< )  URL:  http://www.natrix.demon.nl/


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

Date: Thu, 13 Aug 1998 23:25:11 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
To: Garth C Sainio <gcs@swl.msd.ray.com>
Subject: Re: DBI, LD_LIBRARY_PATH, and the web
Message-Id: <35D3AE17.239832A6@erols.com>

How about getting your administrator to set the var in the system-wide
startup. Every account that accesses Ingress needs the LD_... anyway
right?

Garth C Sainio wrote:
> 
> Hi,
> 
>         I'm trying to develop a script that will interface with an Ingres
> database and display the results to a web page. All works fine as long
> as the script is being run from an account with the LD_LIBRARY_PATH
> environment variable set but the uid that runs cgi scripts does not have
> this set. Thus, I get the following error "install_driver(Ingres)
> failed: Can't load (bunch of meaningless pathnames)..." I have tried to
> set this environement variable in the script using
> $ENV{'LD_LIBRARY_PATH'}= but I still get the error in loading driver.
> When I run it from the command in an environment without LD_LIBRARY_PATH
> set the script fails, when I run the script and set the environment
> variable as described above it fails, the only way I can get it too work
> is too do a setenv LD_LIBRARY_PATH on the command line and then run the
> script. The problem with setting the variable in the script seems to be
> that the code called by the install_driver function in the DBI library
> does not seem to get the information about the value of the environment
> variable.
> 
> Does anyone have any suggestions on other things to try?
> 
> Thanks,
> 
> Garth

-- 
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're 
## supporting the program at 2AM


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

Date: Thu, 13 Aug 1998 23:48:35 -0700
From: "Joseph Look" <joel@aracnet.com>
Subject: DOS Perl programming
Message-Id: <6r0mpi$d50$1@spitting-spider.aracnet.com>

Is there any DOS Perl programmers out there?  I am running Perl 5 in DOS
6.2.
Everytime I run a Perl script. It will load the DOS/4GW extender
automatically.
Under a 386 machine, this will take some time to load the extender.  I have
a
DOS batch file that run a few Perl scripts, this is unbearable to load
this DOS/4GW so many times on a 386 machine.

I would like to know if it is possible to load
the DOS/4GW extender once and the Perl
scripts do not need to load it again and again.

Thanks!




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

Date: 14 Aug 1998 02:55:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Execute a program then return to perl?
Message-Id: <6r08v1$aha$1@nswpull.telstra.net>

In article <35D1507F.D62F739F@emw.ericsson.se>,
	Clas <qmwclka@emw.ericsson.se> writes:

> I use the exec method, but this doesn't seem to be right .
> Because after the exec command I come right to the shell... :-(

*sigh*

Have you actually read the documentation on exec? You really should.
If you plan to use a function, and you don't already know exactly what
it does, type:

# perldoc -f function

in this case:

# perldoc -f exec
=item exec LIST

The exec() function executes a system command I<AND NEVER RETURNS> -
use system() instead of exec() if you want it to return

Now. It looks as if the very first sentence of the documentation about
exec tells you exactly what you need to know.

Please, learn to use, and actually use, the documentation.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Fri, 14 Aug 1998 01:05:05 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: File updating question
Message-Id: <6r0ftj$cmc$1@holly.prod.itd.earthlink.net>


Ketan Patel wrote in message <35D36531.1D8061C4@mathworks.com>...
>Ha wrote:
>>
>> >If the second method is recommended, I'm not quite sure how to go line
>> >by line (as recommended earlier) and make changes without reading in the
>> >whole array in the beginning...
>>
>> didn't i post something to the effect? or is the clock on my computer
>> forboding an easter egg disaster?
>>
>
>Yes, you did post 'something to the effect'... I tried the following
>code, and I know there is some fundamental error, but I don't quite know
>what it is... I'm trying to edit one file instead of open A, write to B,
>rename B to A:

here is the deal. either a) slurp and rewrite to the same file or b) open
two at a time and rename the first. there's simply no way around it. below
is your original code...

>open(DATA,"+<$dataPath") || die "die!";
>flock DATA, 2;
>while(<DATA>) {
> @sitesArray = split(/\|/,$_);
> [do stuff to @sitesArray]
>}
>print DATA $_;  #This is not right... ??
>close(DATA);

no no no. as i mentioned in another post to someone esle, you CANNOT READ
AND WRITE AT THE SAME TIME IF YOU'RE GOING TO CHANGE THE SIZE OF THE FILE.
sorry for the shouting. perldocs is not stressing this enough. the only way
to do a valid +< is to keep the file size exactly the same. go back to my
first post and try the open read, open write, rename method. unless you're
making a byte-for-byte replacement (which takes a lot of forethought in the
original creation of the datafile) you should never use +<.

>
>I don't understand how to save (write to file) the changes I make when
>going line by line... When I used the read-in-the-whole-array method, I
>would just overwrite the whole file with the new array...

as i said, this method is fine. however, it would do you good to learn how
to read files line by line. give it a week, a month, and come back and see
if you're comfy with either style.

i might as well answer Tom Phoenix here.
I said:
> if you use flock 2, remember to flock 8 (unlock
> it) before closing FILE.

He said:
>No, you should simply close the file, and let perl take care of unlocking
>it. (That's what the original poster was doing, correctly.)

>     open(DATA, ">$datapath")
>         || print ("Son, it's not my fault.");
>     flock(DATA, 2);

>That's not a good way to cooperate with other processes. If another
>process were writing that file, you just clobbered it!

In all the documentation and examples I've seen, in the books, etc. i've
never come across this "perl will do it for you." IMHO, it never hurts to be
explicit. for example, while leaving out flock 8 *may* work on UNIX, it
doesn't work on dos-based systems. if you don't unlock, you can't do
anything with it such as renaming, deleting, opening, etc. trust me, i've
been through this before and have learned the error of my flocking ways.

cheers,
ha quach
mailto:info@r-go.com






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

Date: 13 Aug 1998 23:17:53 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: tfo@telalink.net (Thomas Frederick O'Connell)
Subject: Re: File::Find, wanted(), and parameters
Message-Id: <k94cgpse.fsf@mailhost.panix.com>

tfo@telalink.net (Thomas Frederick O'Connell) writes:

> what i would like to be able to do is pass wanted() the uid and gid for
> the chown function i would like to run on each encountered file.

You could construct a closure:

   use File::Find;
   sub make_wanted {
     my $foo = shift;
     sub {/$foo/ && print "$File::Find::name\n"}
   }
   find( make_wanted('(?i)big'), 'C:/perl' );

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Thu, 13 Aug 1998 23:34:41 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: File::Find, wanted(), and parameters
Message-Id: <alecler-1308982334410001@dialup-513.hip.cam.org>

In article <tfo-1308981455520001@jesus.telalink.net>, tfo@telalink.net
(Thomas Frederick O'Connell) wrote:

> okay, i have a question that i have not been able to answer myself and for
> which i have not yet seen an answer.
> 
> i would like to be able to have wanted(), the companion function to
> find(), take parameters. is this possible? for example, suppose i wanted
> to simulate the behavior of chown -R.
> 
> what i would like to be able to do is pass wanted() the uid and gid for
> the chown function i would like to run on each encountered file.
> 
> i.e.
> 
> find( \&wanted( $uid, $gid ), '/' );
> sub wanted {
>    my( $uid, $gid ) = @_;
>    chown( $uid, $gid, $_ );
> }


My solution would be :

   find sub { wanted($uid,$gid) }, '/';

Nothing wrong with that, I hope?

Andre


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

Date: Fri, 14 Aug 1998 06:42:22 GMT
From: glen_a_smith@my-dejanews.com
Subject: Forked CGI process won't terminate browser connection
Message-Id: <6r0m8e$ch2$1@nnrp1.dejanews.com>



Right-O Peoples!

I have a Perl CGI script in which I wish to invoke another program in the
background. Once that's all done, I'd like to terminate the CGI informing the
user that things are underway. Consider:


		if (fork() == 0) {
			exec("$bg_process_cmd");
		} else {
			print "Done. The task has been commenced\n";
			exit 0;
		}


What happens? Everything works fine *except* the browser seems to hang around
and wait for $bg_process_cmd to terminate. Ideas?

Glen.


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 14 Aug 1998 01:18:50 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: freeware documentation
Message-Id: <6r039q$p63@fridge.shore.net>

Sabre Taylor (nonspammers.start.after.this.period.hot_redox@hotmail.com) wrote:
: Not to start a holy war but...

Either you're new or a sadist or both.  :-)

--
Nate Patwardhan|root@localhost
"Fortunately, I prefer to believe that we're all really just trapped in a
P.K. Dick book laced with Lovecraft, and this awful Terror Out of Cambridge
shall by the light of day evaporate, leaving nothing but good intentions in
its stead." Tom Christiansen in <6k02ha$hq6$3@csnews.cs.colorado.edu>


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

Date: 13 Aug 1998 23:59:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: freeware documentation
Message-Id: <6qvukd$7e$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting denied to the miscreant address munger]

:I mention O'reilly because it seems posters here
:_expect_ others to have their books.
:
:Any thoughts on this subject?

Yes, my thought is that while some books certainly help, one should
never completely expect a Perl programmer to have any book but the
standard, free Perl book included with every distribution of Perl and
found preformatted at:

    hppt://www.remove.this.perl.com/no.perl.spam/newdocs.nospam/

You'll find that that has the complete perl book in HTML, postscript,
and text form.  Oh, and don't forget to despam the address.

--tom
-- 
    /* we have tried to make this normal case as abnormal as possible */
            --Larry Wall in cmd.c from the perl source code


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

Date: 13 Aug 1998 23:49:03 -0500
From: "Terrence S. Ma" <terrence@cs.utexas.edu>
Subject: Re: How to append at the top of the logfile ?
Message-Id: <6r0fjv$lkn$1@boater.cs.utexas.edu>

Tom Phoenix <rootbeer@teleport.com> wrote:
>On 13 Aug 1998, Terrence S. Ma wrote:

>The FAQ talks about this. Hope this helps!
>-- 
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/

I changed my script and it is now working perfectly.  Thanks.

-- 
Terrence Ma
terrence@cs.utexas.edu


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

Date: Fri, 14 Aug 1998 11:14:13 +0600
From: Anton Voronin <anton@urc.ac.ru>
Subject: Re: How to append at the top of the logfile ?
Message-Id: <35D3C7A5.D35097F6@urc.ac.ru>

Terrence S. Ma wrote:
> 
> open (LOG,">>$logfile") || die "Can't write to log file";
> print *something*;
> 
> This appends the latest hit at the end but I want to have the
> hit to be written at the top of the logfile.  Is there any easy way
> to do it or do I need to write the new hit in a new file and then
> merge the new and the old to get the result I want ? By the way,

Yes, there's no other way to do it. I don't think it's hard to implement if
time is not critical :)

Anton


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

Date: 13 Aug 1998 23:50:23 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to append at the top of the logfile ?
Message-Id: <6qvu3v$7e$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    "Terrence S. Ma" <terrence@cs.utexas.edu> writes:
:I am pretty new to perl so I hope that I am not asking a very 
:stupid question.  I have a perl script to log all the web hits 
:on my web page but I want to have the latest hit to be at the top 
:of the logfile instead of at the bottom. 

http://language.perl.com/newdocs/pod/perlfaq5.html#How_do_I_change_one_line_in_a_fi
-- 
"Bjarne Strousup was sharing a cubicle with me at the time he was creating
C++. That's part of the reason why I don't use it." --Rob Pike


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

Date: Fri, 14 Aug 1998 12:04:02 +0600
From: Anton Voronin <anton@urc.ac.ru>
Subject: Re: How to append at the top of the logfile ?
Message-Id: <35D3D351.B643903B@urc.ac.ru>

Anton Voronin wrote:
> 
> Yes, there's no other way to do it. I don't think it's hard to implement if
> time is not critical :)
> 

I'm sorry I was wrong, perl really seems to have means that hide this
operation and let you do this more simply - it's called "inplace editing". You
should assign backup file extension to $^I variable and then do something like 

while(<FILE>){
	s/a/b/;
	print FILE;
}

but in your case it will be very useful because you just need to insert a
line, so you'll write

print FILE $new_line;
while(<FILE>){
	print FILE;
}

- its almost like to rewrite the file by usual means.


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

Date: 14 Aug 1998 02:49:02 GMT
From: root@comdyn.com.au (Super-User)
Subject: Re: IE 4.01 and flush to STDOUT or nonparsed Headers
Message-Id: <6r08iu$9ic$4@nswpull.telstra.net>

In article <6qrjks$r6a$1@gatekeeeper.teledanmark.dk>,
	"Michael Skjxtt Kjfr" <mskk@tdk.dk> writes:

> Can anybody tell me why this doesn't work in IE 4.01 and why it works in
> Netscape????

If it works in one browser, but not in the other, then it is a problem
with either one of the browsers. it is not perl related. You should
ask questions like this in one of the groups that talk about your
browsers, server, or maybe even HTTP. Somewhere in
comp.infosystems.www.* probably.

> This is a rather urgent we need to get the script in production.

What is urgent for you might not be urgent for us. If it really that
urgent to you, you should have made sure to ask in the right place. I
do suppose you have searched dejanews and looked at some FAQ's about
your problem, right?

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 14 Aug 1998 01:55:22 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Line continue character
Message-Id: <6r0jga$id0$1@monet.op.net>


In article <6qsa79$lp5$1@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc, 
>    mjd@op.net (Mark-Jason Dominus) writes:
>:The difference is, whereas in most languages you have to put the line
>:continuation character in to get it to continue the line, in Perl you
>:have to *leave it out*.
>
>``Most languages''?   Perl, awk, C, C++, java, Pascal, Modula, ...

Serious answer:

I guess most of the languages that the original querent was familiar
with required a continuation character, or he wouldn't have asked that
question.

Joke answer:

You mean there are other languages besides FORTRAN?


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

Date: 14 Aug 1998 02:51:47 GMT
From: root@comdyn.com.au (Super-User)
Subject: Re: Mailing List scrip . Help needed
Message-Id: <6r08o3$9ic$5@nswpull.telstra.net>

In article <35D15371.98F3F48A@club-internet.fr>,
	frederic <fredjoua@club-internet.fr> writes:
> Il s'agit d'un message multivolet au format MIME.

Please don't do this. Usenet is a plaintext medium. There is no place
for vcards here.

> Could you recommend me a good mailing list script for :
> - a moderated list
> - that makes possible for the administrator to group sevral messages
> posted in only one message that will be dispatched to the members of the
> list.

For future reference:

This is not really the right place to ask for software. This group
talks about perl, and the perl programming language. Not about stuff
written in perl.

That said: Have a look at majordomo. You should be able to find
numerous references to it on the web. Start at yahoo.

> mailto:fjouanneau@tenderonline.com

Nope. Post here, read here.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 14 Aug 1998 03:43:27 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Matts counter - suddenly stopped working
Message-Id: <6r0bov$leq$2@client3.news.psi.net>

Alastair Taylor (alastair.taylor@cableinet.co.uk) wrote on MDCCCVIII
September MCMXCIII in <URL: news:35D37154.2C93D1FE@cableinet.co.uk>:
++ Hi,
++ I had a counter from MSA all working ok then suddenly it stopped showing
++ the hits on my web page,  Count.txt is being updated as is the
++ access_log.
++ 
++ It got to 180 ish then stopped - this is driving me mad


Finally a sensible program from Matt! A counter that doesn't move!



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")\n-> define ("foldoc", "perl")) [0] -> print'


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

Date: Fri, 14 Aug 1998 01:11:16 GMT
From: syarbrou@ais.net (Steve .)
Subject: more than one recipient when emailing with sendmail
Message-Id: <35d38e35.31989972@news.ais.net>

I am sending an attachment to an individual.  Everything works fine.
The recipient line is as follows:

print MAIL "To: person\@joe.net (The Name) \n";

If I want to add more than one recipient, how is that done, or do I
need to do a foreach loop to email each recipient?  Thanks.

Steve


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

Date: 13 Aug 1998 23:17:01 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: NT redirect to file
Message-Id: <6r0dnt$9oe@fumnix.metronet.com>

John Dwyer <jdwyer@verio.com> writes:
) 
) I'm using PerlWin32 on NT workstation 4.0 and am having a bit of a
) problem redirecting output to a file.

Despite what the ActiveState FAQ incorrectly states, you
can use the command pl2bat to construct a *.bat file that
_will_ cause file redirection to work.  Note that, since
this is now a *.bat file, if you call it from another
*.bat file, you have to say "call script args", not just
"script args".
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: Fri, 14 Aug 1998 07:58:17 GMT
From: jkirving@mosquitonet.com (Ken Irving)
Subject: Re: NT redirect to file
Message-Id: <35d3d199.47735349@news.mosquitonet.com>

On Thu, 13 Aug 1998 19:28:50 GMT, ncarey@harlequin.com (Nicholas
Carey) wrote:

>On 13 Aug 1998 14:51:13 GMT, John Dwyer <jdwyer@verio.com> wrote:
>
>> I'm using PerlWin32 on NT workstation 4.0 and am having a bit of a
>> problem redirecting output to a file.
>>
 ...
>To enable running perl scripts from the command line under NT (I'll
>only vouch for NT 4.0sp3), execute the following commands:
>
>  ftype PerlPgm=c:\perl\bin\MSWin32-x86\perl.exe "%1" %*
>  assoc .pl=PerlPgm
>
>that should about do it. (NOTE: the directory path specified is where
>perl is installed on my machine -- your mileage may vary.)
>
>Now try the following and it should give you *exactly* what you want:
>
>  processor.pl detail.txt > summary.txt
>
I've tried this in the past, got simple redirection to work, but then
it didn't work in a pipe.  I'd try again if the following actually
works:

   type detail.txt | processor.pl > summary.txt

-- Ken
jkirving@mosquitonet.com


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

Date: 13 Aug 1998 23:06:03 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: phil@ackltd.demon.co.uk (Phil Taylor)
Subject: Re: Opening a file as "+>>file"
Message-Id: <n298gqc4.fsf@mailhost.panix.com>

phil@ackltd.demon.co.uk (Phil Taylor) writes:

> 1) Open    (a file containing variable length records)
> 2) Lock
> 3) Get Entire Content
> 4) Massage Content
> 5) Write Entire Content back to file
> 6) Close file (releasing lock)

> What file  mode should I use to Open the file that will allow me to do
> the above? 

Have you seen perlfaq5, which contains several examples that are
directly pertinent to your question?  If so, and you're still having
troubles, do post an example of what ails you.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Fri, 14 Aug 1998 03:41:40 GMT
From: jweisgram@hotmail.com (Jim Weisgram)
Subject: Re: Perl in DOS or Win95...
Message-Id: <35ddb101.89208323@news.teleport.com>

"John m. Hurley" <johnhurley@erols.com> wrote:

>Hi,
>
>I'm a newbie to PERL programming and I was wondering of there is a way
>to test PERL programs on Win95 or DOS.  I feel I am getting the idea of
>the language but would like to try the in-book programs to learn it
>better as well as to privately modify them to "learn from my mistakes".
>My server doesn't allow me to use cgi on it's machine so I can't u/l the
>files to the server.  Any help would be greatly apperciated.
>
>    Thanks,
>        John

The most current versions of Win32 Perl run on Win 95. I use a text editor that
allows me to code and execute from the same session; there are lots of those
around.

However it sounds like you are also saying you want to test and run CGI
applications. If you want to do that, you will need to install some type of
Win95 web server. Such things are freely available also.
-- 
All opinions expressed are mine and not my employers (but they ought to be)
Jim Weisgram
Oregon Department of Transportation


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

Date: 14 Aug 1998 00:10:13 GMT
From: Steven Whatley <swhatley@blkbox.com>
Subject: Re: search text in specific columns
Message-Id: <903053408.897916@news.blkbox.com>

stevenba@carr.org wrote:
: Can anyone tell me if (and if so, how & where) to search a text file in
: specific columns? or search beginning in column X? Are there any existing
: tools to do this? Are there any such 'window'-like facilities?	(like samples
: I saw in 'widgets') after I installed Perl?

How about doing something that involves:

	cut -c10-80 file.txt | grep searchstring

Do a man on cut for more info.

Hope this helps,
Steven
-- 
                 _|_  |  _|_   "I am the way and the truth and the life.
                  | --|-- |     No one comes to the Father except through
Steven Whatley    |   |   |      me.  If you really knew me, you would
Houston, Texas        |           know my Father as well.  From now on,
swhatley@blkbox.com   |            you do know him and have seen him."
http://www.blkbox.com/~swhatley/        -- Jesus Christ (John 14:6-7 NIV)


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

Date: 14 Aug 1998 05:49:53 GMT
From: ehp@gte.net (Ethan H. Poole)
Subject: Re: Win NT Formmail and opening temporary files
Message-Id: <6r0j61$oj3$1@news-2.news.gte.net>

In article <35D34CF5.41B9@erols.com>, comeng@erols.com says...
>
>>
>I don't have the luxury of using the random file name because
>softmail.exe requires a SENDMAIL.INI file.  Maybe I'll try another
>mailer program (suggestions are welcomed). 

Well, I tried to help you out (on 2 different posts) via email, but 
unfortunately your provider's SMTP server does not like my return email address 
(<ehp@gte.net>), and just bounces the mail back to me.

<rant mode on>
I really wish ISP's would quit rejecting email simply because it was sent by an 
SMTP server behind a firewall, it really doesn't do a damn thing to curb spam.  
It just causes people like myself to waste valuable time trying to help people 
who will never receive the help because I simply don't feel like going to the 
trouble of retyping the whole thing and being forced to send it from aol or 
compuserve (which is even more likely to be rejected simply because of the 
domain name)!
</rant>

-- 
Ethan H. Poole            | Website Design and Hosting,
                          | CGI Programming (Perl & C)..
========Personal========= | ============================
* ehp @ gte . net *       | --Interact2Day--
http://home1.gte.net/ehp/ | http://www.interact2day.com/



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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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