[10783] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4384 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 8 21:07:43 1998

Date: Tue, 8 Dec 98 18:00:25 -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           Tue, 8 Dec 1998     Volume: 8 Number: 4384

Today's topics:
    Re: $|=0 <zenin@bawdycaste.org>
    Re: @INC newbie question (Brand Hilton)
        Better way to get values from a list? <karl_jensen@hp.com>
    Re: Better way to get values from a list? <due@murray.fordham.edu>
    Re: Better way to get values from a list? (Sean McAfee)
    Re: Better way to get values from a list? <uri@ibnets.com>
    Re: Better way to get values from a list? (Larry Rosler)
    Re: Better way to get values from a list? (Larry Rosler)
    Re: Better way to get values from a list? <due@murray.fordham.edu>
        Can someone tell me why .... <info@kn1.com>
    Re: Can someone tell me why .... (Martien Verbruggen)
    Re: Code Bash: File Include <dgris@moiraine.dimensional.com>
    Re: Errors with SETUID and Perl Script <due@murray.fordham.edu>
    Re: Errors with SETUID and Perl Script mike_orourke@em.fcnbd.com
    Re: flock doesn't flock under perl/linux <dgris@moiraine.dimensional.com>
    Re: flock doesn't flock under perl/linux <dgris@moiraine.dimensional.com>
    Re: Getting Perl Modules to work on ISPs that don't all dturley@pobox.com
    Re: Help!  Possible permissions problem? (Martien Verbruggen)
    Re: Hey look! Im an expert too (Nathan V. Patwardhan)
    Re: Hey look! Im an expert too (Nathan V. Patwardhan)
    Re: how do you put commas in a number? (j)
    Re: How to disallow fields to input puncuations excepts (GiLLY)
        log file analyzer - better way to do this? (j)
    Re: Newbie question (NJPin)
        please help.. <ng@usa.net>
    Re: please help.. (j)
    Re: Problem running Perl CGI's on NT in SuiteSpot dturley@pobox.com
        reg exp (Tri Tram)
    Re: reg exp (Martien Verbruggen)
    Re: Solaris 2.6 x86 miniperl compile error -SOLUTION (Darren Littlejohn)
        Spliting multiple databases. (Vikram Pant)
    Re: Spliting multiple databases. <metcher@spider.herston.uq.edu.au>
        Storing In Memory <chris@krisberg-haines.com>
    Re: Storing In Memory (Martien Verbruggen)
    Re: timelocal and localtime with negative values? (Larry Rosler)
        Win32::ODBC question (Darrell Ryan)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 09 Dec 1998 01:53:34 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: $|=0
Message-Id: <913168480.854687@thrush.omix.com>

Greg Ward <gward@thrak.cnri.reston.va.us> wrote:
: No, that's wrong.  $| = 1 sets your pipes to be piping hot, that is,
: makes it so the currently selected output handle is unbuffered.

	Incorrect.  It turns autoflush on, which isn't the same as
	unbuffered.  You're still buffered, you're just being automatically
	flushed after every write.  Use syswrite() and friends if you want
	real unbuffered writes, but be sure you know what you're doing first
	if you take this route.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 8 Dec 1998 23:42:48 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: @INC newbie question
Message-Id: <74kdho$as3@mercury.adc.com>

In article <366DA82B.736C8C8B@andrew.cmu.edu>,
Cathy Huang  <huang2@andrew.cmu.edu> wrote:
>This is on NT, perl v. 5.004_02.
>
>I get this error message:
>Can't locate name_decoders.pl in @INC (@INC contains: c:\perl\lib\site
>c:\perl.....) at D:/listen/data/scripts\sessionify2.pl line 14.

This is happening because the "use lib $dir" is executed at compile
time and your assignments to $dir or $dir2 don't happen until run time.
So, your "use lib" has no effect.  You'll have to put your assignments
inside a BEGIN block to have them happen at the right time, as
indicated in the changes to your code below.

Note, however, that @INC should already contain the current directory
("."), so it would appear that either name_decoders.pl is not in the
same directory as sessionify2.pl, or sessionify2.pl is not being
invoked from its home directory.

>This is the code in sessionify2.pl, ending in line 14:
>-------------------
>use Cwd;

BEGIN {

>$dir = cwd();
>print "sess2 dir = $dir\n";
>use lib $dir;
>#$dir2 = "d:\\listen\\data\\scripts\\";
>#use lib $dir2;

}

>
>require("name_decoders.pl");

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Tue, 08 Dec 1998 16:12:11 -0700
From: "Karl G. Jensen" <karl_jensen@hp.com>
Subject: Better way to get values from a list?
Message-Id: <366DB24B.EE889DFA@hp.com>

I'm looking for suggestions for a better way to code something.

I have an array with values in it of the form "a=b". The first entry in
the array is a string with no "=" which I don't want to propagate.

I want an array with values in it of the form "b".

Here's how I did it:

        foreach (@AB) {
                ($label, $field) = split('=');
                if ($field eq "") {
                        next;   # Skip lines not of the form "a=b"
                }
                push @B, $field;
        }

I expect that there is a way to do this in PERL with one line, without
having to interate through the first array. Can someone kindly show me
how?

		Thanks.


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

Date: 8 Dec 1998 23:46:19 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Better way to get values from a list?
Message-Id: <74kdob$h0l$0@206.165.167.221>

Karl G. Jensen wrote in message <366DB24B.EE889DFA@hp.com>...
>I'm looking for suggestions for a better way to code something.
>
>I have an array with values in it of the form "a=b". The first entry in
>the array is a string with no "=" which I don't want to propagate.
>
>I want an array with values in it of the form "b".
>
>Here's how I did it:
>
>        foreach (@AB) {
>                ($label, $field) = split('=');
>                if ($field eq "") {
>                        next;   # Skip lines not of the form "a=b"
>                }
>                push @B, $field;
>        }
>
>I expect that there is a way to do this in PERL with one line, without
>having to interate through the first array. Can someone kindly show me
>how?


