[11049] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4649 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 14 10:07:13 1999

Date: Thu, 14 Jan 99 07: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           Thu, 14 Jan 1999     Volume: 8 Number: 4649

Today's topics:
    Re: __DATA__ <james.b.crigler@lmco.com>
        A book abot Perl. <y@mail.ru>
    Re: A book abot Perl. <eugene@snailgem.org>
    Re: Can I use perl with https? <ringwood@berbee.com>
        changing text in files probs (Stephen Howe)
    Re: Email notification <janser@bigfoot.com>
    Re: Help needed with locking info@gadnet.com
        Help please..bad file handle error <dave@icepop.demon.co.uk>
    Re: Help please..bad file handle error <eugene@snailgem.org>
        How to send IP packet on a selected interface ? thomas.parvais@advalvas.be
    Re: Logic flow dave@mag-sol.com
    Re: Perl Criticism <pdcawley@bofh.org.uk>
    Re: Perl Criticism (David Formosa (aka ? the Platypus))
    Re: Perl Criticism (David Formosa (aka ? the Platypus))
    Re: Perl Criticism droby@copyright.com
    Re: PGP system call (Andrew M. Langmead)
        pipe both in and out <visteh@oslo.geco-prakla.slb.com>
    Re: pipe both in and out <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Running Perl scripts for Macs <ringwood@berbee.com>
        script produced no output <mj@alb.se>
    Re: Syntax help wanted:  "use strict" and sort $a and $ <jlarke@ans.net>
        talking to my children (Ryan McGuigan)
    Re: Which Perl reference book? (Johan Vromans)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 14 Jan 1999 09:11:30 -0500
From: James B Crigler <james.b.crigler@lmco.com>
Subject: Re: __DATA__
Message-Id: <369DFB12.163AEF6C@lmco.com>

Abigail wrote:
> %% Can someone please tell me where to find out more about __DATA__ and how and
> %% when to use it.  I've tried looking in Programming Perl, but didn't find much
> %% help there with regards to how and what to use it for and I don't have access
> %% to the man pages.
> 
> If you don't have the man pages, you don't have perl.

