[14027] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1437 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 19 18:19:03 1999

Date: Fri, 19 Nov 1999 15:15:28 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943053328-v9-i1437@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 19 Nov 1999     Volume: 9 Number: 1437

Today's topics:
    Re: my database <kbandes@home.com>
    Re: OO question (Greg Bacon)
    Re: Perl programming sytle <gellyfish@gellyfish.com>
        Ping under Win NT without ICMP <andreas.wahlert@gmx.de>
    Re: Please Help ~~~~~~~ (Kragen Sitaker)
        Plotting data. (Abigail)
    Re: Problem regarding PerlScript on IIS <gellyfish@gellyfish.com>
        Problems with saving a file <hornes@rpi.edu>
    Re: Problems with saving a file (Kragen Sitaker)
    Re: Problems with saving a file <gellyfish@gellyfish.com>
        Putting CGI Bulletin Board in a Table chrism725@my-deja.com
    Re: Putting CGI Bulletin Board in a Table <gellyfish@gellyfish.com>
    Re: Putting CGI Bulletin Board in a Table (Kragen Sitaker)
        Question about Class::Struct <knetter@nortelnetworks.com>
        recruiter spam was [Re: Programming Language Comparison lee.lindley@bigfoot.com
    Re: REgarding the "x-httpd-cgi" <gellyfish@gellyfish.com>
    Re: Setting Environment variables from a perl script <bradw@newbridge.com>
    Re: Setting Environment variables from a perl script <uri@sysarch.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Nov 1999 17:05:18 -0500
From: Kenneth Bandes <kbandes@home.com>
Subject: Re: my database
Message-Id: <3835C99E.5F28CC92@home.com>

Cure wrote:
> i have a database that allow me to delete a user and the code works but
> it doesnt make sense to me, basically what im saying  is that i d/l this
> cgi and i dont see how this code could delete a user out of the
> database. could soembody explain it to me  or give me a better code
> 
> {
> open(LIST,"$logfile" || &error('Could not open log file.'));
> @logs = <LIST>;
> close(LIST);
> foreach $i (@logs) {
>         chop($i);
>         ($username,$name,$email,$pwd) = split(/\|/,$i);
>         if($FORM{'user'} eq $username && $FORM{'passwd'} eq $pwd) {
> open(LIST,">$logfile" || &error('Could not open log file.'));
> foreach $i (@logs) {
>         @userd = split(/\|/,$i);
>         unless($userd[0] eq $FORM{'user'}) {
>                 print LIST "$i\n";
> }
> }
> close(LIST);
> }

Well, this looks a bit garbled to me, what with unmatched braces
and random indentation, but what it seems to be doing is rewriting the
"database" (which is just a flat file), minus the user specified by 
the form (that's the "unless" bit).

I have no doubt that the problems with this script are legion - one 
that's obvious from this shard is that it doesn't lock the file.

I'm going to recommend that you get a good book on Perl so you can 
learn how to read this sort of thing.  "Learning Perl" is the usual 
one.  A new book by Andrew Johnson has gotten some favorable notices 
on this list: 
http://www.browsebooks.com/Johnson/
but I haven't seen it myself.

Then look into the CGI.pm module.  Consider picking up the "Official 
Guide to Programming with CGI.pm" by Lincoln Stein (who wrote the 
module) which is quite clear and has lots of examples.

Try also comp.infosystems.www.authoring.cgi.  That's where CGI gets 
discussed.  This group is about writing Perl programs, rather than 
getting them.

Ken Bandes


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

Date: 19 Nov 1999 22:42:47 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: OO question
Message-Id: <814jp7$gph$1@info2.uah.edu>

In article <80vo98$45h$1@towncrier.cc.monash.edu.au>,
	damian@cs.monash.edu.au (Damian Conway) writes:

: 	# LOCATE METHODS POLYMORPHICALLY...
: 	    my $mycall1 = $self->can('mycall1');
: 	    my $mycall2 = $self->can('mycall2');
: 
: 	# CALL METHODS NON-POLYMORPHICALLY (VIA REFERENCE)...
: 	    $mycall1->($self,$arg1);
: 	    $mycall2->($self,$arg2);

Wouldn't

    $self->$mycall1($arg1);

be preferable because of its advantage in the area of visual cues?

Greg
-- 
Science is what we understand well enough to explain to a computer.
Art is everything else.
    -- Donald Knuth


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

Date: 19 Nov 1999 23:22:33 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl programming sytle
Message-Id: <814m3p$6c7$1@gellyfish.btinternet.com>

On 18 Nov 1999 23:01:15 -0500 Robert Kiesling wrote:
>
> And "hand krufted?"  How many Perl contributors have backgrounds in
> humanities or social sciences, vis-a-vis the traditional sciences that
> are associated with programming?  I was just wondering about that.
> 

Well of course that is another issue altogether - I started off as a 
scientist then diverted into literature - I started my working career
making TV adverts for gods sake ... now look at me ;-}

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 21:24:21 +0100
From: 1789820 <andreas.wahlert@gmx.de>
Subject: Ping under Win NT without ICMP
Message-Id: <3835B1F5.7DF1811B@gmx.de>

Hi,

i have a Perl 5 Problem with a ping without ICMP. The script must mutual
Ping 2 Win NT Servers. Now I'm looking for a Way to find out that the
Servers are alive without "ping". The Net::Ping Module don't work. There
is a Message "alarm Function not available" and i can't install another
Modules because my administrator don't allow this. "net use" also don't
work because I'm not logged in.

Any Idea?

With kind regards


Andreas from Germany


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

Date: Fri, 19 Nov 1999 21:08:12 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Please Help ~~~~~~~
Message-Id: <0%iZ3.28721$YI2.1332597@typ11.nn.bcandid.com>

In article <8141vg$lla2@imsp212.netvigator.com>, Bobo <bobo@bobo.com> wrote:
>How to write the perl script to get and display the no. of hits of many links 
>within a web page?

split each line of your server access log and accumulate results in a
hash.  Or do you mean hits on pages you linked to, but don't own?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 19 Nov 1999 15:41:46 -0600
From: abigail@delanet.com (Abigail)
Subject: Plotting data.
Message-Id: <slrn83bh74.l1a.abigail@alexandra.delanet.com>


For those of you participating in distributed.net RC5-64 challenge,
here's a little program to plot the progress of the various team
members of a team.


#!/opt/perl/bin/perl -w

use strict;
use LWP::Simple;
use Date::Calc qw /Add_Delta_Days/;
use Getopt::Long;

GetOptions ("id=i"         =>  \my $id,
            "directory=s"  =>  \my $dir,
            "file=s"       =>  \my $file,
            "plot=s"       =>  \my $plot,
);


# Check for options, fill in defaults.
die "No or illegal id value\n" unless defined $id && $id !~ /\D/;
# Yeah, so, you can't have a directory or a file called 0.
# Add ?? to Perl, and you can. ;-)
$dir      ||= '.';
$file     ||= 'people.png';
$plot     ||= '/usr/local/bin/gnuplot';


# URL templates.
my $server  = 'http://stats.distributed.net';
# Add '&source=y' if you only want people contributing yesterday.
my $begin   = "$server/rc5-64/tmember.php3?team=$id";
my $history = "$server/rc5-64/phistory.php3?id";


# Get the team submission list of yesterday.
my $text    = get $begin or die "Failed to get $begin\n";


# Get the team name.
my ($name)  = $text =~ m{<H1><CENTER>.*</CENTER></H1>};
$name = "Team #$id" unless defined $name;


# Our list of participants.
my @participants;


# Daily amounts of the participants, indexed on id.
my %amounts;


# For each participants, get the id, name, and total blocks submitted
# for the team.
while ($text =~
       /<a\s+href="psummary\.php3\?id=(\d+)"><font\s+color="\#\w+">
        ([^<]+).*\n.*\n.*\n\s+<td.+<td.+<td\D+([\d,]+).+<td/xg) {
   (my $total = $3) =~ y/,//d;
    push @participants => [$1, $2, $total];
}


# Initialization of extremes.
my $fdate = "9999/99/99";
my $ldate = "0000/00/00";
my $max   =  0;


# Map month names to month numbers.
my %M = do {my $i;
            map {$_ => ++ $i} qw /Jan Feb Mar Apr May Jun
                                  Jul Aug Sep Oct Nov Dec/};

foreach my $participant (@participants) {
    my ($id, $name, $total) = @$participant;

    # Get the submission history of a participant.
    my $text = get "$history=$id" or die "Failed to get $history=$id\n";

    my @list;

    # Parse the text for date and blocks on that date.
    while ($text =~
          m{<td>(\d{1,2})-(\w{3})-(\d{4})</td>\s+<td align="right">([,\d]+)}g) {
        my ($year, $month, $day, $amount) = ($3, $M {$2}, $1, $4);
        $amount =~ y/,//d;
        push @list => [$year, $month, $day, $amount];
    }

    # Sort the entries. It should already be reverse sorted, but we
    # don't want to count on it.
    # The sorting time is dwarved by the fetch time, so don't bother
    # with fancy preprocessing.
    $amounts {$id} = [sort {$a -> [0] <=> $b -> [0] ||
                            $a -> [1] <=> $b -> [1] ||
                            $a -> [2] <=> $b -> [2]} @list];


    # Insert 0's for days not submitted.
    my ($cy, $cm, $cd) = @{$amounts {$id} -> [0]} [0, 1, 2];
    my @tmp = shift @{$amounts {$id}};
    while (@{$amounts {$id}}) {
       ($cy, $cm, $cd) = Add_Delta_Days ($cy, $cm, $cd, 1);
        while ($cy != $amounts {$id} -> [0] -> [0] ||
               $cm != $amounts {$id} -> [0] -> [1] ||
               $cd != $amounts {$id} -> [0] -> [2]) {
            push @tmp => [$cy, $cm, $cd => 0];
           ($cy, $cm, $cd) = Add_Delta_Days ($cy, $cm, $cd, 1);
        }
        push @tmp => shift @{$amounts {$id}};
    }

    # Map the date fields into a string.
    $amounts {$id} = [map {[sprintf ("%04d/%02d/%02d" => @$_ [0, 1, 2]) =>
                            $_ -> [3]]} @tmp];
            
    # Sum to get totals.
    foreach my $j (1 .. @{$amounts {$id}} - 1) {
        $amounts {$id} -> [$j] -> [1] += $amounts {$id} -> [$j - 1] -> [1]
    }

    # Now, if $total is less than the total, we need to subtract.
    # This happens if a participant has submitted blocks before joining
    # the team, and never retired the blocks to the team.
    # We could still have someone who first joins a team, then leaves,
    # submits blocks, then joins again. Alas, we can't get that information.
    my $diff = $amounts {$id} -> [-1] -> [1] - $total;

    # $diff shouldn't be < 0....
    if ($diff > 0) {
        foreach my $entry (@{$amounts {$id}}) {
            $entry -> [1] -= $diff;
        }

        # If the amount is zero or less, no submitted blocks belong to
        # the team.
        $amounts {$id} = [grep {$_ -> [1] > 0} @{$amounts {$id}}];
    }

    # Keep track of the extremes.
    $max   = $amounts {$id} -> [-1] -> [1] if
             $max   <  $amounts {$id} -> [-1] -> [1];
    $fdate = $amounts {$id} -> [ 0] -> [0] if
             $fdate gt $amounts {$id} -> [ 0] -> [0];
    $ldate = $amounts {$id} -> [-1] -> [0] if
             $ldate lt $amounts {$id} -> [-1] -> [0];
}

# Reverse sort the participants on total number of blocks submitted.
# This makes the legenda order match the left endpoints of the graph
# when viewed vertically; which is important since the PNG driver only
# uses a limited number of colours.
@participants = sort {$amounts {$b -> [0]} -> [-1] -> [1] <=>
                      $amounts {$a -> [0]} -> [-1] -> [1]} @participants;

# Round the max to a "round" number.
$max = 100_000 * (1 + int ($max / 100_000));

local *PLOT;
open   PLOT, "| $plot" or die $!;

$" = ",\\\n";
print PLOT <<EOT;

# Driver.
set terminal  png small color

# Output file.
set output   "$dir/$file"

# Title for the graph.
set title    "People submitting blocks for $name on $ldate"

# We have dates on the x-axis.
set xdata     time

# Formats for the tics.
set format x "%d/%m/%y"
set format y "%.0f"

# Labels.
set ylabel   "Blocks"

# How the grid looks like.
set grid      xtics ytics

# Format of dates in the data.
set timefmt  "%Y/%m/%d"

# First the ranges, than the plots.
# Play with the ranges to "zoom" in in interesting areas.
plot ["$fdate":"$ldate"] [0:$max] \\
@{[map {"'-' using 1:2 smooth unique title '$_->[1]'"} @participants]}
EOT

# Data for each participant.
$" = " ";
foreach my $participant (@participants) {
    print PLOT map {"@$_\n"} @{$amounts {$participant -> [0]}};
    print PLOT "e\n";
}

close PLOT or die $!;


__END__



Abigail
-- 


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 19 Nov 1999 22:52:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problem regarding PerlScript on IIS
Message-Id: <814kb7$6bl$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 17:57:10 +1100 Kiyo Kelvin Lee wrote:
> On my machine running IIS 4.0 and ActiveState PerlScript build 522, I found
> that PerlScript only functions on the Default Web Site bound to the default
> IP address. For other virtual site bound to other IP address, PerlScript
> inside an HTML page is simply ignored by the browser.
> Is there anybody has the same problem and knows the solution?

This is a question about the server configuration and not about Perl.

[Followups set]

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 13:35:36 -0500
From: "Stephen Horne" <hornes@rpi.edu>
Subject: Problems with saving a file
Message-Id: <8144be$19j4$1@newsfeeds.rpi.edu>

Hi --

I was wondering if anyone can help me out with a problem I've been having.

I'm trying to save a list of players in a web-based game, but the list
continually is getting corrupted. When people access the game simultaneously
it will only save half of the list sometimes, despite the fact that I have
added in file locking.

sub SavePList{
 open(PLIST,">ff/playerlist");
 flock(PLIST, 2) || IllegalRefresh("PlayerList cannot be flocked - $!");
 foreach(keys(%person)){ print PLIST
"$person{cleanupname($_)}:$points{cleanupname($_)}\n";}
 flock(PLIST, 8) || IllegalRefresh("PlayerList cannot be unflocked - $!");
 close(PLIST);
}

sub LoadPList{
 open(PLIST,"ff/playerlist") || IllegalRefresh("LoadPList: Playerlist cannot
be opened - $!");
 flock(PLIST, 2) || IllegalRefresh("LoadPList: PlayerList cannot be
flocked - $!");
 @plist=<PLIST>;
 flock(PLIST, 8) || lllegalRefresh("LoadPList: PlayerList cannot be
unflocked - $!");
 close(PLIST);
 foreach(@plist){
  chomp($_);
  ($tname, $tscore)=split(/:/, $_);
  $person{cleanupname($tname)}=$tname;
  $points{cleanupname($tname)}=$tscore;
 }
}

So I tried doing it with a DBM, DB_FILE. Since I knew nearly nothing about
how DBM's work, I read up on them, but I still am shaky. This is what I came
up with:

sub NewSavePList{
   tie %idx, "DB_File", "playerindex", O_RDWR|O_CREAT, 0640, $DB_HASH
        or IllegalRefresh("Can't write to database: $!");
 $playerlist=join(",", keys(%person)); # I'm aware that it doesn't save the
score yet, i'll add it later
 $idx{"playerlist"}=$playerlist;
 untie %idx;
}

sub NewLoadPList{
 tie %idx, "DB_File", "playerindex", O_RDWR, 0640, $DB_HASH or
IllegalRefresh("Can't write to database: $!");
 @plist=split(",", $idx{"playerlist"});
 foreach(@plist){
  chomp($_);
  ($tname, $tscore)=split(/:/, $_);
  $person{cleanupname($tname)}=$tname;
  $points{cleanupname($tname)}=$tscore;
 }
 untie %idx;
}

The result was that each time someone saves or loads the playerlist, the
database nearly doubles in size. I don't understand this phenomenon. Is it
for some reason appending my database each time? I couldn't find this in
documentation anywhere.

What can I do to get either set of routines to work??? Thanks in advance

-- Stephen Horne






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

Date: Fri, 19 Nov 1999 22:52:51 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Problems with saving a file
Message-Id: <7xkZ3.28972$YI2.1348239@typ11.nn.bcandid.com>

In article <8144be$19j4$1@newsfeeds.rpi.edu>,
Stephen Horne <hornes@rpi.edu> wrote:
>[file gets half-saved on simultaneous access]
>
>sub SavePList{
> open(PLIST,">ff/playerlist");
> flock(PLIST, 2) || IllegalRefresh("PlayerList cannot be flocked - $!");
> foreach(keys(%person)){ print PLIST
>"$person{cleanupname($_)}:$points{cleanupname($_)}\n";}
> flock(PLIST, 8) || IllegalRefresh("PlayerList cannot be unflocked - $!");
> close(PLIST);
>}

PLIST is buffered.  It's likely that the last BUFSIZ bytes of data
won't be written to the file until you close() it.  Solution: remove
the unlock.  The file will be automatically unlocked on close.

Oh, and you might want to check the close return value and the print
return value, in case the disk gets full.

> @plist=<PLIST>;
> flock(PLIST, 8) || lllegalRefresh("LoadPList: PlayerList cannot be
>unflocked - $!");

Here the unlock shouldn't cause any trouble, but it is still unnecessary.

>So I tried doing it with a DBM, DB_FILE. Since I knew nearly nothing about
>how DBM's work, I read up on them, but I still am shaky. This is what I came
>up with:

DB_File has some problems with flock at the moment.  You'd be better
off with a plain text file.

>The result was that each time someone saves or loads the playerlist, the
>database nearly doubles in size. I don't understand this phenomenon. Is it
>for some reason appending my database each time? I couldn't find this in
>documentation anywhere.

Hmm, dunno about that, but I didn't read the code carefully.


-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 19 Nov 1999 22:44:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problems with saving a file
Message-Id: <814jtb$6bc$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 13:35:36 -0500 Stephen Horne wrote:
> Hi --
> 
> I was wondering if anyone can help me out with a problem I've been having.
> 
> I'm trying to save a list of players in a web-based game, but the list
> continually is getting corrupted. When people access the game simultaneously
> it will only save half of the list sometimes, despite the fact that I have
> added in file locking.
> 
> sub SavePList{
>  open(PLIST,">ff/playerlist");

You have failed to check the success of this.

>  flock(PLIST, 2) || IllegalRefresh("PlayerList cannot be flocked - $!");
>  foreach(keys(%person)){ print PLIST
> "$person{cleanupname($_)}:$points{cleanupname($_)}\n";}
>  flock(PLIST, 8) || IllegalRefresh("PlayerList cannot be unflocked - $!");

You dont need to unlock like this as close will do it.

>  close(PLIST);
> }
> 

And likewise for the other subroutine.

The bigger problem is that if you are going to do things like this then
you will want to maintain the lock between opening the file reading it
processing the data and writing it back out again.  You will want to
open the file for read/write without clobbering the file before you have
the lock, flock it, read the data, process the data, truncate the file to
0 bytes, write the processed data out to the file, close the file - simple
if you want some example code post what you have tried in this thread and
we'll have a look.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 19:09:10 GMT
From: chrism725@my-deja.com
Subject: Putting CGI Bulletin Board in a Table
Message-Id: <81478h$3pc$1@nnrp1.deja.com>

Hi,
This is my first post to the group. I've just finished a perl CGI course
and am new at this, and in need of some help!

I created a bulletin board that works just fine. I then decided to
spruce it up by putting it in a table so that the BB entries would be
off to the the right a bit, because I wanted to add a background image
in the left margin.

Now, all new BB entries are posted just under and outside of my table. I
have the proper code inside the table cell (at least as far as I can
tell.) I can't figure out why this is happening. My BB is set up so that
the form is at the top, and all new BB entries appear just under the
form. So I have the table tags just under the form.

I am using the html comment tag "<!-- BEGINNING -->" to indicate where
new BB entries should appear. Here is the HTML code:
(THANKS! for any suggestions!)

<html>

<!-- new bulletin board with form at top -->


<head>
<meta http-equiv="Pragma" content="no-cache">
<title>Message Board</title>
</head>

<body bgcolor="white" background="backg.gif">

<form method="post" action="http://home.pa.net/~macan/cgi-bin/
bbfam.cgi">
<center>

<img src="f&f.gif" align="center">
<p align="center"><font color="red">You may need to refresh/reload your
browser if no new messages have displayed.</font></p>
<h3 align="center">Please fill out this form and press "Submit" <br>
to add your comment to the Message Board below. Your e-mail address is
optional.</h3>

<p align="center">Your Name:<br>
<input type="text" name="name" size="40" maxlength="50"></p>

<p align="center">Your e-mail Address:<br>
<input type="text" name="email" value="(Optional)" size="40" maxlength=
"50"></p>

<p align="center">Message:<br>
<textarea name="comments" rows="5" cols="60" wrap></textarea></p>

<p><input type="submit" value="Submit Message"></p>

</center></form>

<table border="1" cellpadding="0" cellspacing="0">
<tr><td width="35"></td><td width="480">
<hr>

<blockquote>
<!-- BEGINNING -->
</blockquote>
</td></tr></table>
</body></html>




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


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

Date: 19 Nov 1999 22:35:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Putting CGI Bulletin Board in a Table
Message-Id: <814jbm$6b8$1@gellyfish.btinternet.com>

On Fri, 19 Nov 1999 19:09:10 GMT chrism725@my-deja.com wrote:
> Hi,
> This is my first post to the group. I've just finished a perl CGI course
> and am new at this, and in need of some help!
> 
> I created a bulletin board that works just fine. I then decided to
> spruce it up by putting it in a table so that the BB entries would be
> off to the the right a bit, because I wanted to add a background image
> in the left margin.
> 
> Now, all new BB entries are posted just under and outside of my table. I
> have the proper code inside the table cell (at least as far as I can
> tell.) I can't figure out why this is happening. My BB is set up so that
> the form is at the top, and all new BB entries appear just under the
> form. So I have the table tags just under the form.
> 
> I am using the html comment tag "<!-- BEGINNING -->" to indicate where
> new BB entries should appear. Here is the HTML code:
> (THANKS! for any suggestions!)

Your question appears to be about HTML and not Perl.

Followups set to a more appropriate group

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 19 Nov 1999 22:57:00 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Putting CGI Bulletin Board in a Table
Message-Id: <0BkZ3.28982$YI2.1348644@typ11.nn.bcandid.com>

In article <81478h$3pc$1@nnrp1.deja.com>,  <chrism725@my-deja.com> wrote:
>This is my first post to the group. I've just finished a perl CGI course
>and am new at this, and in need of some help!

Wrong newsgroup; your question has nothing to do with Perl.  Something
in comp.infosystems.www.authoring.* might help.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 19 Nov 1999 15:38:22 -0600
From: Scott Netterville <knetter@nortelnetworks.com>
Subject: Question about Class::Struct
Message-Id: <n1gn1samab5.fsf@nortelnetworks.com>



I'm having a problem with the following example from the 
Perl CookBook: 
  

#begin code snippet 

use Class::Struct;        #Use structure building module 
use diagnostics; 
struct Person => {        #create definition for struct Person 
    name => '$',           #name field is a scalar 
    age => '$',            #age field is a scalar 
    peers => '@',          #peers field is an array 
}; 
  

my $p = Person->new();    #allocate an empty Person struct 

#Set the various fields 

$p->name("Jason Smythe"); 
$p->age("13"); 
$p->peers( [ "Preston", "Richard", "Sam" ] );  # <- this is not working 
#@{$p->peers} = ("Preston", "Richard", "Sam"); # <- this works as expected 
					       #    when uncommented.	
#Now retrieve the info 

printf "At age %d, %s's first friend is %s.\n", 
    $p->age, $p->name, $p->peers(0); 
  

#End of code snippet 

When I run the above as is, I get a warning about use of 
uninitialized value (-w flag, of course) for the line commented 
as not working. If I use the line commented as working it performs 
as expected. According to the Cookbook, they should both work 
(and I don't see why not since, the [] should return an array 
reference, right?) 

Am I overlooking a typo or making an obvious (to anyone else) mistake?

Any thoughts? 


-- 
Scott Netterville			
knetter@nortelnetworks.com


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

Date: 19 Nov 1999 22:00:01 GMT
From: lee.lindley@bigfoot.com
Subject: recruiter spam was [Re: Programming Language Comparison]
Message-Id: <814h91$iat$1@rguxd.viasystems.com>

Ted Shieh <tedshieh@monmouth.com> wrote:

:>BTW: I am looking for a job in California, preferably near Pasadena and with
:>a salary of at least $75,000 per year.

You probably need to hook up with Amy at infosysgroup.com.  I think
she just spammed everybody that ever posted in c.l.p.misc with
a recruitment pitch.  Unfortunately for you, it is in NYC.


-- 
// Lee.Lindley   /// I used to think that being right was everything.
// @bigfoot.com  ///  Then I matured into the realization that getting
////////////////////   along was more important.  Except on usenet.


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

Date: 19 Nov 1999 15:20:05 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: REgarding the "x-httpd-cgi"
Message-Id: <38356aa5_2@newsread3.dircon.co.uk>

Mohammad Akram Ali Mehkri <mehkri@yahoo.com> wrote:
> --- Aparna Ramachandran <aparnar@imap4.asu.edu> wrote:
>>  Message from the Deja.com forum: 
>>  comp.lang.perl.misc
>>  Your subscription is set to individual email delivery
>> > 
>> 
>> Hi,
>>   WE are trying to create a discussion borad for educational
>> purposes.In doing
>> so, I came up with an error during the posting of messages.The
>> error is
>> 
>> "You have started to download the file "Myfilename.cgi" of type
>> "application /x-httpd/cgi-bin".Click more info to learn about
>> Navigator's
>> capabilites.
>> 
>> More info   Pick Appl    Save File    Cancel
>>  I came across your replies in one of the discussion groups in the
>> web.I would
>> be very grateful if you could help me out.
>> 
>> Regards
>> Aparna
>>    
>>
> in ur perl script 
> add this line before u print any html output
> 
> print "Content-type:text/html\n\n\n";
> it should solve the problem
> 
> 

<sigh another message from postnews.deja.com>

I think that maybe you could lose one of those \n and possibly put a space
after the : but hey !

My problem here is that we are getting these posts from the Deja mail
to news gateway without the message they are following up and probably
without the poster realising that they actually are submitting this
to thousands of computers on usenet .

/J\
-- 
"Killing myself is the last thing I'd ever do" - Homer Simpson


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

Date: 19 Nov 1999 11:26:49 -0500
From: bj <bradw@newbridge.com>
Subject: Re: Setting Environment variables from a perl script
Message-Id: <op1bt8qsb06.fsf@newbridge.com>

ps123@my-deja.com writes:

> Hi,
> 
> I would like to set a user-defined environment variable from a
> perl script, and export it to the parent shell (I am converting a shell
> script to a perl script). Can someone tell me as to how I can achieve
> it?

The short answer is that you can't. Read the docs to see why
(perlfaq8). Changes in child environments are not reflected in the
parent process. You can approximate this behavior, pretty much the
same way as you can in a shell, namely via sourcing the program. ie.

1) source a shell wrapper script that calls your perl program
2) have the program write a shell appropriate tmpfile
3) have the wrapper script source this tmpfile

The environment of the current shell will be modified.

Also, a simple deja search will turn up lots of discussion about this
as it is a faq.

cheers,
bj

-- 
bradw@newbridge.com            Newbridge Networks Corporation
Brad Warkentin                 600 March Road, Kanata, Ontario K2K 2E6
CAE Toolsmith                  (613) 599-3600 ext. 6117  FAX: 599-3654


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

Date: 19 Nov 1999 11:43:41 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Setting Environment variables from a perl script
Message-Id: <x73du2qvnm.fsf@home.sysarch.com>

>>>>> "b" == bj  <bradw@newbridge.com> writes:

  b> The short answer is that you can't. Read the docs to see why
  b> (perlfaq8). Changes in child environments are not reflected in the
  b> parent process. You can approximate this behavior, pretty much the
  b> same way as you can in a shell, namely via sourcing the program. ie.

  b> 1) source a shell wrapper script that calls your perl program
  b> 2) have the program write a shell appropriate tmpfile
  b> 3) have the wrapper script source this tmpfile

why use a temp file? all shells can do ``. in fact a common parent env
modifier is tset and is used like this:

     For the Bourne shell, put  this  command  in  your  .profile
     file:

     eval `tset -s options...`

     or using the C shell, put  these  commands  in  your  .login
     file:

     set noglob
     eval `tset -s options...`
     unset noglob

and you can do the same with a perl program instead of tset.

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: 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 1437
**************************************


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