ok, only have a sec 'cause dinner is almost ready.  Without seeing the data,
here is one quick (unthoughtful) way.

@array = qw(one two a=b c=d three e=f);
@b  = map {/=(.*)/} @array;
oops, got to go.  Dinner calls.

AmD
AmD




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

Date: Tue, 08 Dec 1998 23:55:27 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Better way to get values from a list?
Message-Id: <P%ib2.602$4w2.2943775@news.itd.umich.edu>

In article <366DB24B.EE889DFA@hp.com>,
Karl G. Jensen <karl_jensen@hp.com> wrote:
>I have an array with values in it of the form "a=b". The first entry in
>the array is a string with no "=" which I don't want to propagate.

>I want an array with values in it of the form "b".

>Here's how I did it:
[snip]

>I expect that there is a way to do this in PERL with one line, without
>having to interate through the first array.

With Perl, that's true of almost any task:

foreach (@a) { push @result, $1 if /=(.*)/ }

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: 08 Dec 1998 19:13:11 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Better way to get values from a list?
Message-Id: <39zp8yrx48.fsf@ibnets.com>

>>>>> "SM" == Sean McAfee <mcafee@waits.facilities.med.umich.edu> writes:

  SM> In article <366DB24B.EE889DFA@hp.com>, Karl G. Jensen
  SM> <karl_jensen@hp.com> wrote:

  >> I expect that there is a way to do this in PERL with one line,
  >> without having to interate through the first array.

  SM> With Perl, that's true of almost any task:

  SM> foreach (@a) { push @result, $1 if /=(.*)/ }

but you are explicitly iterating. AmD had a fine solution with map
(which loops too but can be faster than foreach; larry R will probably
bench this for us :-).

but since you have an array, there is no way to get at all the elements
without some form of loop.

a wacky way would be to join an m// out the values like this (tested):

	@results = join( "\n", @a ) =~ m/=(.+)$/mg ;

it's cute that the join result being the target of the m// works.

larry R, i wonder if the join, m// loops are faster than the other
solutions. wanna bench it?

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ibnets.com	


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

Date: Tue, 8 Dec 1998 16:18:27 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Better way to get values from a list?
Message-Id: <MPG.10d761b0ff8aef1a9898af@nntp.hpl.hp.com>

In article <P%ib2.602$4w2.2943775@news.itd.umich.edu> on Tue, 08 Dec 
1998 23:55:27 GMT, Sean McAfee <mcafee@waits.facilities.med.umich.edu> 
says...
> In article <366DB24B.EE889DFA@hp.com>,
> Karl G. Jensen <karl_jensen@hp.com> wrote:
> >I have an array with values in it of the form "a=b". The first entry in
> >the array is a string with no "=" which I don't want to propagate.
> 
> >I want an array with values in it of the form "b".
> [snip]
> 
> >I expect that there is a way to do this in PERL with one line, without
> >having to interate through the first array.
> 
> With Perl, that's true of almost any task:
> 
> foreach (@a) { push @result, $1 if /=(.*)/ }

Of course, that *does* iterate through the first array.  There's No Way 
To Do it without iteration, though one can hide it neatly inside a 
'map':

  @result = map /=(.*)/, @a;

I can't think of a way to do it in fewer characters.  Anyone???

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


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

Date: Tue, 8 Dec 1998 17:16:26 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Better way to get values from a list?
Message-Id: <MPG.10d76f419a1dc6889898b1@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <39zp8yrx48.fsf@ibnets.com> on 08 Dec 1998 19:13:11 -0500, 
Uri Guttman <uri@ibnets.com> says...
> >>>>> "SM" == Sean McAfee <mcafee@waits.facilities.med.umich.edu> writes:
 ... 
>   SM> foreach (@a) { push @result, $1 if /=(.*)/ }
> 
> but you are explicitly iterating. AmD had a fine solution with map
> (which loops too but can be faster than foreach; larry R will probably
> bench this for us :-).
> 
> but since you have an array, there is no way to get at all the elements
> without some form of loop.
> 
> a wacky way would be to join an m// out the values like this (tested):
> 
> 	@results = join( "\n", @a ) =~ m/=(.+)$/mg ;
> 
> it's cute that the join result being the target of the m// works.
> 
> larry R, i wonder if the join, m// loops are faster than the other
> solutions. wanna bench it?

Well, I wasn't gonna, because I was after the shortest record, not the
fastest (and I beat Allan M. Due by one character in syntax, not concept
:-).  But as you asked so nicely:

#!/usr/local/bin/perl -w
use Benchmark;

@a = qw(one two a=b c=d three e=f);

timethese ( (1 << (shift || 0) ), {
    Join => sub { @result = join( "\n", @a ) =~ m/=(.+)$/mg },
    Map  => sub { @result = map /=(.*)/, @a },
    Push => sub { foreach (@a) { push @result, $1 if /=(.*)/ } },
} );
__END__

ActiveState 5.005_02 (mine, all mine)
Benchmark: timing 65536 iterations of Join, Map, Push...
      Join:  3 wallclock secs ( 4.52 usr +  0.00 sys =  4.52 CPU)
       Map:  4 wallclock secs ( 5.03 usr +  0.00 sys =  5.03 CPU)
      Push:  9 wallclock secs ( 8.55 usr +  0.09 sys =  8.64 CPU)

HP-UX 10.20 5.004_03 (loaded)
Benchmark: timing 65536 iterations of Join, Map, Push...
      Join: 22 secs ( 7.78 usr  0.06 sys =  7.84 cpu)
       Map: 39 secs ( 9.53 usr  0.08 sys =  9.61 cpu)
      Push: 43 secs (12.08 usr  0.32 sys = 12.40 cpu)