Though the docs come with perl, it does not follow necessarily that they
are available to users.  E.g., I have access to the man pages, but to
get
the FAQs, I have to on the web.  (Even at that, the version of perl in
use
here is 5.003---multiple years out of date.  Unlike my previous job,
at this employer I don't have admin privileges.)
-- 
Jim Crigler                 | james.b.crigler@lmco.com
Zone 0100                   | Voice: (770)494-4528
86 S. Cobb Dr.              | "There are three kinds of people:  Those
Marietta GA 30063           | who can count and those who can't."


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

Date: Thu, 14 Jan 1999 15:40:40 +0300
From: "Sergey" <y@mail.ru>
Subject: A book abot Perl.
Message-Id: <77kol2$n8d@green.kosnet.ru>

Hi, guys!
Please, tell me where I can get an electronic book  about the language. I am
just starting learning it so I need much inforation and help... Thanking in
anticipation your answer.
    With best wishes,
         Sergey Yepifanov
yes@kosnet.ru
y@mail.ru




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

Date: Thu, 14 Jan 1999 08:07:19 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
To: Sergey <y@mail.ru>
Subject: Re: A book abot Perl.
Message-Id: <369DEC07.841B5767@snailgem.org>

Sergey wrote:
> 
> Hi, guys!
> Please, tell me where I can get an electronic book  about the language. I am
> just starting learning it so I need much inforation and help... Thanking in
> anticipation your answer.
>     With best wishes,
>          Sergey Yepifanov
> yes@kosnet.ru
> y@mail.ru

You can start at:

http://reference.perl.com/


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

Date: Thu, 14 Jan 1999 08:18:49 -0600
From: Tim <ringwood@berbee.com>
Subject: Re: Can I use perl with https?
Message-Id: <369DFCC9.572B@berbee.com>

allen snook wrote:
> 
> Hi all,
> 
> I'm in the process of putting together a secure perl script, but I want the
> script to be run in an encrypted mode.  In my HTML that kicks off the
> script, I have a form call as follows:
> 
> <FORM ACTION="https://www.charm.net/~seattle/cgi-bin/ss.pl" METHOD=POST>

Apache at least defaults to only allow extension of ".cgi".
Try change your script name! 

tim


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

Date: Thu, 14 Jan 1999 12:10:01 GMT
From: stephen@bcl.com (Stephen Howe)
Subject: changing text in files probs
Message-Id: <369dd7fd.3716099@194.72.35.202>

Dear all...

I have a problem I hope you can please help me with.
A program of mine doesn't work and this is how it goes:

Discover names of files in a certain directory
(c:\ftgate\spool\inbox).

Store filenames in an array.

Open a filename from array and see if they have a line containing
"bcl"

If the file has bcl in one of it's lines, replace it with "betsy.bcl".

Close file and check the next file in the array.

End.

This is the actual program code... (mesg follows below)

$fileloop=0;
$toline=0;
$loopcheck=0;
$filename=0;
system "cd \\ftgate\\spool";
print "1\n";
system "dir \\ftgate\\spool\\inbox\\*.ftw >\\ftgate\\spool\\dir.txt";
print "2\n";
open (DIRFILE,"<\\ftgate\\spool\\dir.txt");
print "3\n";
while ($line=<DIRFILE>)
{  
   if ($line=~/ftw/)
   {
      $pos=index($line, "f99");
      print "pos $pos\n";
      $filename1=substr($line, $pos, 25);
      $files[$fileloop]=$filename1;
      $fileloop=$fileloop+1;
   }
   else
   {}
}
close DIRFILE;
print "4\n";
while ($loopcheck<$fileloop)
{
   $filename=$files[$loopcheck];
   print "filename $filename\n";
   open (FTWFILE,">/ftgate/spool/inbox/$filename");
   while ($line=<FTWFILE>)
   {  print "ROUND $loopcheck\n";
      if ($line=~/bcl/)
      {  
	 $line=$toline;
         $toline=~s/\@bcl/\@betsy.bcl/;
         print "loopcheck $loopcheck line $toline\n";
      }
      else
      {
      print "no bcl line $line\n";
      }
   }
   print FTWFILE "boo ", $toline, " whee\n";    #simple test.
   $loopcheck=$loopcheck+1;
   
}
close FTWFILE;


And these are the error messages that appear on running 
perl -w mailsort.pl...

1
2
3
pos 44
pos 44
pos 44
4
filename f99456789112345678901.ftw
ROUND 0
no bcl line boo 0 whee

Filehandle main::FTWFILE opened only for input at mailsort.pl line 54,
<FTWFILE>
 chunk 1.
filename f99456789012345678901.ftw
ROUND 1
no bcl line boo 0 whee

Filehandle main::FTWFILE opened only for input at mailsort.pl line 54,
<FTWFILE>
 chunk 1.
filename f99456789212345678901.ftw
ROUND 2
no bcl line boo 0 whee

Filehandle main::FTWFILE opened only for input at mailsort.pl line 54,
<FTWFILE>
 chunk 1.


Can ANYONE tell me where I'm going wrong... please? 
Would be gratefully GRATEFULLY appreciated cos i'm tearing my hair
out...

Thanks very much to anyone who replies.

Steve Howe

C:\>



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

Date: Wed, 13 Jan 1999 12:27:37 +0100
From: "Christoph Janser" <janser@bigfoot.com>
Subject: Re: Email notification
Message-Id: <77kvlf$s9f$1@pollux.ip-plus.net>

Stephan Slagter schrieb in Nachricht <369C63EA.1B56C495@eega.nl>...
>I'm looking for a way to send visitors a email notifications when a html
>page is changed on our server. I've seens this before but can't find it
>again.
>If you know of any service, perl- or javascript that can do this, please
>let me know.

Hi Stephan
http://www.mindit.com is a very good service in the internet for your
problem.

I have this service in my homepages.

cu Christoph



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

Date: Thu, 14 Jan 1999 17:53:58 GMT
From: info@gadnet.com
Subject: Re: Help needed with locking
Message-Id: <369e2d35.174811151@news.newsguy.com>

I was hoping for something a little more general (or a little more
detailed) than the Perl FAQ which I had seen. It doesn't mention any
kind of semaphore locking, nor the workings of flock. What happens if
you open a file for reading which is currently held with an flock (2)
for writing? Will the open work, even if you can't then read the file?
I am very confused about the concept of applying file level locking
after opening a file. Is there anywhere where this is explored in
plain English?

Regards,

Drummond Miles


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

Date: Thu, 14 Jan 1999 12:19:18 +0000
From: David Robinson <dave@icepop.demon.co.uk>
Subject: Help please..bad file handle error
Message-Id: <A9KYNCAGDen2Ewbn@icepop.demon.co.uk>

Help Please.

I`m working my way through a book "Teach yourself cgi programming with
perl 5 in a week" and despite the fact that it is now 7 months since I
started I feel as though I am starting at least to make some progress.

My current project is to learn how to extract and manipulate data from a
simple database according to a user selection from a pull down menu on
an HTML page. 

The example from the book illustrates a routine for a `Build Your Own
Computer` webpage. This consists of:
a. build.cgi 
b. build.html
c. sys2 (The database)

I have reproduced these later in this message for examination.

I can get the various options to appear on the resulting webpage, but
the cost of the items [$price] will not generate. It simply returns a
value of 0.

the line: open ($PRICE_FILE, "/sys2.txt");   may be the problem...
" bad file handle error"

If it is written as above cgi-lib.pl throws up the following:

cgi-lib.pl: Unknown Content-type: 
Content-type: text/html

<html>
<head>
<title>cgi-lib.pl: Unknown Content-type: 
</title>
</head>
<body>
<h1>cgi-lib.pl: Unknown Content-type: 
</h1>

If the line is written as ($PRICE_FILE= "/sys2.txt");

The webpage is generated but returns a value of 0 for $price
Presumably because the data from the database hasn`t been used/found.

I`m sorry if this goes on a bit, but I am reproducing the relevant code
and HTML in the hope that someone can help me to understand why the data
from the data file is not being read. (I have tried the script using
Perl Builder on my PC, and on the server. I think I`ve eliminated simple
potential problems like file permissions, paths etc and typos.)


