[16790] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4202 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 1 18:05:34 2000

Date: Fri, 1 Sep 2000 15:05:19 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967845918-v9-i4202@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 1 Sep 2000     Volume: 9 Number: 4202

Today's topics:
        $LIST_SEPARATOR bug?? <sdmeisner@SPAMGUARDyahoo.com>
    Re: $LIST_SEPARATOR bug?? <uri@sysarch.com>
    Re: $LIST_SEPARATOR bug?? (Andrew Johnson)
    Re: $LIST_SEPARATOR bug?? <smerr612@mailandnews.com>
    Re: $LIST_SEPARATOR bug?? (Decklin Foster)
    Re: $LIST_SEPARATOR bug?? <lr@hpl.hp.com>
        Adding HTML to every page in a directory <stevet@thevision.net>
    Re: Error msg in PPM "search" (Bryce Pursley)
        RE: Help !!! (HPUX11+Oracle8+DBD) <dean_j_pompilio@yahoo.com>
        How do I make a client to talk to a telnet server? <lotsacoffee@visto.com>
        How do I use PERL EXPECT module ? <bala@excitecorp.com>
    Re: How long does flock take? (Richard J. Rauenzahn)
    Re: How long does flock take? (Craig Berry)
    Re: How long does flock take? <bart.lateur@skynet.be>
    Re: How long does flock take? (Ilya Zakharevich)
    Re: How long does flock take? <mischief@motion.net>
    Re: How to source a shell script from perl ? zagni@my-deja.com
        how to use HTTP::Cookies <dsa@dassda.com>
    Re: learning perl <bart.lateur@skynet.be>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 01 Sep 2000 18:51:59 GMT
From: "Sean Meisner" <sdmeisner@SPAMGUARDyahoo.com>
Subject: $LIST_SEPARATOR bug??
Message-Id: <jVSr5.54$9J1.23031@sapphire.mtt.net>

ActiveState docs for version 5.6.0.616 as installed on my Windows machine
say:

$LIST_SEPARATOR
$``
     This is like $, except that it applies to array and slice values
interpolated into a double-quoted string (or
     similar interpreted string). Default is a space. (Mnemonic: obvious, I
think.)


"man perlvar" on the Linux box with version 5.005_03 at work says:

$LIST_SEPARATOR

       $""""   This is like "$," except that it applies to array
               values interpolated into a double-quoted string
               (or similar interpreted string).  Default is a
               space.  (Mnemonic: obvious, I think.)



NEITHER of these lines will compile in a script I'm working on, on the Linux
box:

$"""" = '';

$`` = '';


Comments anyone?  I've got a workaround but I want to know what gives with
the lousy docs..

Cheers,
Sean







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

Date: Fri, 01 Sep 2000 19:10:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <x77l8wormk.fsf@home.sysarch.com>

>>>>> "SM" == Sean Meisner <sdmeisner@SPAMGUARDyahoo.com> writes:

  SM> ActiveState docs for version 5.6.0.616 as installed on my Windows
  SM> machine say:

  SM> $LIST_SEPARATOR
  SM> $``

hahahah!! stupid redmond moron quoting strikes again!

  SM> $LIST_SEPARATOR

  SM>        $""""   This is like "$," except that it applies to array

even dumber wacko typsetting mistakes. wow!!! how the hell did that get
published. from a single " to 4 of them!


  SM> Comments anyone?  I've got a workaround but I want to know what
  SM> gives with the lousy docs..

the docs are good. the idjits who ran formatters on them are dumb. or
just redmond thinks (wrongly as usual) that it knows better.

the variable is $"

try looking upthe docs on a unix platform or on the web from a reliable
site. also a good book like the camel or even the desktop reference are
worth keeping around at all times when you are hacking perl.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 01 Sep 2000 19:47:44 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <AJTr5.10710$a5.95970@news1.rdc1.mb.home.com>

In article <x77l8wormk.fsf@home.sysarch.com>,
 Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "SM" == Sean Meisner <sdmeisner@SPAMGUARDyahoo.com> writes:
[snip]
>   SM>        $""""   This is like "$," except that it applies to array
> 
> even dumber wacko typsetting mistakes. wow!!! how the hell did that get
> published. from a single " to 4 of them!
[snip]
 