So, although not the shortest by far, your imaginative monstrosity wins, 
Uri.  I, for one, am surprised!

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


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

Date: 9 Dec 1998 01:37:11 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Better way to get values from a list?
Message-Id: <74kk87$11d$0@206.165.167.221>

Larry Rosler wrote in message ...
>In article <P%ib2.602$4w2.2943775@news.itd.umich.edu> on Tue, 08 Dec
>1998 23:55:27 GMT, Sean McAfee <mcafee@waits.facilities.med.umich.edu>
>says...
>> In article <366DB24B.EE889DFA@hp.com>,
>> Karl G. Jensen <karl_jensen@hp.com> wrote:
>> >I have an array with values in it of the form "a=b". The first entry in
>> >the array is a string with no "=" which I don't want to propagate.
>> >I want an array with values in it of the form "b".
>> [snip]
>> >I expect that there is a way to do this in PERL with one line, without
>> >having to interate through the first array.
>> With Perl, that's true of almost any task:
>> foreach (@a) { push @result, $1 if /=(.*)/ }
>Of course, that *does* iterate through the first array.  There's No Way
>To Do it without iteration, though one can hide it neatly inside a
>'map':
>
>  @result = map /=(.*)/, @a;
>
>I can't think of a way to do it in fewer characters.  Anyone???


Jeez, you steal my code dropping two braces but adding a comma (check those
post times).  Well, ok, I will give you the benefit of the doubt that
newsgroups update at different intervals. ;-)  Hey, my solution already had
fewer chars!  Another:

@b = map /=(.*)/, @a;

hehe

AmD




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

Date: Wed, 9 Dec 1998 00:43:34 +0100
From: "Owen" <info@kn1.com>
Subject: Can someone tell me why ....
Message-Id: <74kdlj$luh$1@black.news.nacamar.net>

this script for a chat programm does not delete the message database when
the limit is reached. It does reset the counter to 0 but does not delete the
database
--------------------------------------
#!/usr/local/bin/perl

# Perl version 5.004 usage (See documentation.)
################################################
use 5.004;

# File locking mechanism. (See documentation.)
################################################
use Fcntl qw(:flock);



###########################################################################
# Simple Chat version 1.000 beta release 1
#
###########################################################################
# This program is released as freeware to the internet and computing
# community. The author of this program assumes no resposibility for its
# use or for any damage that may occur to the users data and or hardware
# as a result of running this program.  As this is the first release, there
# are bound to be bugs. You are free to use this program as long as this
# header remains intact and bears the authors name, program description,
# and history record.  If you modify this program, please include your
# modification in the history section of the header and submit a copy with
# your changes to the author.
#
###########################################################################
# Simple Chat is just that...a simplt program intended to serve as a chat
# room on your website.  To run Simple Char v1.0 you must have Perl
installed
# on your server.  Simple Chat has been tested on Perl ver 5.004 under both
# the UNIX Apache web server and Windows95 platforms. If you try running
# simple chat on another platform, please submit your results to the author.
# Simple Chat is easy to configure.  Follow the guidelines in the
INSTALL.TXT
# file included with the Simple Chat archive.
#
###########################################################################
# The authors website at http://wmcdirectmg.hypermart.net provides
# minimal support and offers forms for submitting bug reports, comments,
# and registering your copy with the author (FREE).
#
###########################################################################
# Future versions will have thier own license agreements and if applicable,
# prices.
#
# AUTHOR : Wesley M. Craft   wcraft@bellatlantic.net
#                            http://wmcdirectmg.hypermart.net
#
# HISTORY : May 7, 1998 - Initial building of version 1 beta 1 begins.
#
###########################################################################


# Variable Declarations : See the Documentation for specific settings.
###########################################################################

$bgc           = "BLACK";
$textc         = "WHITE";
$delay         =     2500;
$banner        = "<!--#echo banner=\"\"-->";
$banloc        = "TOP";
$limit         =       5;
$filename      =   "mesg.txt";
$defaultname   = "Verona Feldbusch";
$FormBGcolor   = "BLACK";
$FormTXTcolor  = "WHITE";
$cgipath       = "";
$cginame       = "simchat.cgi";
$cntrname      = "counter.txt";
$msgname       = "messages.htm";
$useJavaScript = "NO";




###########################################################################
# Everything below this line is based on the variables above.  Unless you #
# know what you are doing, you should not edit anything below.            #
###########################################################################




# Read the fields NAME and MESSAGE from the form submission
###########################################################################

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
        ($name, $value) = split(/=/, $pair);
        $value =~ tr/+/ /;
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $value =~ s/~!/ ~!/g;

        $FORM{$name} = $value;
}



# Dynamically display a new form.  If the user has spcified a name, it will
# be used, otherwise the value in $defaultname will be used.
###########################################################################

if ($cgilocation eq "")
{
        $cgilocation = $cginame;
}
else
{
        $cgilocation = $cgipath . "/" . $cginame;
}


if ($FORM{'name'} eq "")
{
        $nm = $defaultname;
}
else
{
        $nm = $FORM{'name'};
}



print "Content-type:text/html\n\n";
print <<ENDofHTML;

<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>

<BODY BGCOLOR="$FormBGcolor">

<FORM METHOD="POST" ACTION="$cgilocation">