========================================================================
The HTML: (build.html)


<HTML>
 
<HEAD>
<TITLE></TITLE>
</HEAD>
 
<BODY>
<P>Or Build your own PC</P>
<P></P>
<CENTER>
<FORM METHOD="post" ACTION="/cgi-bin/build.cgi">
<TABLE WIDTH="50%" BORDER="1">
<TR>
<TD>CPU <P><SELECT NAME="cpu"><OPTION VALUE="P75">Pentium 75</OPTION>
<OPTION VALUE="486d66">486 DX2 66</OPTION><OPTION VALUE="P60">Pentium 60 
</OPTION><OPTION VALUE="P100" SELECTED="SELECTED">Pentium 100 </OPTION>
</SELECT>
</P>
</TD>
<TD>Memory<P><SELECT NAME="memory"><OPTION VALUE="16 MEG">16 Meg Memory
</OPTION><OPTION VALUE="4 MEG">4 Meg Memory</OPTION><OPTION VALUE="8
MEG">8 Meg
Memory </OPTION><OPTION VALUE="32 MEG" SELECTED="SELECTED">32 Meg Memory 
</OPTION></SELECT>
</P>
</TD>
<TD>Hard Disk<P><SELECT NAME="disk"><OPTION VALUE="850 IDE">850 Meg IDE
</OPTION><OPTION VALUE="560 IDE">560 Meg IDE </OPTION>
<OPTION VALUE="1 GIG IDE" SELECTED="SELECTED">1 Gig
IDE</OPTION></SELECT>
</P>
</TD>
<TD></TD>
</TR>
<TR>
<TD>Video Card <P><SELECT NAME="video"><OPTION VALUE="2 MEG">2 Meg card
</OPTION><OPTION VALUE="1 MEG">1 Meg card</OPTION>
<OPTION VALUE="4 MEG" SELECTED="SELECTED">4 Meg card</OPTION></SELECT>
</P>
</TD>
<TD>Monitor<P><SELECT NAME="monitor"><OPTION VALUE="15 INCH">15.28 NI
</OPTION>
<OPTION VALUE="14 INCH">14.28 NI</OPTION>
<OPTION VALUE="17 INCH" SELECTED="SELECTED">17.28 NI </OPTION></SELECT>
</P>
</TD>
<TD>CD ROM<P><SELECT NAME="cdrom"><OPTION VALUE="2X CDROM">Double Speed
</OPTION><OPTION VALUE="NONE">NONE </OPTION>
<OPTION VALUE="4X CDROM" SELECTED="SELECTED">Quad
Speed</OPTION></SELECT>
</P>
</TD>
<TD>Modem<P><SELECT NAME="modem"><OPTION VALUE="28.8 MODEM">28.8
</OPTION>
<OPTION VALUE="14.4 MODEM">14.4 </OPTION><OPTION VALUE="NONE">NONE
</OPTION> 
</SELECT>
</P>
</TD>
</TR>
<TR>
<TD>&nbsp;</TD>
<TD>&nbsp;<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Get Current
Price"></TD>
<TD>&nbsp;<INPUT TYPE="RESET" NAME="Reset1"></TD>
<TD>&nbsp;</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
<P></P>
</BODY>
</HTML>
========================================================================
The Script ( build.cgi)



#!/usr/local/bin/perl
push(@INC, "/cgi-bin");
require("cgi-lib.pl");

&ReadParse(*input);
open($PRICE_FILE="/sys2.txt");
while (<$PRICE_FILE>) {
chop;
($item, $price) = split(/:/,$_,2) ;
$price_list{$item} = $price ;
}

#Determine base price
$price = $price_list{$input{'cpu'}};