> the docs are good. the idjits who ran formatters on them are dumb. or
> just redmond thinks (wrongly as usual) that it knows better.

Well, the 5.6.0 installation on my linux box has this:

=item $" 

in the raw perlvar.pod, and pod2text shows $" as well -- but both
'perldoc perlvar' and 'man perlvar' show it as $"" (I didn't check
pod2html) -- it seems formatting errors are not limited to redmond.

andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/
      Perl can certainly be used as a first computer language, but 
      it was really designed to be a *last* computer language.
          -- Larry Wall


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

Date: Fri, 01 Sep 2000 19:52:47 GMT
From: Steven Merritt <smerr612@mailandnews.com>
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <8op1e5$c42$1@nnrp1.deja.com>

In article <jVSr5.54$9J1.23031@sapphire.mtt.net>,
  "Sean Meisner" <sdmeisner@SPAMGUARDyahoo.com> wrote:
> ActiveState docs for version 5.6.0.616 as installed on my Windows
machine
> say:
>
> $LIST_SEPARATOR
> $``
>      This is like $, except that it applies to array and slice values
> interpolated into a double-quoted string (or
>      similar interpreted string). Default is a space. (Mnemonic:
obvious, I
> think.)

I don't have ActiveState docs, maybe someone else can tell you about
this one

> "man perlvar" on the Linux box with version 5.005_03 at work says:
>
> $LIST_SEPARATOR
>
>        $""""   This is like "$," except that it applies to array
>                values interpolated into a double-quoted string
>                (or similar interpreted string).  Default is a
>                space.  (Mnemonic: obvious, I think.)

This may be a problem with your copy of the docs, because both my
docs(running 5.00503) and the Camel 2nd ed say the list
seperator is $" that's DollarSignDoubleQuote  Not $"""" or
DollarSignDQDQDQDQ

> NEITHER of these lines will compile in a script I'm working on, on the
Linux
> box:
>
> $"""" = '';

Try $" = '';

> Comments anyone?  I've got a workaround but I want to know what gives
with
> the lousy docs..

Not sure exactly what would cause something like the mutation you're
seeing in your Linux docs.  I'd guess you're just mis-intrepreting what
the ActiveState docs say and thinking a double quote is two single
quotes. Most built-in variables are single characters $. $; $$ $@ etc,
and when they're not they're typically pretty discriptive like $ARGV

Steven
--
King of Casual Play
The One and Only Defender of Cards That Blow

My newsreader limits sigs to four lines, but I cleverly bypassed this by


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 01 Sep 2000 21:03:19 GMT
From: decklin+usenet@red-bean.com (Decklin Foster)
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <rQUr5.6553$CW2.70444@news1.rdc1.ct.home.com>

Andrew Johnson <andrew-johnson@home.com> writes:

> >   SM>        $""""   This is like "$," except that it applies to array
> 
> Well, the 5.6.0 installation on my linux box has this:
> 
> =item $" 
> 
> in the raw perlvar.pod, and pod2text shows $" as well -- but both
> 'perldoc perlvar' and 'man perlvar' show it as $"" (I didn't check
> pod2html) -- it seems formatting errors are not limited to redmond.

Yuck, I've got this too, and I suspect that groff is messing up
somewhere.

pod2man gives: (This is perl, version 5.005_03 built for i386-linux)

    .Ip "$\*(T"" 8