<TABLE BORDER=0 CELLSPACING=1 WIDTH=121%>

        <TR>
                <TD WIDTH=15% ALIGN=RIGHT>
                        <FONT COLOR="$FormTXTcolor">
                        <STRONG>Your Name</STRONG>
                        </FONT>
                </TD>

                <TD WIDTH=105%>
                        <INPUT TYPE=TEXT NAME="name" SIZE=20 VALUE="$nm">
                </TD>

        </TR>

        <TR>
                <TD WIDTH=15% ALIGN=RIGHT>
                        <FONT COLOR="$FormTXTcolor">
                        <STRONG>Message</STRONG>
                        </FONT>
                </TD>

                <TD WIDHT=105%>
                        <INPUT TYPE=TEXT NAME="message" SIZE=50>
                </TD>

        </TR>

        <TR>
                <TD WIDTH=15% ALIGN=RIGHT>

                </TD>

                <TD WIDTH=105%>
                        <INPUT TYPE=submit VALUE="Send your message"
NAME=S1>
                </TD>

        </TR>

</TABLE>


</FORM>


ENDofHTML


if ($banner ne "")
{
        print
"<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>";
        print "$banner";
        print "</BODY></HTML>";
}
else
{
        print "</BODY></HTML>";
}





# Check the counter file to determine if we have reached the limit. If so,
# we will delete the message database and start a fresh one.
###########################################################################

open(cnter, "$cntrname");
flock(cnter, LOCK_EX);
read(cnter, $current, 2);

if ($current == $limit)
{
        unlink ("$filename");
        $current = 0;
}

close(cnter);





# Append the submitted message to the database with the users name.
###########################################################################


if ($FORM{'name'} eq "")
{
        $nm = $defaultname;
}
else
{
        $nm = $FORM{'name'};
}


open(MF, ">>$filename");
flock(MF, LOCK_EX);
print MF "$nm|$FORM{'message'}\n";

        ###########################
        # Update the counter file #
        ###########################

        open (cnter2, ">$cntrname");
        $current = $current + 1;
        print cnter2 "$current";
        close(cnter2);

close(MF);






# Create the message screen HTML that the users will be reading. This step
# includes reading from the database.
###########################################################################

open(OUT, ">$msgname");
flock(OUT, LOCK_EX);
print OUT "<HTML>\n";
print OUT "<HEAD>\n";


$local = $msgname;
# $scrolly = $current * 40;
if ($useJavaScript eq "YES")
{
        print OUT "<!-- JavaScript to force auto-reload every x
seconds -->\n";
        print OUT "<SCRIPT LANGUAGE=JavaScript>\n";
        print OUT "function TR\(\)\n";
        print OUT "{\n";
        # print OUT "window.scroll\(0, $scrolly\)\n";
        print OUT "setTimeout\('location.reload\(\)', $delay\);\n";
        print OUT "}\n";
        print OUT "</SCRIPT>\n";
        print OUT "</HEAD>\n\n";
        print OUT "<BODY BGCOLOR=\"$bgc\" onLoad=\"TR\(\)\">\n";
}
else
{
        $delay = $delay/1000;
        print OUT "<META HTTP-EQUIV=\"refresh\" CONTENT=\"$delay,
URL=\"$local\">\n";
        print OUT "</HEAD>\n\n";
        print OUT "<BODY BGCOLOR=\"$bgc\">\n";
}

print OUT "<FONT COLOR=\"$textc\">\n\n";



        ###############################
        # Print banner code if needed #
        ###############################

        if ($banloc eq "TOP")
        {
                print OUT "$banner\n";
        }



        ###############################
        # retrieve/print messages     #
        ###############################

        open (INF, $filename);
        @indata = <INF>;
        close (INF);

        foreach $i (@indata)
        {
                chop($i);
                ($sender,$phrase) = split(/\|/,$i);

                print OUT "<B>$sender: </B>";
                print OUT "$phrase<BR>\n";
        }

        print OUT "<A NAME=\"ENDOFMESSAGES\"></A>\n";


        ###############################
        # Print banner code if needed #
        ###############################

        if ($banloc eq "BOTTOM")
        {
                print OUT "<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>\n";
                print OUT "<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>\n";
                print OUT "$banner\n";
        }


print OUT "</BODY>\n";
print OUT "</HTML>\n";


close(OUT);

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

--
Regards and Greetings from
Owen

Website Design with an Attitude.....(You Pay, We Play)
ojm@salzbergen.net
www.salzbergen.net   www.shepton-mallet.net

- We won't promise you the world -
- But we will promise the world you -
- And it won't cost you the world -
- References - http://www.kn1.com/references.htm




--
Regards and Greetings from
Owen

Website Design with an Attitude.....(You Pay, We Play)
ojm@salzbergen.net
www.salzbergen.net   www.shepton-mallet.net

- We won't promise you the world -
- But we will promise the world you -
- And it won't cost you the world -
- References - http://www.kn1.com/references.htm





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

Date: Wed, 09 Dec 1998 01:46:39 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Can someone tell me why ....
Message-Id: <3Ekb2.82$tg4.316@nsw.nnrp.telstra.net>

In article <74kdlj$luh$1@black.news.nacamar.net>,
	"Owen" <info@kn1.com> writes:

> this script for a chat programm does not delete the message database
> when the limit is reached. It does reset the counter to 0 but does
> not delete the database

Solution: Fix it.

In other words: We are not here to write programs for you, or debug
complete scripts. Try to find the problem yourself. If you can't, hire
a programmer. 

If you can narrow things down to a little snippet of code that does
not do what you want, we'll have a look at that. Most of us have much
better things to do than to read and debug badly written code.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | 'I hate gramaticle errors!' 'Me to!'
NSW, Australia                      | 


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

Date: 08 Dec 1998 17:48:05 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Code Bash: File Include
Message-Id: <m3g1aqw37e.fsf@moiraine.dimensional.com>

Uri Guttman <uri@ibnets.com> writes:

> >>>>> "RS" == Randal Schwartz <merlyn@stonehenge.com> writes:
> 
> >>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:
>   Uri> so a challenge for you would be a one liner that would also exit
>   Uri> the @ARGV loop with an error message.
> 
>   RS> { local *ARGV; @ARGV = @list; die "cannot read one of these:
>   RS> @ARGV" if grep ! -r, @ARGV; print while <>; }
> 
> close but no cigar, randal. it still doesn't have the exact behavior of
> the original code. first the original didn't die, it just returned on
> the first failure and all the previous good files were printed.
<snip>

> please try again.

{ map { open __, $_ or (warn ("oops: $_ $!") && last); print <__> } @files }

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 8 Dec 1998 23:13:20 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: Errors with SETUID and Perl Script
Message-Id: <74kbqg$cbj$0@206.165.167.221>

mike_orourke@em.fcnbd.com wrote in message >>
[snip]
>  "Allan M. Due" <Allan@due.net> wrote:
>> Ow, ow, ow.  My head, my poor head hurts.  Just a little formatting
please.
>>
>> AmD
>>
>> Sorry.... Cut and paste didn't come out so clean
>
>Here is a better copy of the code :
>
>$old_path = $ENV{"PATH"} ; $directory = "/export/home/lddv" ; $filename =
>"test_chmod.txt" ; $file_owner = "lao7" ; if ($filename =~ /^([-\@\w.]+)$/)
{
> $filename = $1 ; } else {  die "Bad data in $filename" ; } if ($file_owner
>=~ /^([-\@\w.]+)$/) {  $file_owner = $1 ; } else {  die "Bad data in
>$file_owner" ; } if ($directory =~ /^([\/\-\@\w.]+)$/) {  $directory = $1 }
>else { die "Bad data in $directory" ; } $ENV{"PATH"} =
"/usr/sbin:/usr/bin";
>system("chown  $file_owner '$directory/$filename'") && die "Could not run
>CHMOD" ; $ENV{"PATH"} = $old_path ; exit ;


Sorry, but it looks just the same to me.  Maybe I need new glasses.

AmD




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

Date: Wed, 09 Dec 1998 01:00:27 GMT
From: mike_orourke@em.fcnbd.com
Subject: Re: Errors with SETUID and Perl Script
Message-Id: <74ki3b$sqj$1@nnrp1.dejanews.com>

In article <74k85g$k4t$1@nnrp1.dejanews.com>,
  mike_orourke@em.fcnbd.com wrote:
> In article <74juha$7lu$1@camel18.mindspring.com>,
>   "Allan M. Due" <Allan@due.net> wrote:
> > mike_orourke@em.fcnbd.com wrote in message
> > <74jtnh$ana$1@nnrp1.dejanews.com>...
> >
> > [snip]
> >
> > >Below is an example of the code that I am using :
> > >
> > >$old_path = $ENV{"PATH"} ; $directory = "/export/home/lddv" ; $filename =
> > >"test_chmod.txt" ; $file_owner = "lao7" ; if ($filename =~ /^([-\@\w.]+)$/)
> > {
> > > $filename = $1 ; } else {  die "Bad data in $filename" ; } if ($file_owner
> > >=~ /^([-\@\w.]+)$/) {  $file_owner = $1 ; } else {  die "Bad data in
> > >$file_owner" ; } if ($directory =~ /^([\/\-\@\w.]+)$/) {  $directory = $1 }
> > >else { die "Bad data in $directory" ; } $ENV{"PATH"} =
> > "/usr/sbin:/usr/bin";
> > >system("chown  $file_owner '$directory/$filename'") && die "Could not run
> > >CHMOD" ; $ENV{"PATH"} = $old_path ; exit ;
> >
> > Ow, ow, ow.  My head, my poor head hurts.  Just a little formatting please.
> >
> > AmD
> >
> > Sorry.... Cut and paste didn't come out so clean
>
> Here is a better copy of the code :
>
> $old_path = $ENV{"PATH"} ; $directory = "/export/home/lddv" ; $filename =
> "test_chmod.txt" ; $file_owner = "lao7" ; if ($filename =~ /^([-\@\w.]+)$/) {
>  $filename = $1 ; } else {  die "Bad data in $filename" ; } if ($file_owner
> =~ /^([-\@\w.]+)$/) {  $file_owner = $1 ; } else {  die "Bad data in
> $file_owner" ; } if ($directory =~ /^([\/\-\@\w.]+)$/) {  $directory = $1 }
> else {	die "Bad data in $directory" ; } $ENV{"PATH"} =
"/usr/sbin:/usr/bin";
> system("chown  $file_owner '$directory/$filename'") && die "Could not run
> CHMOD" ; $ENV{"PATH"} = $old_path ; exit ;
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>
Is it three strikes and your out ?

Let me try again.....

$old_path = $ENV{"PATH"} ;  > $directory = "/export/home/lddv" ;  > $filename
= "test_chmod.txt" ;  >  > $file_owner = "lao7" ;  > if ($filename =~
/^([-\@\w.]+)$/) {  >  $filename = $1 ;  > } else {  >	die "Bad data in
$filename" ;  > }  > if ($file_owner =~ /^([-\@\w.]+)$/) {  >  $file_owner =
$1 ;  > } else {  >  die "Bad data in $file_owner" ;  > }  > if ($directory
=~ /^([\/\-\@\w.]+)$/) {  >  $directory = $1  > } else {  >  die "Bad data in
$directory" ;  > }  > $ENV{"PATH"} = "/usr/sbin:/usr/bin";  > system("chown 
$file_owner '$directory/$filename'") && die "Could not run CHMOD" ;  >
$ENV{"PATH"} = $old_path ;  > exit ;  >

No listed is the code that reads in a seperate file with a list of directories
that can be modified ($directory). I also verify that $file_owner is a valid
user on the server (getpwnam).

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 08 Dec 1998 16:05:19 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: flock doesn't flock under perl/linux
Message-Id: <m3ogpew7yo.fsf@moiraine.dimensional.com>

Jon Snow <jwilkie@turing.une.edu.au> writes:

<snip flock()>

> flock(2) returns 0 if successful, -1 and errno set if not successful.

Not in perl, it doesn't.  In fact, very little in perl returns 
0 for successful, and I can't think of anything off the top
of my head that returns -1 for failure.

>From perlfunc (in this case TRUE is defined as 1 and FALSE is
0, not undef):

    flock FILEHANDLE,OPERATION

    Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns
    TRUE for success, FALSE on failure.

The actual problem was that the original poster had forgotten to
import his constants from Fcntl.pm (and was running without warnings
and diagnostics, always a bad thing when developing code). This made
flock() fail because he was using a bareword, rather than an integer,
as his second argument.

> On your linux box - man flock

I'd suggest man perl on your box.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 08 Dec 1998 16:17:14 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: flock doesn't flock under perl/linux
Message-Id: <m3k902w7et.fsf@moiraine.dimensional.com>

[ oops, I hate following up to myself ]

I <dgris@moiraine.dimensional.com> wrote:

>                           In fact, very little in perl returns 
> 0 for successful, and I can't think of anything off the top
> of my head that returns -1 for failure.

RTFM. :-)

perlfunc.pod says:

    In general, functions in Perl that serve as wrappers for system
    calls of the same name (like chown(2), fork(2), closedir(2), etc.)
    all return true when they succeed and C<undef> otherwise, as is
    usually mentioned in the descriptions below.  This is different
    from the C interfaces, which return C<-1> on failure.  Exceptions
    to this rule are C<wait()>, C<waitpid()>, and C<syscall()>.
    System calls also set the special C<$!> variable on failure.
    Other functions do not, except accidentally.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Wed, 09 Dec 1998 01:39:24 GMT
From: dturley@pobox.com
Subject: Re: Getting Perl Modules to work on ISPs that don't allow shell access
Message-Id: <74kkcc$unj$1@nnrp1.dejanews.com>

 Can the module be placed inside a directory and then
> just referenced from the script making use of it? I am using two ISPs,
> one is UNIX and one is WinNT. Thanks.

Depends on the module. Many you can just create the directory structure and
use lib to include them. What happened when you tried?

<opinion> If you are doing any kind of Perl development, you are wasting your
money with such an ISP. Get one that has shell access. Even if you aren't,
why pay for half service? An ISP that offers a shell costs no more than most
that don't. </opinion>

--
David Turley
dturley@pobox.com
http://www.binary.net/dturley/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 08 Dec 1998 23:32:57 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help!  Possible permissions problem?
Message-Id: <JGib2.59$tg4.227@nsw.nnrp.telstra.net>

In article <A6ib2.596$4w2.2912412@news.itd.umich.edu>,
	mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
> In article <UZhb2.51$tg4.255@nsw.nnrp.telstra.net>,
> Martien Verbruggen <mgjv@comdyn.com.au> wrote:

[something incorrect]

> Not enough arguments for mkdir at -e line 1, at end of line

Whoops.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | 
Commercial Dynamics Pty. Ltd.       | 'I hate gramaticle errors!' 'Me to!'
NSW, Australia                      | 


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

Date: Tue, 08 Dec 1998 23:16:06 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Hey look! Im an expert too
Message-Id: <Wqib2.4$J4.977@news.shore.net>

Uri Guttman (uri@sysarch.com) wrote:

: BTW aleck has 1 l. so you are a lousy speller too.

But at least he uses caps where appropriate.  :-)

--
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: Tue, 08 Dec 1998 23:17:47 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Hey look! Im an expert too
Message-Id: <vsib2.5$J4.977@news.shore.net>

S. Mart Alleck (smart@lleck.com) wrote:

: First, read the frickin' manuals you frickin bonehead.
: Second, don't ever post here if you expect a fickin' answer

U R 50 L33tZ!  How d8r fea9f334 af944444 90210?  666?  3.14?
dsaa494ta4!

: Hope this helps

Cheers!

--
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: Wed, 09 Dec 1998 01:29:24 GMT
From: mocat@best.com (j)
Subject: Re: how do you put commas in a number?
Message-Id: <366dd253.145712746@nntp.best.com>


Try using unpack.
(make sure to reverse the numbers, first)
hope this shed a bit of light.



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

Date: Tue, 08 Dec 1998 23:39:01 GMT
From: hklife@soback.kornet21.net (GiLLY)
Subject: Re: How to disallow fields to input puncuations excepts
Message-Id: <366db891.588945@news.snu.ac.kr>

On Tue, 8 Dec 1998 07:43:24 -0600, tadmc@metronet.com (Tad McClellan)
wrote:

>davidmaher@my-dejanews.com wrote:
>
>: > How to enable the hypens , a-z , 0-9 but disable blank space and other
>: > puncuations at the company??
>
>: Try something like this:
>
>
>   And then try something else...   ;-)
>
>
>:     if ($form{'company'} !~ /^[-A-z0-9]+$/) {

A-z -> A-Z

>:         print "Bad\n";
>:     }
>:     else {
>:         print "Good\n";
>:     }
>
>
>   $form{'company'} = 'ac[\]^_`xyz';  # above code prints 'Good' !!!

it'll work now.



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

Date: Wed, 09 Dec 1998 01:45:35 GMT
From: mocat@best.com (j)
Subject: log file analyzer - better way to do this?
Message-Id: <366ed535.146450549@nntp.best.com>


I'm writing a log file analyzer for the ISP I work for, not
so much for the company, but just for fun.
The log files can get up to 100 megs, and this makes for
a very slow and cpu/mem expensive analysis of the logs.
The way I am doing it right now is opening the file, reading
it line by line, and doing something with the data.  Then when
I have to do something else with the file, I open it up again,
read it from the beginning, and do whatever I need to
do with the data, and so on. 
Would there be a faster way to do this?
I've tried opening the file once, and for each line of the
file, running the 10+ sub routines on the data, but this
just resulted in an even slower script.

My question is... what would be the least expensive way
to do this?  Time wise, memory wise, and cpu wise.
Thank you for any help.



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

Date: 8 Dec 1998 23:02:43 GMT
From: njpin@aol.com (NJPin)
Subject: Re: Newbie question
Message-Id: <19981208180243.09623.00001620@ng-fu1.aol.com>

>
>Well one way might be to load your data into a hash of lists, where the hash
>keys are line numbers and your values contain lists of the data.
>
>
>#!/usr/local/bin/perl -w
>use strict;
>my (%data,$i);
>open(DATA,"foo.txt") or die "Lost and alone because $!";
>while (<DATA>) {
>    chomp;
>    $i++;
>    $data{"line$i"} = [split];
> }
>
>and then you can access each element like so:
>
>print $data{line1}[0];
>gives id
>
>and:
>print $data{line2}[3];
>gives 20
>
>

Thanks...this looks exactly like what I want!  I'll give it a shot.


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

Date: Tue, 8 Dec 1998 19:19:17 -0600
From: "Enrico Ng" <ng@usa.net>
Subject: please help..
Message-Id: <74kj8h$ofu$1@info3.fnal.gov>

I have been writing perl scripts for a few years but my knowledge is
limited.

I want to try to do two things.
1. check my email through the web.
I keep outlook express on all the time and was thinking that I can just look
at the inbox.mbx file, but eventhough i can see my messages, there is random
garbage inbetween the messages so there is no pattern.
I was thinking of look for a program that would download the messages into
text automatically for me but I couldnt find that either.

2. I want to browse the web through my web server.
many common sites (such as email services) are blocked out at work, so I was
wondering if there was a way i could make a perl form so I could type an
address in and go to a certain site.

--
Enrico Ng <ng@usa.net>
WVHS Internet
http://www.ipsd.org/wvhs





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

Date: Wed, 09 Dec 1998 01:47:36 GMT
From: mocat@best.com (j)
Subject: Re: please help..
Message-Id: <366fd691.146798870@nntp.best.com>

On Tue, 8 Dec 1998 19:19:17 -0600, "Enrico Ng" <ng@usa.net> wrote:

>2. I want to browse the web through my web server.
>many common sites (such as email services) are blocked out at work, so I was
>wondering if there was a way i could make a perl form so I could type an
>address in and go to a certain site.

try using a public proxy.  www.anonymizer.com is a decent one.


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

Date: Wed, 09 Dec 1998 01:31:58 GMT
From: dturley@pobox.com
Subject: Re: Problem running Perl CGI's on NT in SuiteSpot
Message-Id: <74kjuf$ubq$1@nnrp1.dejanews.com>

In article <366D667A.720981EA@DONTSPAMbear.com>,
  Bryan Duggan <bwduggan@DONTSPAMbear.com> wrote:

> I am running SuiteSpot on a NT machine and I want to evaluate some perl
> scripts for a web site.

Have you made sure you have added a handler for .pl in the Netscape admin
function? I can't remember exactly where it is, but it in the "wonderful"
(I'm being sarcastic here) Administrative setup screen for SuiteSpot. I don't
recall that the mime-type was set by default. -- David Turley
dturley@pobox.com http://www.binary.net/dturley/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 9 Dec 1998 00:56:35 GMT
From: tram@olympic.seas.ucla.edu (Tri Tram)
Subject: reg exp
Message-Id: <F3oAMC.FBH@seas.ucla.edu>


Hi there, I was just wondering how to do a regular expression?

I have read my mail file into a variable called $temp
So I have something like this:

$w = <STDIN>;
chomp($w);

if ($w =~ /$temp/)
{
  print "found\n";
}
else
{
  print "not found\n";
}

except that give me the error:

/: unmatched () in reg.

so I tried something like
if ($w =~ /$temp/mo)
but I still get the same error.  So I was wondering what am I doing wrong?
I think that the $temp has some special characters like (), [], $, and other
characters that could try to be extrapolated again.  So I was wondering
how to prevent that after the first one?  I thought /o would do it, but 
I guess not.


--
-----------------------------------------------------------------
Tri Tram, Computer Science and Engineering at UCLA
http://www.seas.ucla.edu/~tram


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

Date: Wed, 09 Dec 1998 01:51:05 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: reg exp
Message-Id: <dIkb2.86$tg4.316@nsw.nnrp.telstra.net>

In article <F3oAMC.FBH@seas.ucla.edu>,
	tram@olympic.seas.ucla.edu (Tri Tram) writes:

> if ($w =~ /$temp/)

> /: unmatched () in reg.

> I think that the $temp has some special characters like (), [], $, and other

You are right, very likely. Have a look at the quotemeta function, and
the associated \Q\E in the perlre man page.

# perldoc -f quotemeta
# perldoc perlre

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd.       | am.
NSW, Australia                      | 


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

Date: Tue, 08 Dec 1998 23:54:18 GMT
From: darrenl@cats.ucsc.edu (Darren Littlejohn)
Subject: Re: Solaris 2.6 x86 miniperl compile error -SOLUTION
Message-Id: <366dbbad.844304@news.ucsc.edu>

Thanks for this useful pointer. What I had to do to achieve the
solution was to add the paths ALL of the libraries on my system to the
Configure procedure, such that -lm and other command line compile
options were sniffed out by Configure and added to the defaults. 

Now on to the DBI...


On Tue, 08 Dec 1998 04:53:07 GMT, mgjv@comdyn.com.au (Martien
Verbruggen) wrote:

>In article <366c8b24.836062@news.ucsc.edu>,
>	darrenl@cats.ucsc.edu (Darren Littlejohn) writes:
>
>> gcc   -o miniperl miniperlmain.o libperl.a 
>> Undefined                       first referenced
>>  symbol                             in file
>> log                                 libperl.a(pp.o)
>
>You seem to not be linking in your math library. You'll need to tell
>gcc to link it in, with -lm.
>
>Martien
>-- 
>Martien Verbruggen                  | 
>Webmaster www.tradingpost.com.au    | 
>Commercial Dynamics Pty. Ltd.       | 'I hate gramaticle errors!' 'Me to!'
>NSW, Australia                      | 



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

Date: Tue, 8 Dec 1998 19:23:22 -0500
From: nospam@wam.umd.edu (Vikram Pant)
Subject: Spliting multiple databases.
Message-Id: <MPG.10d78d0713be4c909896aa@news.wam.umd.edu>


I doing a simple script that makes pages on the fly from three different 
txt files that contain information.

I have info.txt, pictures.txt and sounds.txt.  All three have different 
split delimiters (such as /t and |).

I am trying to make it easier and having just one txt file.  The problem 
is I am having problems doing multiple splitting.

I have a big text file like so (it's three smaller txt files put 
together) - (... breaks apart the three files)

Title	Heat
Dir	M. Mann 
 ...
1|deniro.wav|25KB
2|pacino.wav|45KB  
 ...
1|picture.jpg|picture_tn.jpg|150|100|25KB  
 ...

I was wondering how I can go about splitting it.
I have tried something like 
($Info, $Sounds, $Pics) = split(/.../, $TheInput, 3)

I have tried other versions, I just cannot split multiple txt files.  

Any help would be greatly apprieciated,
Vikram Pant


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

Date: Wed, 09 Dec 1998 11:02:53 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Spliting multiple databases.
Message-Id: <366DCC3D.CA79D7B3@spider.herston.uq.edu.au>

Check out the docs for $/ ($INPUT_RECORD_SEPARATOR) and <> (angle
operator).  I think you'll be pleased.

-- 
Jaime Metcher

Vikram Pant wrote:
> 
> I doing a simple script that makes pages on the fly from three different
> txt files that contain information.
> 
> I have info.txt, pictures.txt and sounds.txt.  All three have different
> split delimiters (such as /t and |).
> 
> I am trying to make it easier and having just one txt file.  The problem
> is I am having problems doing multiple splitting.
> 
> I have a big text file like so (it's three smaller txt files put
> together) - (... breaks apart the three files)
> 
> Title   Heat
> Dir     M. Mann
> ...
> 1|deniro.wav|25KB
> 2|pacino.wav|45KB
> ...
> 1|picture.jpg|picture_tn.jpg|150|100|25KB
> ...
> 
> I was wondering how I can go about splitting it.
> I have tried something like
> ($Info, $Sounds, $Pics) = split(/.../, $TheInput, 3)
> 
> I have tried other versions, I just cannot split multiple txt files.
> 
> Any help would be greatly apprieciated,
> Vikram Pant


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

Date: Tue, 08 Dec 1998 19:11:15 -0600
From: Chris Haines <chris@krisberg-haines.com>
Subject: Storing In Memory
Message-Id: <366DCE33.1860EF49@krisberg-haines.com>

I am trying to figure out how I can store a variable or array in my
system memory.  I know this can be done but my book doesn't address
that.  Please help.

Thanks.



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

Date: Wed, 09 Dec 1998 01:48:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Storing In Memory
Message-Id: <cGkb2.84$tg4.316@nsw.nnrp.telstra.net>

In article <366DCE33.1860EF49@krisberg-haines.com>,
	Chris Haines <chris@krisberg-haines.com> writes:
> I am trying to figure out how I can store a variable or array in my
> system memory.  I know this can be done but my book doesn't address
> that.  Please help.

$var = 12;
@array = (1, 2, 3);

It's now stored in memory. 

If you want something else, please be more specific. Tell us what you
want to do, and why, and we may be able to tell you how.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: Tue, 8 Dec 1998 16:48:08 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: timelocal and localtime with negative values?
Message-Id: <MPG.10d768a7e56034009898b0@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <366d4367.8399618@news.mediaways.net> on Tue, 08 Dec 1998 
15:21:19 GMT, Andreas Schildbach <andreas.schildbach@rkdnet.de> says...
> I want to express dates before 1.1.1970 with the usual time() based
> "data types". Someone told me that timelocal and localtime deals with
> negative numbers to express these dates, but this isn't the case with
> my perl version (5.005_02 build on Win32-x86).
> 
> Is there any truth to the above?

This seems to depend on the implementation of the C run-time library.

With the version of perl you mention, the domain of gmtime is 0 to the 
largest *signed* integer, (1 << 31) - 1, which is in 2038.  Arguments 
with the high-order bit set generated an "uninitialized variable" error.

With the version on HP-UX 10.20, the domain of gmtime is -(1 << 31) -- 
which is in 1901 -- to the number above.  This is true even if perl 
thinks the argument is a large unsigned integer, 0x80000000.  The 
library function is treating time_t as a signed int, when by rights it 
should be unsigned.

So this is Yet Another Y2038 bug.  I must admit that I don't much care. 
:-)

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


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

Date: Wed, 09 Dec 1998 01:38:03 GMT
From: ryand@efni.com (Darrell Ryan)
Subject: Win32::ODBC question
Message-Id: <366dd360.87395401@news.efni.com>

I am having trouble reading a text file into a .mdb (MS Access)

This code works but involves single entry:
$O->Sql("INSERT INTO grp (Group, Desc, Type) VALUES ('Admin',
'Administrators', 'Global');");

I want to use variables inside of a WHILE statement to do this:
$O->Sql("INSERT INTO grp (Group, Desc, Type) VALUES ('$Gname',
'$Desc', '$Type');");

My DSN is created fine and I can write using the first method
perfectly.

Any suggestions?


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

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

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