if ($input{'cpu'} eq "486d66") {
#set 486 variables
$computer_name = "486DX2-66";
$video = "VLB" ;
$price += $price_list{$input{'memory' }};
$memory =$input{'memory'};
}
else {

#not a 486 so must be a pentium
$computer_name = "Pentium";
$video = "PCI";
   $cache = "256K Cache";
     if  ($input{'memory'} ne "8 MEG"){
           $price += $price_list{$input{'memory'}};
              }
#32
if ($input{'memory'} eq "4 MEG"){
    $memory = "8 MEG";
}
else { $memory = $input{'memory'};}


#37
if ($input{'cpu'} eq "P100") {$ptype = 100}
elsif ($input{'cpu'} eq "P75") {$ptype = 75}
elsif ($input{'cpu'} eq "P60") {$ptype = 60}
}
#41

# add monitors over 14"

$monitor = $input{'monitor'};
$price += $price_list{$input{'monitor'}};

#45
#add mulitmedia
if ($input{'cdrom'} ne "NONE") {
   $price += $price_list{$input{'cdrom'}};
   if ($input{'cdrom'} eq "2X CDROM") {
       $multimedia="Double Speed Multimedia System";
            }
   else {
       $multimedia="Quad Speed Multimedia System";
            }
        }
#56
#add 14.4 modem price
if ($input{'modem'} ne "NONE") {
    $price += $price_list{$input{'modem'}};
    $modem = $input{'modem'};
        }

#63
#add disk price
$price += $price_list{$input{'disk'}};
$DISK = $input{'disk'};

#66
#add video
$price += $price_list{$input{'video'}};
$VIDEO = $input{'video'};