-Tlatin1 displays this as $"""". -TX100 displays $'' (two
close-quotes, not two apostrophes).

I don't know *roff very well. Can someone explain what the source is
supposed to mean?

-- 
There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)


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

Date: Fri, 1 Sep 2000 14:07:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: $LIST_SEPARATOR bug??
Message-Id: <MPG.1419ba89ebf2698a98ad15@nntp.hpl.hp.com>

In article <8op1e5$c42$1@nnrp1.deja.com> on Fri, 01 Sep 2000 19:52:47 
GMT, Steven Merritt <smerr612@mailandnews.com> says...

 ...

> Try $" = '';

I would prefer to use

      $" = "";

so the value assigned doesn't appear anything like one double-quote.

> > Comments anyone?  I've got a workaround but I want to know what gives
> > with the lousy docs..
> 
> Not sure exactly what would cause something like the mutation you're
> seeing in your Linux docs.  I'd guess you're just mis-intrepreting what
> the ActiveState docs say and thinking a double quote is two single
> quotes. Most built-in variables are single characters $. $; $$ $@ etc,
> and when they're not they're typically pretty discriptive like $ARGV

Overstatement.  There is a set of variables formed like $^T, which is 
the dollar sign plus two characters.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 01 Sep 2000 19:06:18 GMT
From: "Michael Turitzin" <stevet@thevision.net>
Subject: Adding HTML to every page in a directory
Message-Id: <K6Tr5.19$18.3407@news-west.eli.net>

Is there a way to add a HTML header to every page in a certain directory?
Like free hosting sites add a banner to the top of every page.





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

Date: Fri, 01 Sep 2000 19:50:42 GMT
From: hbpursle@duke-energy.com (Bryce Pursley)
Subject: Re: Error msg in PPM "search"
Message-Id: <39b2080c.16366423@news.infoave.net>

On Fri, 01 Sep 2000 17:10:48 GMT, jason <elephant@squirrelgroup.com>
wrote:

_________Cut____________
>
>alternatively .. you should be able to just go to line 494 of ppm.bat 
>and add a PPM:: in front of RepositorySummary so it looks like this
>
>  my %summary = PPM::RepositorySummary("location" => $loc);
________Cut_____________

I did try this but I got the same error.  This time it had PPM: in
front of the RepositorySummary piece.

Thanks though.  At least it was something to try.

Bryce


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

Date: Fri, 01 Sep 2000 18:40:58 GMT
From: Dean J. Pompilio <dean_j_pompilio@yahoo.com>
Subject: RE: Help !!! (HPUX11+Oracle8+DBD)
Message-Id: <8oot7m$6q1$1@nnrp1.deja.com>

Although I have not compiled DBD under HP-UX 11.00, I have not had any
problems compiling modules using the ANSI C compiler that is bundled
with most HP systems.  Maybe gcc is more picky?

Just a thought...

In article <8FA287280Merijn@192.0.1.90>,
  h.m.brand@hccnet.nl (H. Merijn Brand) wrote:
> ishulz@lycosmail.com wrote in <8olmtr$d46$1@nnrp1.deja.com>:
>
> >And again: is it possible to get it (HPUX11+Ora8+DBD) up and working?
>
> Yes.
>
> For finding symbols, I use this util (grep from defs.nm after
running):
> add your OS to %nm first
>
> --8<---
> #!/pro/bin/perl -w
>
> use strict;
>
> use IO::Handle;
>
> open DEF, ">defs.nm" or die "defs.nm: $!"; DEF->autoflush (1);
>
> open ALL, ">libs.nm" or die "libs.nm: $!"; ALL->autoflush (1);
>
> open LIB, ">libs.ar" or die "libs.ar: $!"; LIB->autoflush (1);
>
> print ALL "     Value   Name\n";
>
> print DEF "     Value   Name\n";
>
> print ALL "  ========== ", "=" x 66, "\n";
>
> print DEF "  ========== ", "=" x 66, "\n";
>
> my @L = ();
>
> findlibs (".");
>
> my %nm = (
>
>     aix     => "nm -B -x -p -h",
>
>     dec_osf => "nm -P -x -p",
>
>     hpux    => "nm -N -x -p",
>
>     );
>
> my ($l, $lib, $obj) = ("", "", "");
>
> foreach my $L (sort @L) {
>
>     $lib = $l = $L;
>
>     $obj = "";
>
>     print STDERR "\n$lib ...";
>
>     open NM, "$nm{$^O} $L |";
>
>     while (<NM>) {
>
> 	chomp;
>
> 	m/^\s*$/ and next;
>
> 	if (m/^(\S+.a)(\[\S+\]):$/) {
>
> 	    $lib = $1;
>
> 	    $obj = $2;
>
> 	    print LIB "$lib\[$obj\]\n";
>
> 	    $lib eq $l or print STDERR "\n$lib ...";
>
> 	    $l = $lib;
>
> 	    next;
>
> 	    }
>
> 	if (m/^(\S+.(?:sl|so|1)):$/) {
>
> 	    $lib = $1;
>
> 	    $obj = "";
>
> 	    print LIB "$lib (shared)\n";
>
> 	    $lib eq $l or print STDERR "\n$lib ...";
>
> 	    $l = $lib;
>
> 	    next;
>
> 	    }
>
> 	s/^0000000000/0x00000000/;
>
> 	s/^         -/0x00000000/;
>
> 	#print STDERR "$_\n";
>
> 	my ($val, $typ, $sym) = m/^(\S+)\s+(\S+)\s+(\S.*)/ or next;
>
> 	$val =~ tr/[a-f]/[A-F]/;
>
> 	$val =~ s/0x00000000([\dA-F])/0x$1/;
>
> 	my $s = sprintf "%s %10s %s%s:%s\n", $typ, $val, $lib, $obj,
$sym;
>
> 	print ALL $s;
>
> 	$typ eq "U" and next;
>
> 	print DEF $s;
>
> 	}
>
>     close NM;
>
>     }
>
> print STDERR "\n";
>
> close LIB;
>
> close ALL;
>
> close DEF;
>
> chmod 0666, "libs.nm", "defs.nm", "libs.ar";
>
> sub findlibs
>
> {
>
>     my $d = shift;
>
>     unless (opendir DIR, $d) {
>
> 	print "$d: Cannot open: $!\n";
>
> 	return;
>
> 	}
>
>     my @d = sort readdir DIR;
>
>     closedir DIR;
>
>     foreach (grep m/\.(sl|so|a)$/, @d) {
>
> 	# -l $_ or
>
> 	    push @L, "$d/$_";
>
> 	}
>
>     foreach $d (grep -d, @d) {
>
> 	$d =~ m/^\.+$/ and next;
>
> 	-l $d and next;
>
> 	findlibs ($d);
>
> 	}
>
>     } # findlibs
> -->8---
>
> --
> H.Merijn Brand
> using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2,
AIX 4.3,
>   DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-
Unify
> ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
> Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 01 Sep 2000 16:47:34 -0400
From: Rick <lotsacoffee@visto.com>
Subject: How do I make a client to talk to a telnet server?
Message-Id: <39B015E6.AFB562CF@visto.com>

$timeout = 0;
while (! $timeout) {
    $timeout = 1;
    $client = IO::Socket::INET->new(Reuse=>1, PeerAddr=>$host,
type=>SOCK_STREAM, Proto=>'tcp', PeerPort=>$port) or $timeout=0;
    sleep 2 if ! $timeout;
}
$select = new IO::Select($client);
$select->add($client);

$char = '';
$line = '';

WHILE_LINE: while (@reading = $select->can_read(1)){
  foreach $reading_handle(@reading){
     $reading_handle->autoflush(1);
     if ($reading_handle == $client){
         print "Client read\n\n";
         for(;;){
             if(sysread($reading_handle,$char,1)!=1){
                 die "End of file\n";
                 exit 0;
             }
             print "READING $reading_handle $client  char=$char\n";
             $line .= $char;
             if ($char eq "\$"){
                 last WHILE_LINE;
             }
             print "LINE = $line\n\n";
         }
     }
     print "FOREACH $reading_handle\n";
  }
}


print "LINE=$line READING_HANDLE=$reading_handle $client\n\n";



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

Date: Fri, 01 Sep 2000 19:53:24 GMT
From: Balakumar Jaganathan <bala@excitecorp.com>
Subject: How do I use PERL EXPECT module ?
Message-Id: <39B008F8.6FB89FF6@excitecorp.com>

Can someone give small example to connect to a server and create a file
and exit. Thanks



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

Date: 1 Sep 2000 18:00:37 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: How long does flock take?
Message-Id: <967831235.967897@hpvablab.cup.hp.com>


jason <elephant@squirrelgroup.com> writes:
>why not use Time::HiRes to put a *real* timestamp in there .. it's 
>standard in 5.6 - not sure about earlier perls so you might need to get 
>it from CPAN .. goes down to microseconds

This will probably be sufficient[1] -- but just for correctness sake,
what the OP probably really needs is a sequence number in his data model
in order to ensure a unique key.

If he'd like to use one, I suggest looking in the perl faq for the
section on web page counters.

The OP never really explained why duplicate timestamps were a problem --
so there might also be another solution within his implementation.

Rich
[1] Especially on a not-very-busy uni-processor box.
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Fri, 01 Sep 2000 18:49:30 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How long does flock take?
Message-Id: <sqvuhqu1c5d42@corp.supernews.com>

Richard J. Rauenzahn (nospam@hairball.cup.hp.com) wrote:
: This will probably be sufficient[1] -- but just for correctness sake,
: what the OP probably really needs is a sequence number in his data model
: in order to ensure a unique key.
: 
: If he'd like to use one, I suggest looking in the perl faq for the
: section on web page counters.

Or, if it's a true sequence number, simply pull the last record, increment
its sequence number, and use it for the new record.

: The OP never really explained why duplicate timestamps were a problem --
: so there might also be another solution within his implementation.

I think he's using the timestamp as a primary key-like unique identifier.

: [1] Especially on a not-very-busy uni-processor box.

Yeah, this is exactly the sort of thing that comes back to haunt you.
Designs that seem to work fine will suddenly fail when moved to faster
boxes, or when traffic increases, and by then it's a royal pain to re-
engineer the entire system to avoid the race condition(s) at the core of
the problem.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


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

Date: Fri, 01 Sep 2000 19:39:25 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How long does flock take?
Message-Id: <0b10rsstt3ai7bvvehfkimk9a86foivbn3@4ax.com>

Lincoln Marr wrote:

>However I have tried submitting forms on the web to the script with 2
>different workstations, and the file was edited and did contain 2 identical
>indexes. This I don't want.
>
>Is there any way to make opening a file, writing to it etc take longer than
>a second? Could I maybe use 'sleep'?

Yes, sleep(1) will at least wait until the time() has jumped to the next
second. I don't know if that's good enough. It limits you to 60 users
per minute, and they'll all have to be pretty patient. Anything above 30
is no longer practical.

Why not add the process ID ($$) to the identifier, release the lock but
still do sleep(1) to make sure that $$ isn't reused in the same second?

-- 
	Bart.


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

Date: 1 Sep 2000 20:03:45 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How long does flock take?
Message-Id: <8op231$du6$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to jason 
<elephant@squirrelgroup.com>],
who wrote in article <MPG.141a662c4ce87bcc989742@localhost>:
> why not use Time::HiRes to put a *real* timestamp in there .. it's 
> standard in 5.6 - not sure about earlier perls so you might need to get 
> it from CPAN .. goes down to microseconds

 ... which most probably mean nothing.  I would guess that on most
systems the *granularity* of HiRes is of order of 10ms...  There are
some exceptions, of course...

Ilya


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

Date: Fri, 1 Sep 2000 15:28:55 -0500
From: "Chris Stith" <mischief@motion.net>
Subject: Re: How long does flock take?
Message-Id: <sr04aaa7c5d106@corp.supernews.com>


"jason" <elephant@squirrelgroup.com> wrote in message
news:MPG.141a662c4ce87bcc989742@localhost...
> Lincoln Marr <lincolnmarr@nospam.europem01.nt.com> wrote ..
> >I'm using flock to lock my files which are pipe delimited flat text
files.
> >When a user adds a record to this file I use flock() in my script to make
> >sure nobody else can touch it at the same time. However the first field
of
> >my record in the database is an index given by time() - and naturally I
> >cannot have identical indexes. If it takes more than a second to lock the
> >file, erase the data, close it, open it again for writing (with another
> >lock) and print all the data to it, then i've got no problems.
>
> you've got a problem then .. if this took a second then we would all
> have the problem (with the language) .. so we're all glad it's you and
> not us *8^)
>
> why not use Time::HiRes to put a *real* timestamp in there .. it's
> standard in 5.6 - not sure about earlier perls so you might need to get
> it from CPAN .. goes down to microseconds

I would rather think that a hash of the data would be preferable as a unique
key. A CRC or an MD5 checksum might work better. Best of all, of course,
would be to serialize the field.

However, I have been known to do cheap tricks to get a non-guaranteed
probably unique index. The time plus a random number, the time plus the
first character of each of the next (n) fields, the time modulo any
guaranteed
numeric field, or maybe if the above scenario is found highly desirable,
check
the time against the last record entered and add one if necessary (which
would
require state be maintained between adds if the records are not simply added
in order).

Considering the nature of the project, I'd keep a separate file for
last-used
numbers. In this file, I'd have a line for each data file in the same
directory.
You could do this with lines of a format similar to this:

my.datafile.1 325
my.datafile.2 123
my.datafile.3 923

 ... and so on. Or if you wanted a little less overhead and wanted to waste
some
inodes, you could have a 'datafile' and 'datafile.num' which has a single
line in it,
which consists of either the last number used or the next number to be used.
Using
either file solution and either numbering method , you could serialize
simply by
reading the number, using it, adding one to it, and writing it back to the
file. (The
order could be a little different, depending. See above, where it says you
could
write out the last number used or the next number to be used.) This is very
similar
in nature to a simple sample of one of those loathsome web site hit
counters.

### why hit counters are loathsome
(For info on why hit counters are loathsome, see Eric S. Raymond's website
at
http://www.tuxedo.org/~esr  ... I won't give you the exact path to the page
because
1. I don't remember off the top of my head  2. It's just as easy for you to
click on the
sitemap link as it is for me  and 3. You'll be better off for having spent
more time on
Mr. Raymond's page, IMHO. At the risk of sounding like a suck-up, I think
ESR's
site has quite a bit to offer to most programmers, Perl or otherwise.)
###

If your program keeps running for several requests (for example, is not a
single-dispatch
CGI program) which it reads that it does, you could read the number in at
the beginning of
each run and write it out at the end (unless you're seriously afraid of
crashing in the middle
and therefore need the number updated in mass storage constantly).

Anyway, most of this has drifted away from anything specifically related to
Perl. There
are modules that could help with some of the things mentioned herein. Many
hideous
web page hit counters are written in Perl, so that'd be a good place to look
for simple
example code on serializing a value from an external file. (I didn't say
they were good for
absolutely nothing, did I?)

Chris Stith
mischief@motion.net  mischief@pikenet.net  mr_mischief1@hotmail.com
_pcu_@yahoo.com





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

Date: Fri, 01 Sep 2000 21:03:59 GMT
From: zagni@my-deja.com
Subject: Re: How to source a shell script from perl ?
Message-Id: <8op5jh$h7l$1@nnrp1.deja.com>

Thanks Andrew, I'll give it a try

In article
<Pine.LNX.4.21.0009010121270.28238-100000@hawk.ce.mediaone.net>,
  "Andrew N. McGuire " <anmcguire@ce.mediaone.net> wrote:
> On Fri, 1 Sep 2000, zagni@yahoo.com quoth:
>
> ~~ Date: Fri, 01 Sep 2000 01:51:49 GMT
> ~~ From: zagni@yahoo.com
> ~~ Newsgroups: comp.lang.perl.misc
> ~~ Subject: How to source a shell script from perl ?
> ~~
> ~~ I need to source a shell script from a perl program and make the
> ~~ variables visible to the program.
>
> I posted this one a while back, be aware though that you don't have
> to clobber %ENV.  You could dupe it, then compare to see which values
> to overwrite.
>
> #!/usr/bin/perl -w
> use strict;
>
> my $script = '/path/to/some/script';
> %ENV = (); # nukes entire %ENV (may not be wanted)
> my @shenv = `sh -c ". $script; /usr/bin/env"`;
> chomp @shenv;
> %ENV = map { split /=/ } @shenv;
>
> print map { "$_ => $ENV{$_}\n" } keys %ENV;
> __END__
>
> anm
> --
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
> ~ Andrew N. McGuire
~
> ~ anmcguire@ce.mediaone.net
~
> ~ "Plan to throw one away; you will, anyhow." - Frederick P. Brooks,
Jr. ~
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sat, 2 Sep 2000 02:27:23 +0800
From: DT <dsa@dassda.com>
Subject: how to use HTTP::Cookies
Message-Id: <MPG.141a75dd568cd7da989683@news.cyberway.com.sg>

How to use HTTP::Cookies and HTTP::Requestto read cookie from an URL 
request and set cookie to an URL?  thanks!


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

Date: Fri, 01 Sep 2000 19:42:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: learning perl
Message-Id: <jk10rssrc7dqjrb9i8qsm7247em1q3fib2@4ax.com>

Abigail wrote:

>// Where's is the best place to learn perl ?
>
>On a comfy chair.

Ooh, I would have thought, on the back of a camel. I don't know why.

And having a computer nearby, usually helps. It must be the radiation or
something...

-- 
	Bart.


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 4202
**************************************


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