#70
print &PrintHeader;
#print <$in1>;
print<<"print_tag";
<html>
<head>
<title>$computer_name Systems from our store</title>
</head>
<body>
<h1 align=center> Our Store PC`s </h1>
<center>
<table border=5>
<th colspan=2 align=center> <h2>
${computer_name} $ptype  only \$$price
</h2>
<tr><td><ul>
<li>$memory of Ram
<li>$cache $price
<li>Enhanced IDE In/Out Controller 
<li>$monitor NIL SVGA Monitor
<li>$VIDEO $video SVGA Video Card
<li>$multimedia
</ul>
<td><ul>
<li>1.44 Floppy Drive
<li>$DISK Hard Drive
<li>Mouse
<li>Windows 95
<li>$modem
</ul>
<tr>
<td align=center colspan=2> <h2> 1 Year Warranty </h2>
<tr>
</table>
</center>
</body>
</html>
print_tag

========================================================================
The Data (sys2.txt)

P100:1799
P75:1550
P60:1450
486d66:1099

32 MEG:800
16 MEG:300
8 MEG: 160

1 GIG IDE:175
850 IDE:110

4 MEG:320
2 MEG:120
1 MEG:0

17 INCH:650
15 INCH:200

4X CDROM:290
2X CDROM:190
NONE:0

28.8 MODEM:139
14.4 MODEM:69
NONE:0


========================================================================

Thanks very much

Dave Robinson



 




-- 
David Robinson


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

Date: Thu, 14 Jan 1999 08:43:37 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
To: David Robinson <dave@icepop.demon.co.uk>
Subject: Re: Help please..bad file handle error
Message-Id: <369DF489.6660646E@snailgem.org>

> the line: open ($PRICE_FILE, "/sys2.txt");   may be the problem...
> " bad file handle error"

Looks like a mistake in the book:
try PRICE_FILE everywhere where it says $PRICE_FILE



David Robinson wrote:
> 
> Help Please.
> 
> I`m working my way through a book "Teach yourself cgi programming with
> perl 5 in a week" and despite the fact that it is now 7 months since I
> started I feel as though I am starting at least to make some progress.
> 
> My current project is to learn how to extract and manipulate data from a
> simple database according to a user selection from a pull down menu on
> an HTML page.
> 
> The example from the book illustrates a routine for a `Build Your Own
> Computer` webpage. This consists of:
> a. build.cgi
> b. build.html
> c. sys2 (The database)
> 
> I have reproduced these later in this message for examination.
> 
> I can get the various options to appear on the resulting webpage, but
> the cost of the items [$price] will not generate. It simply returns a
> value of 0.
> 
> the line: open ($PRICE_FILE, "/sys2.txt");   may be the problem...
> " bad file handle error"
> 
> If it is written as above cgi-lib.pl throws up the following:
> 
> cgi-lib.pl: Unknown Content-type:
> Content-type: text/html
> 
> <html>
> <head>
> <title>cgi-lib.pl: Unknown Content-type:
> </title>
> </head>
> <body>
> <h1>cgi-lib.pl: Unknown Content-type:
> </h1>
> 
> If the line is written as ($PRICE_FILE= "/sys2.txt");
> 
> The webpage is generated but returns a value of 0 for $price
> Presumably because the data from the database hasn`t been used/found.
> 
> I`m sorry if this goes on a bit, but I am reproducing the relevant code
> and HTML in the hope that someone can help me to understand why the data
> from the data file is not being read. (I have tried the script using
> Perl Builder on my PC, and on the server. I think I`ve eliminated simple
> potential problems like file permissions, paths etc and typos.)
> 
> ========================================================================
> The HTML: (build.html)
> 
> <HTML>
> 
> <HEAD>
> <TITLE></TITLE>
> </HEAD>
> 
> <BODY>
> <P>Or Build your own PC</P>
> <P></P>
> <CENTER>
> <FORM METHOD="post" ACTION="/cgi-bin/build.cgi">
> <TABLE WIDTH="50%" BORDER="1">
> <TR>
> <TD>CPU <P><SELECT NAME="cpu"><OPTION VALUE="P75">Pentium 75</OPTION>
> <OPTION VALUE="486d66">486 DX2 66</OPTION><OPTION VALUE="P60">Pentium 60
> </OPTION><OPTION VALUE="P100" SELECTED="SELECTED">Pentium 100 </OPTION>
> </SELECT>
> </P>
> </TD>
> <TD>Memory<P><SELECT NAME="memory"><OPTION VALUE="16 MEG">16 Meg Memory
> </OPTION><OPTION VALUE="4 MEG">4 Meg Memory</OPTION><OPTION VALUE="8
> MEG">8 Meg
> Memory </OPTION><OPTION VALUE="32 MEG" SELECTED="SELECTED">32 Meg Memory
> </OPTION></SELECT>
> </P>
> </TD>
> <TD>Hard Disk<P><SELECT NAME="disk"><OPTION VALUE="850 IDE">850 Meg IDE
> </OPTION><OPTION VALUE="560 IDE">560 Meg IDE </OPTION>
> <OPTION VALUE="1 GIG IDE" SELECTED="SELECTED">1 Gig
> IDE</OPTION></SELECT>
> </P>
> </TD>
> <TD></TD>
> </TR>
> <TR>
> <TD>Video Card <P><SELECT NAME="video"><OPTION VALUE="2 MEG">2 Meg card
> </OPTION><OPTION VALUE="1 MEG">1 Meg card</OPTION>
> <OPTION VALUE="4 MEG" SELECTED="SELECTED">4 Meg card</OPTION></SELECT>
> </P>
> </TD>
> <TD>Monitor<P><SELECT NAME="monitor"><OPTION VALUE="15 INCH">15.28 NI
> </OPTION>
> <OPTION VALUE="14 INCH">14.28 NI</OPTION>
> <OPTION VALUE="17 INCH" SELECTED="SELECTED">17.28 NI </OPTION></SELECT>
> </P>
> </TD>
> <TD>CD ROM<P><SELECT NAME="cdrom"><OPTION VALUE="2X CDROM">Double Speed
> </OPTION><OPTION VALUE="NONE">NONE </OPTION>
> <OPTION VALUE="4X CDROM" SELECTED="SELECTED">Quad
> Speed</OPTION></SELECT>
> </P>
> </TD>
> <TD>Modem<P><SELECT NAME="modem"><OPTION VALUE="28.8 MODEM">28.8
> </OPTION>
> <OPTION VALUE="14.4 MODEM">14.4 </OPTION><OPTION VALUE="NONE">NONE
> </OPTION>
> </SELECT>
> </P>
> </TD>
> </TR>
> <TR>
> <TD>&nbsp;</TD>
> <TD>&nbsp;<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Get Current
> Price"></TD>
> <TD>&nbsp;<INPUT TYPE="RESET" NAME="Reset1"></TD>
> <TD>&nbsp;</TD>
> </TR>
> </TABLE>
> </FORM>
> </CENTER>
> <P></P>
> </BODY>
> </HTML>
> ========================================================================
> The Script ( build.cgi)
> 
> #!/usr/local/bin/perl
> push(@INC, "/cgi-bin");
> require("cgi-lib.pl");
> 
> &ReadParse(*input);
> open($PRICE_FILE="/sys2.txt");
> while (<$PRICE_FILE>) {
> chop;
> ($item, $price) = split(/:/,$_,2) ;
> $price_list{$item} = $price ;
> }
> 
> #Determine base price
> $price = $price_list{$input{'cpu'}};
> 
> if ($input{'cpu'} eq "486d66") {
> #set 486 variables
> $computer_name = "486DX2-66";
> $video = "VLB" ;
> $price += $price_list{$input{'memory' }};
> $memory =$input{'memory'};
> }
> else {
> 
> #not a 486 so must be a pentium
> $computer_name = "Pentium";
> $video = "PCI";
>    $cache = "256K Cache";
>      if  ($input{'memory'} ne "8 MEG"){
>            $price += $price_list{$input{'memory'}};
>               }
> #32
> if ($input{'memory'} eq "4 MEG"){
>     $memory = "8 MEG";
> }
> else { $memory = $input{'memory'};}
> 
> #37
> if ($input{'cpu'} eq "P100") {$ptype = 100}
> elsif ($input{'cpu'} eq "P75") {$ptype = 75}
> elsif ($input{'cpu'} eq "P60") {$ptype = 60}
> }
> #41
> 
> # add monitors over 14"
> 
> $monitor = $input{'monitor'};
> $price += $price_list{$input{'monitor'}};
> 
> #45
> #add mulitmedia
> if ($input{'cdrom'} ne "NONE") {
>    $price += $price_list{$input{'cdrom'}};
>    if ($input{'cdrom'} eq "2X CDROM") {
>        $multimedia="Double Speed Multimedia System";
>             }
>    else {
>        $multimedia="Quad Speed Multimedia System";
>             }
>         }
> #56
> #add 14.4 modem price
> if ($input{'modem'} ne "NONE") {
>     $price += $price_list{$input{'modem'}};
>     $modem = $input{'modem'};
>         }
> 
> #63
> #add disk price
> $price += $price_list{$input{'disk'}};
> $DISK = $input{'disk'};
> 
> #66
> #add video
> $price += $price_list{$input{'video'}};
> $VIDEO = $input{'video'};
> 
> #70
> print &PrintHeader;
> #print <$in1>;
> print<<"print_tag";
> <html>
> <head>
> <title>$computer_name Systems from our store</title>
> </head>
> <body>
> <h1 align=center> Our Store PC`s </h1>
> <center>
> <table border=5>
> <th colspan=2 align=center> <h2>
> ${computer_name} $ptype  only \$$price
> </h2>
> <tr><td><ul>
> <li>$memory of Ram
> <li>$cache $price
> <li>Enhanced IDE In/Out Controller
> <li>$monitor NIL SVGA Monitor
> <


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

Date: Thu, 14 Jan 1999 13:52:27 GMT
From: thomas.parvais@advalvas.be
Subject: How to send IP packet on a selected interface ?
Message-Id: <77ksqo$uur$1@nnrp1.dejanews.com>

Hi !

I define with IP-aliasing 10 ip address on the SAME subnet for one ethernet
adatper:

eth0 eth0:1 .... eth0:9
10.0.0.1 10.0.0.2 .... 10.0.0.10

I want to send IP packets from these different Logical IP interface to a host
on the network 10.0.0.100. The problem is How can I select the source IP
address ?

The goal is to be able to open 10 telnet sessions from all the logical ip
interface to the same server. I can thus simulate 10 different users
(different IP) with only one linux box.

Please help as fast as possible ! and Reply also by email

Thank you

--------------
Thomas Parvais

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


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

Date: Thu, 14 Jan 1999 11:49:59 GMT
From: dave@mag-sol.com
Subject: Re: Logic flow
Message-Id: <77kll5$p9d$1@nnrp1.dejanews.com>

In article <77j2e2$e93$1@nnrp1.dejanews.com>,
  hudacmi2433@my-dejanews.com wrote:
> My main routine consists of a series of subroutines.  After returning from
> any oneI may need to STOP execution (elegantly)  Is DIE the right way or
> elegant way?
>
> #MAIN
> blah...
> blah...
> &sub1;
> &sub2;
> if( $condition)
> {
>    &sub3;
>    &sub4;
> }
> else
> {
>    DIE???
> }
> #End MAIN

you may like to recastthe last bit as:

$condition or die;
&sub3;
&sub4;


hth,

Dave...

--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

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


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

Date: 14 Jan 1999 10:57:45 +0000
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: Perl Criticism
Message-Id: <s7pd84ixgt2.fsf@windrush.elsevier.co.uk>

topmind@technologist.com writes:
> In article <slrn79lkif.mtj.dformosa@godzilla.zeta.org.au>,
>   dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
> > In article <77e6rq$lth$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
> > >All knowledge is good, but I still say that the Psycology
> > >(phonetic: "sykologee") aspect of language design is 98% of where
> > >the problem is.
> >
> > Rather then psycology wouldn't lingistics be a better field, I
> > mean they study the way people comminicate.
> 
> They study people-to-people communication, not people-to-machine
> communication. They may be a fish out of water there.

Bwah hah hah hah! And in one swell foop Topmind reveals his staggering 
ignorance of what he's talking about.

-- 
Where is the Life we have lost in living? 
Where is the wisdom we have lost in knowledge? 
Where is the knowledge we have lost in information? 
		TS Eliot -- The Wasteland


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

Date: 14 Jan 1999 12:43:02 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79rpim.lmc.dformosa@godzilla.zeta.org.au>

In article <77k4fr$b93$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <369AB73A.2C48D41B@mediaone.net>,
>  "Michael D. Schleif" <mds-resource@mediaone.net> wrote:

[...]

>> Please, might we take a tiny peak at any of your ``real world work?''
>
>What do you have in mind? Source code?

Source code is exactly what we want.



-- 
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html



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

Date: 14 Jan 1999 12:41:45 GMT
From: dformosa@zeta.org.au (David Formosa (aka ? the Platypus))
Subject: Re: Perl Criticism
Message-Id: <slrn79rpg9.lmc.dformosa@godzilla.zeta.org.au>

In article <77k49v$b5s$1@nnrp1.dejanews.com>, topmind@technologist.com wrote:
>In article <slrn79lkif.mtj.dformosa@godzilla.zeta.org.au>,
>  dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:

[...]

>> Rather then psycology wouldn't lingistics be a better field, I mean
>> they study the way people comminicate.
>
>
>They study people-to-people communication, not people-to-machine
>communication. They may be a fish out of water there.

But isn't your argument about people to people comminication?  Isn't
readable code the ablity to comminicate between two people?

-- 
Please excuse my spelling as I suffer from agraphia. See
http://www.zeta.org.au/~dformosa/Spelling.html to find out more.
How to win arguments on usenet http://www.zeta.org.au/~dformosa/usenet.html



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

Date: Thu, 14 Jan 1999 14:27:48 GMT
From: droby@copyright.com
Subject: Re: Perl Criticism
Message-Id: <77kusq$kh$1@nnrp1.dejanews.com>

In article <slrn79lm8o.mtj.dformosa@godzilla.zeta.org.au>,
  dformosa@zeta.org.au (David Formosa (aka ? the Platypus)) wrote:
>
> >I do not remember all the arguments that I *did* present, but
> >one is confusion about what is a boolean expression
> >and what is a leaky assignment. It is too easy to
> >confuse and mistype "=" and "==".
>
> Then have your boolean equility operator called "eq" then.
>

Or get an APL keyboard and use left-arrow for assignment.  Or emulate Algol
and use := for assignment.  Personally, I'm quite happy to just remember
which is which as they stand and continue working in Perl.

Yes, it's easy to write an assignment when you meant an equality test.  It's
also easy to figure out you've done so and fix it.

--
Don Roby

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


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

Date: Thu, 14 Jan 1999 14:55:16 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: PGP system call
Message-Id: <F5K1G4.8Lw@world.std.com>

Forrest Reynolds <dropzone@mail.utexas.edu> writes:
[stuff snipped]
>Abigail wrote:
>> 
>> Forrest Reynolds (dropzone@mail.utexas.edu) wrote on MCMLVI September
>> MCMXCIII in <URL:news:36968B31.1EE9A09D@mail.utexas.edu>:
>> ** system "/local/trew/.pgp/pgp -f +batch -z $pass < $temp >> $perm";

>   Learning does not have to be doled out nun-style. I didn't know this wasn't
>a perl question until I posted this, esp. because I found it in a Perl program.

OK, for the perl part of this. The function system() takes and
argument that is either a single command line, or a list of
arguments. The function spawns the other program, (maybe with a shell
as an intermediary to split the command line into arguments) and
executes it. Once the program completes, control is passed back to
perl.

So this line of perl executes a program called pgp, and passes it a
bunch of arguments that perl does not know, nor care about. On the
other hand, pgp probably does care and has rules about what are valid
or invalid parameters to pass. As Abagail said, the rules about what
to pass to "pgp" are covered in its documentation. On Unix,
documentation is usally supplied in a form called "man pages" which
are viewed with the command "man".

By the way, the this seems fundamentially insecure, since it passes
the password on the command line. If someone was able to execute a
"ps" on the machine they would discover the password.
-- 
Andrew Langmead


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

Date: Thu, 14 Jan 1999 12:55:48 +0100
From: Harald Viste <visteh@oslo.geco-prakla.slb.com>
Subject: pipe both in and out
Message-Id: <Pine.SO4.4.05.9901141249560.26832-100000@sunw119>

Hi,

What I want is really:

open(INOUT,"| mycommand |")

The "camel book" says in the description of the function open:
"You may not have an open command that pipes both in and out, though it's easy
to build one using the pipe and fork commands."

Can anyone tell me how to do this?

Thanks in advance
Harald



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

Date: 14 Jan 1999 13:24:07 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: pipe both in and out
Message-Id: <83soderqjc.fsf@vcpc.univie.ac.at>

Re: pipe both in and out, Harald
<visteh@oslo.geco-prakla.slb.com> said:

Harald> Hi, What I want is really:

Harald> open(INOUT,"| mycommand |")

Try the IPC::Open2 or IPC::Open3 modules

  DESCRIPTION
     The open2() function spawns the given $cmd and connects $rdr
     for reading and $wtr for writing.  It's what you think
     should work when you try
 
         open(HANDLE, "|cmd args|");

Alternatively do "perldoc perlipc" for lots of comms
examples.

 
hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 14 Jan 1999 08:29:07 -0600
From: Tim <ringwood@berbee.com>
Subject: Re: Running Perl scripts for Macs
Message-Id: <369DFF33.5500@berbee.com>

brian d foy wrote:
> 
> In article <369D12CE.1FCE5F55@home.com>, jasongadde@home.com posted:
> 
> > Does anyone know that if a script is able to run in a Windows
> > environment, can it also be run in a Mac environment? Is there any major
> > differences (ie. with Regular Expressions, special characters,
> > functions) in the actual scripts itself.
> 
> Perl is Perl.  if you do something non-Perl, then there might be a
> problem.

98% true.  A few years ago I spent 1 year writing code that needed
to run on Mac, UNIX and Windows and they shared the same Perl libraries
across the network. One change would change all platforms (10+ of
them if count all the flavors).

But things like running other programs took unique platform code,
and that was partly for error handling.

The total parts of the code that were non-platform specific was 
about 98% (I did count at one point). That's pretty darn good and
tells me that while there are gotcha's, Perl is as close to
cross platform as anything.

tim


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

Date: 14 Jan 1999 12:34:23 GMT
From: "mikael j" <mj@alb.se>
Subject: script produced no output
Message-Id: <01be3fba$a69fa5a0$7c48a8c0@PC124.alb.se>

I get the message "script produced no output " when my gustbook script are
going to write to the guestbook HTML-page. It seems like the information
disappear from the webserver. Can anyone help me with this?

I use a perl script on a IIS 3.0 server.

Mikael Johansson
mj@alb.se 


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

Date: 14 Jan 1999 06:30:47 -0500
From: Jason Larke <jlarke@ans.net>
Subject: Re: Syntax help wanted:  "use strict" and sort $a and $b parameters...
Message-Id: <vatsodef5w8.fsf@anthem.aa.ans.net>

>>>>> On Thu, 14 Jan 1999 05:34:57 GMT,
>>>>> posting.account@lookout.com (William Herrera) said:

WH> # Is this how this should work in Perl 5.001?
WH> # I get an error regarding how $a and $b are
WH> # defined with "use Strict" here. Why?
WH> # is there an easy way to avoid the complaint:
WH> #
WH> # Global symbol "a" requires explicit package name at test0.pl line 
WH> # 27.
WH> # Global symbol "b" requires explicit package name at test0.pl line
WH> # 27.
WH> # Execution of test0.pl aborted due to compilation errors.

You need to tell Perl what package they're in. See the docs.

            If you're using strict, you *MUST NOT* declare `$a' and
            `$b' as lexicals. They are package globals. That means
            if you're in the `main' package, it's

                @articles = sort {$main::b <=> $main::a} @files;

            or just

                @articles = sort {$::b <=> $::a} @files;

            but if you're in the `FooPack' package, it's

                @articles = sort {$FooPack::b <=> $FooPack::a} @files;

-- 
Jason Larke- jlarke@ans.net- Just a happy little pimp for mayhem
http://www.nnaf.net/~jlarke/   Send mail for PGP public key.
I don't speak for ANS or the international communist conspiracy.
"People change, and smile: but the agony abides."-T.S. Eliot, The Dry Salvages


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

Date: Thu, 14 Jan 1999 13:40:25 GMT
From: ryan@mail.ramresearch.com (Ryan McGuigan)
Subject: talking to my children
Message-Id: <dtmn2.892$5I.1690475@news.abs.net>

I'm talking about the forked kind.  Ok, say I fork off 5(or any number of
processes really) and want to communicate(actually just listen) to them in
whatever order they finish doing their thing.  

I hope this isn't an FAQ, I did look through them but couldn't find
exactly what I was looking for.

thanks,
Ryan


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

Date: 14 Jan 1999 12:52:30 +0100
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: Re: Which Perl reference book?
Message-Id: <wl33e5eysu9.fsf@plume.nl.compuware.com>

Uri Guttman <uri@home.sysarch.com> writes:

>   b> Programming Perl (2nd Edition)
>   b> The Perl Cookbook

Do not forget the Perl5 Pocket Reference (Camel + Llama).
http://www.oreilly.com/catalog/perlpr2/.

-- Johan


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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