[17125] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4537 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 6 06:05:22 2000

Date: Fri, 6 Oct 2000 03:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970826707-v9-i4537@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 6 Oct 2000     Volume: 9 Number: 4537

Today's topics:
        5.005_03, British Summer Time and caching <steven@ircnet.dk>
    Re: beginner question <lr@hpl.hp.com>
    Re: Changing STDOUT <bart.lateur@skynet.be>
        Cookie implmentation with Perl/Linux (Bryan)
        DBM files don't work after upgrade <peter.howe@primark.com>
    Re: DBM files don't work after upgrade <tward10@jaguar.com>
    Re: embedding in HTML <bart.lateur@skynet.be>
    Re: Help with CGI <bart.lateur@skynet.be>
    Re: how to unlink this file? <bart.lateur@skynet.be>
        lexical for loops <haf@autra.noXX>
    Re: lexical for loops <godzilla@stomp.stomp.tokyo>
    Re: lexical for loops (Bernard El-Hagin)
    Re: lexical for loops <bart.lateur@skynet.be>
    Re: lexical for loops <salvador@my-deja.com>
        Netscape supports Perl ? <Pratibha.S@in.bosch.com>
        Perl utilizing DBI - Would love assistance! <Adam@RealWorldSolutions.net>
    Re: Perl utilizing DBI - Would love assistance! <anders@wall.alweb.dk>
        Perl vs Pegasus Mail (strange things happens) <news@sinus-medien.de>
        Problem: Line terminator for localhost sockets <jdb@wcoil.com>
    Re: Problem: Line terminator for localhost sockets <jdb@wcoil.com>
        Reading textfiles from client? <kpn_bw@hetnet.nl>
        regex <xs@korekom.com>
        Rookie Perl Programmer has a question! <moondoggle1@yahoo.com>
    Re: Rookie Perl Programmer has a question! <salvador@my-deja.com>
        Very simple question. <T.Cockle@staffs.ac.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 06 Oct 2000 09:35:54 GMT
From: steven <steven@ircnet.dk>
Subject: 5.005_03, British Summer Time and caching
Message-Id: <8rk6dq$s4u$1@nnrp1.deja.com>

Hi,

A company that produces a content management system has told us that
Perl 5.005_03 has a bug in it that prevents caching from functioning
during British Summer Time, and they've patched it to make it work. I've
never heard of this bug before, and it prevents me from upgrading Perl
on our boxes. I can't find anything searching Deja, can anyone shed any
light on this?

Thanks,

--
steven


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


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

Date: Fri, 6 Oct 2000 00:41:26 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: beginner question
Message-Id: <MPG.144721f9ec62a31e98ae14@nntp.hpl.hp.com>

In article <39dd0bf4.1863033@news.newsguy.com>, kcivey@cpcug.org says...
> Larry Rosler <lr@hpl.hp.com> wrote:
> 
> >qw(Sun Mon Tue Wed Thu Fri Sat)[...]
> >                       Use the numerical day of the week to extract
> >                       the name from a list of names.  I have corrected
> >                       the expression so it doesn't use barewords,
> >                       which would draw a warning.
> 
> I think you need another set of parentheses there.

I thought so also, until I tested the code without them, and it worked 
fine.  So I saved two keystrokes, at the cost of this subthread.  :-)

> But the original code doesn't draw a warning, because the
> barewords are capitalized.  Of course, they're still bad style.

As Martien Verbruggen observes, I should have referred to fatal 
compilation error due to "use strict 'vars';", not to a warning.  I am 
surprised that most of the others who responded didn't bother to test 
with 'strict' and therefore to eliminate the barewords.

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


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

Date: Fri, 06 Oct 2000 06:53:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Changing STDOUT
Message-Id: <2mtqts84hh1i4avn85aslpdlif511vqv7i@4ax.com>

jason wrote:

>>	OPEN SAVEOUT, ">&STDOUT";
>       ^^^^.. Bart .. you been moonlighting in BASIC again ?

Er... <blush> no, I was focussing on the comma that the OP had forgotten
in his original statement.

-- 
	Bart.


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

Date: Thu, 05 Oct 2000 13:32:17 GMT
From: whyip@pacific.net.sg (Bryan)
Subject: Cookie implmentation with Perl/Linux
Message-Id: <39dc82c9.2381190@news.pacific.net.sg>

 OS : Linux
 Perl Ver : 5; cgi.pm

Aim : To write a html form that send POST data to a cgi script that
save in a cookie, & access by another cgi script to reflect contents
of the cookie in a dynamically created html page.


Hi.
 I'm trying to write a html form that send POST data to a cgi script.
The script is ex1.gi, stored in /cgi-bin/exp1/exp1.cgi.
The script should save the info to a cookie, where defaulted path='/'.


Partial Script of exp1.cgi :

# code read in STDIN and parse to $formdata #
 ...
$query = new CGI();

$my_cookie = new CGI::Cookie(
		-name=>'anycookie',
		-value=>$formdata.
		-expires=>'+15m'
);

print $query->header(-cookie=>$my_cookie);
 ...

 Everything works well until here. The above script - exp1.cgi,
provided
a link to another script - exp2.cgi
 exp2.cgi is stored in /cgi-bin/exp2/exp2.cgi.
exp2.cgi script SHOULD create a html page that printout the contents
of the cookie - 'anycookie'. However, none of the cookie's contents
are printed.

Partial Script of exp2.cgi :

 ...
$query = new CGI();

$getcookie = $query->cookie('anycookie');

print $query->header;

print $query->start_html(-title=>'print cookie'),
 ...

"<P> cookie is : $getcookie </P>",

 ...
$query->end_html;


Conclusion : It seems that the cookie created by script exp1.cgi in
/cgi-bin/exp1/exp1.cgi is not available to the script exp2.cgi in
/cgi-bin/exp2/ directory. How could I enable the cookie to be
site-wide ?

Appreciate any advices.

 Regards,
Bryan Yip.


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

Date: Fri, 6 Oct 2000 09:43:03 +0100
From: "Peter Howe" <peter.howe@primark.com>
Subject: DBM files don't work after upgrade
Message-Id: <39dd91ee$1@primark.com>

I've just upgraded my Linux system and in the process, Perl has been
upgraded.  I copied my whole intranet to the new machine but am finding that
the DBM files I have are no longer being read correctly (using the same
scripts.)

For example,

if (dbmopen(%projects, "/intranet/etc/projects", undef))
{
    foreach $projid (keys %projects)
    {
        print "$projects{$projid}";
    }
}

Is coming back with nowt - but there is loads of info in the files.  Can
anyone explain?  PLEASE!
Pete

--
   ----------------------
   Peter Howe
E: peterhowe@xenzero.com
I: http://www.xenzero.com




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

Date: Fri, 6 Oct 2000 10:03:28 +0100
From: "Trevor Ward" <tward10@jaguar.com>
Subject: Re: DBM files don't work after upgrade
Message-Id: <8rk4h1$bca8@eccws12.dearborn.ford.com>

I have hit this problem also in creating DBM files on one machine and then
trying to access them on the other. Have not found a solution to why this is
happening but ended up doing a file extract import program to take out the
data into a text file copy that then load into a dbm file.

Very useful utility programs after they have been written.

also preety simple to write. So you can try this if you like.

Peter Howe <peter.howe@primark.com> wrote in message
news:39dd91ee$1@primark.com...
> I've just upgraded my Linux system and in the process, Perl has been
> upgraded.  I copied my whole intranet to the new machine but am finding
that
> the DBM files I have are no longer being read correctly (using the same
> scripts.)
>
> For example,
>
> if (dbmopen(%projects, "/intranet/etc/projects", undef))
> {
>     foreach $projid (keys %projects)
>     {
>         print "$projects{$projid}";
>     }
> }
>
> Is coming back with nowt - but there is loads of info in the files.  Can
> anyone explain?  PLEASE!
> Pete
>
> --
>    ----------------------
>    Peter Howe
> E: peterhowe@xenzero.com
> I: http://www.xenzero.com
>
>




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

Date: Fri, 06 Oct 2000 08:27:38 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: embedding in HTML
Message-Id: <lf2rts416plgjs95porqumdctch2f92prp@4ax.com>

N wrote:

>Is there a way you embed perl script in the html files like PHP's <?php ....
>> method besides using SSI's? If it is too complicated an answer I would be
>happy with the name of this function (if exists) so I could look it up.

Many: eperl, embPerl, HTML::Mason. Even a server side PerlScript (friend
of ASP) on a Windows server, can work.

<http://www.activestate.com/Products/ActivePerl/docs/Components/Windows/PerlScript.html#active_server_pages>


You can also turn the consept inside out, and use a generaic template
mechanism to read a templete in a Perl script, interpolate the data, an
print it out to STDOUT (to the browser). See the many template modules
on CPAN: Text::Template, HTML::Template, HTML::DynamicTemplate, and many
more.

-- 
	Bart.


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

Date: Fri, 06 Oct 2000 07:46:02 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Help with CGI
Message-Id: <rf0rtsgphvnomsk3q3l2rbs29n35c5f839@4ax.com>

Jeffrey Scott Dunfee II wrote:

>(I'm using netscape on this one, it works in I.E, but the users
>don't want to switch so I'm stuck making it work for netscape).  And
>when you choose Open it, it displays the html printed into my default
>text editor.  And only the html.

Strange. Typically, this means that Netscape sees a content-type header
of text/plain, while IE is very forgiving to dummies. I wouldn't say
that IE is better.

This line:

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

Looks fine to me. You're using IIS? You're working on Windows, that's
for sure. Perhaps IIS is as dummy-friendly as IE, and it may send a
"content-type: text/plain" header itself if it doesn't see one
originating from you. In that case, I think it receives something that
isn't a header, and thefore thinking that that was it. Perhaps an echo
from system()?

Try moving this statement to the top of the script.

-- 
	Bart.


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

Date: Fri, 06 Oct 2000 07:51:06 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: how to unlink this file?
Message-Id: <e31rts4n2dibcmk9b20pnr6tvo5q7qc856@4ax.com>

bing-du@tamu.edu wrote:

>I tried to use the following script to delete the
>file
>/usr/home/me/tmp/c24b18d4bb4afdf052330678af9a601d_attach_H:\tmp\zz.txt.
>
>===============
>#!/usr/local/bin/perl
>
>$tmp = "/usr/home/me/tmp";
>$uid = "c24b18d4bb4afdf052330678af9a601d";
>
>unlink("$tmp/$uid_attach_*") || die "file can not be deleted\n";
>exit;
>===============
>
>I got 'file can not be deleted'.

unlink() doesn't glob.

-- 
	Bart.


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

Date: Fri, 06 Oct 2000 08:07:14 +0200
From: "P.Eftevik" <haf@autra.noXX>
Subject: lexical for loops
Message-Id: <39DD6C12.99B24ECA@autra.noXX>

Is this allowed/recommended  ? :

for ( $char = 'A' ;  $char lt 'G'  ;  $char++ )     {}

Since my system uses characters instead of digits, something like
that would have been very convenient.
All comments appreciated.

PEftie,
Kongsberg Group
Norway




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

Date: Thu, 05 Oct 2000 23:17:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: lexical for loops
Message-Id: <39DD6E85.D7251CB8@stomp.stomp.tokyo>

"P.Eftevik" wrote:
 
> Is this allowed/recommended  ? :
 
> for ( $char = 'A' ;  $char lt 'G'  ;  $char++ )     {}
 
> Since my system uses characters instead of digits, something like
> that would have been very convenient.

> All comments appreciated.


Why don't you test this syntax and discover?
This would be eminently logical.

Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: 6 Oct 2000 06:54:22 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: lexical for loops
Message-Id: <slrn8tqtp2.f8v.bernard.el-hagin@gdndev25.lido-tech>

On Fri, 06 Oct 2000 08:07:14 +0200, P.Eftevik <haf@autra.noXX> wrote:
>Is this allowed/recommended  ? :
>
>for ( $char = 'A' ;  $char lt 'G'  ;  $char++ )     {}
>
>Since my system uses characters instead of digits, something like
>that would have been very convenient.
>All comments appreciated.

I have a comment - "For Christ's sake, why don't you just try it!?"

Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'


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

Date: Fri, 06 Oct 2000 07:54:46 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: lexical for loops
Message-Id: <d91rtsskdk90vo1k3ik8knfnbei9rug2n0@4ax.com>

P.Eftevik wrote:

>Is this allowed/recommended  ? :
>
>for ( $char = 'A' ;  $char lt 'G'  ;  $char++ )     {}

It's allowed. I think most Perler would prefer

	for my $char ('A' .. 'F') {  ...  }

-- 
	Bart.


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

Date: Fri, 06 Oct 2000 08:14:55 GMT
From: Salva <salvador@my-deja.com>
Subject: Re: lexical for loops
Message-Id: <8rk1lq$ou8$1@nnrp1.deja.com>

In article <39DD6C12.99B24ECA@autra.noXX>,
  "P.Eftevik" <haf@autra.noXX> wrote:
> Is this allowed/recommended  ? :
>
> for ( $char = 'A' ;  $char lt 'G'  ;  $char++ )     {}
>
> Since my system uses characters instead of digits, something like
> that would have been very convenient.
> All comments appreciated.

foreach my $char ('A'..'G') {}

works too

- Salva


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


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

Date: Fri, 6 Oct 2000 09:47:45 +0530
From: Pratibha Sundarmurthy <Pratibha.S@in.bosch.com>
Subject: Netscape supports Perl ?
Message-Id: <8rjjs2$p8p$1@proxy.fe.internet.bosch.de>

Hello,
    I am using ActiveState's Activeperl to develop ASP pages.
The pages don't work on netscape...does anyone know if anything has to be
installed/copied to work with netscape ?
    any info is appreciated.

regards,




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

Date: Fri, 6 Oct 2000 00:57:36 -0400
From: "Adam of RWS" <Adam@RealWorldSolutions.net>
Subject: Perl utilizing DBI - Would love assistance!
Message-Id: <39dd5bb3$0$6375@wodc7nh1.news.uu.net>

I'm an experienced programmer relatively new to CGI.  I have written a script in
Perl.  The syntax of the script checks out.  I can't even get warnings from
the -w switch.
When I run the script at the command line a bunch of pretty looking HTML dumps
out including a proper header.  The suggestions I've gotten from friends,
coworkers, and books (Yes, I stooped that low) have led me to try the following:

1) check the header.
    The header is immaculate.

2) flush STDOUT before doing anything else ($| = 1)
    No result.

3) Redirect STDERR to see if I get any error messages.
    I didn't expect this to work since I got no errors from the command line.
    I was right, it didn't give me any errors.

4) check the server error log.
What I got was a bunch of lines that say:
/*my IP*/ - [/*date and time*/] "GET /*my URL*/ HTTP/1.1" 500 546

I can't find any info on what the 546 means, and I can't imagine where else to
go from here.

Also, the script is in a directory that has other CGI files doing similar
actions but aren't using the Perl DBI Module.  This script has the same rights
as the other scripts, so I can't imagine why it won't run.
I know the DBI Module is working because I don't get an error from the script
that the DBI Module is not found. Not even when I run it from the command line.


Any help would be massively appreciated!!!


---Adam

___
  Adam Sroka
  Real World Solutions, Inc.
  http://www.RealWorldSolutions.net
  mailto:Adam@RealWorldSolutions.net





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

Date: Fri, 6 Oct 2000 10:52:00 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Perl utilizing DBI - Would love assistance!
Message-Id: <NpgD5.2255$UW.97974@news010.worldonline.dk>

Adam of RWS wrote:

> I'm an experienced programmer relatively new to CGI.  I have written a
> script in
> Perl.  The syntax of the script checks out.  I can't even get warnings
> from the -w switch.
> When I run the script at the command line a bunch of pretty looking HTML
> dumps
> out including a proper header.  The suggestions I've gotten from friends,
> coworkers, and books (Yes, I stooped that low) have led me to try the
> following:
> 
> 1) check the header.
>     The header is immaculate.
> 
> 2) flush STDOUT before doing anything else ($| = 1)
>     No result.
> 
> 3) Redirect STDERR to see if I get any error messages.
>     I didn't expect this to work since I got no errors from the command
>     line. I was right, it didn't give me any errors.
> 
> 4) check the server error log.
> What I got was a bunch of lines that say:
> /*my IP*/ - [/*date and time*/] "GET /*my URL*/ HTTP/1.1" 500 546
> 
> I can't find any info on what the 546 means, and I can't imagine where
> else to go from here.
> 
> Also, the script is in a directory that has other CGI files doing similar
> actions but aren't using the Perl DBI Module.  This script has the same
> rights as the other scripts, so I can't imagine why it won't run.
> I know the DBI Module is working because I don't get an error from the
> script that the DBI Module is not found. Not even when I run it from the
> command line.
> 
> 
> Any help would be massively appreciated!!!

use CGI::Carp qw(fatalsToBrowser);

Tjeck EVERYTHING you do with your database.

$sth = $dbh->prepare($sql);
die "DB ERROR: $DBI::errstr\n" unless $sth;

etc..

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Fri, 06 Oct 2000 10:33:30 +0200
From: Christian =?iso-8859-1?Q?R=FCggeberg?= <news@sinus-medien.de>
Subject: Perl vs Pegasus Mail (strange things happens)
Message-Id: <39DD8E5A.129AB033@sinus-medien.de>

Hi,

my Script sends a Mail with an Attachment.
If i only send this mail with an uuencoded File (without any header
information)
Pegasus recieves a correct Mail with a correct (readable) Attachment.
Other Mail-Progs don´t rcognize the Attachment because there is no true
header
in this mail.
If I send a correct mail with header and base64 encoded attachment all
the other
mail-progs like netscape, outlook, or also webmail-progs like gmx
recognize
the mail correct, the attachement is readable. Pegasus also recieves a
correct
Mail (...it looks so) BUT the attachment is not readable.
I compared my Script-output with the orig. header inside a correct (from
Pegasus)
sent message, but i don't find any difference....

thanx,
Christian



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

Date: 6 Oct 2000 05:02:16 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: Problem: Line terminator for localhost sockets
Message-Id: <8rjmco$4ot$0@206.230.71.54>

greets perlfolk

i am having trouble with a simple test client/server script, ripped directly
from perlipc. The server runs fine and produces the expected results with my
telnet client. However, when trying to access the server port from my second
client script, the server always gets stuck waiting on a "$_ = <CLIENT>;"
line. It would appear to me that the server isnt finding the expected line
terminator from the client, although, as you can see in the code below, i
use the EOL combination of \015\012 as exampled in perlipc. I have also
replaced them with \r\n, just \n, just \r, and nothing seems to work. The
client prints the expected string with line terminators (i have even
trippled line terminators such as printing "\r\n\r\n\r\n" and it sill doesnt
work)...the client prints the string then it waits for the servers response
with "print <SERVER>". But the server never sends anything because it is
still waiting on the end of the clients line at the "$_=<CLIENT>;" line.

My question is: does anybody have any idea as to what the correct line
terminator i need to send is? Any help would be immensly appreciated.

__DATA__

: perl -v
This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2000, Larry Wall

Binary build 618 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 21:03:54 Sep 13 2000

<snip>


: cat client_test

    #!/usr/bin/perl -w
    use strict;
    use Socket;
    $|=1;
    sub EOL{"\015\012"}
    my ($remote,$port, $iaddr, $paddr, $proto, $line);
    $remote  = shift || 'localhost';
    $port    = shift || 7778;  # random port
    if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') }
    die "No port" unless $port;
    $iaddr   = inet_aton($remote)               || die "no host: $remote";
    $paddr   = sockaddr_in($port, $iaddr);
    $proto   = getprotobyname('tcp');
    socket(SOCK, PF_INET, SOCK_STREAM, $proto)  || die "socket: $!";
    connect(SOCK, $paddr)    || die "connect: $!";
    my $str = "DICT-PING".EOL;
    print "Printing <$str> to socket.\n";
    print SOCK $str;
    print <SOCK>;
    close (SOCK)            || die "close: $!";
    exit;


: cat server_test

    #!/usr/bin/perl
    use Data::Dumper;
    use strict;
    use Socket;
    use Carp;
    sub EOL{"\015\012"}
    sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }
    my $port  = 7778;
    socket(SERVER, PF_INET, SOCK_STREAM, getprotobyname('tcp')) || die
"socket: $!";
    setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR,pack("l", 1))   || die
"setsockopt: $!";
    bind(SERVER, sockaddr_in($port, INADDR_ANY))          || die "bind: $!";
    listen(SERVER,SOMAXCONN)                              || die "listen:
$!";
    logmsg "server started on port $port";
    my $paddr;
    for (; $paddr = accept(CLIENT,SERVER); close Client) {
        my($port,$iaddr) = sockaddr_in($paddr);
        my $name = gethostbyaddr($iaddr,AF_INET);
        logmsg "connection from $name [",inet_ntoa($iaddr),"] at port
$port";
        $_=<CLIENT>; chomp;
        print "GOT: $_\n";
        /^DICT-PING/  && do

         print CLIENT "Ping? Pong! : You are: $name [",inet_ntoa($iaddr),"]
at port $port", EOL;
         next
        };
        # more commands
        !/^DICT/   &&  do { print CLIENT "Erroneous command: $_",EOL;
next };
    }

__END__


--
Josiah Bryan
jdb@wcoil.com

-----------------------------------------------------------------------
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, ¢227,
Any and all nonsolicited commercial E-mail sent to this address
is subject to a download and archival fee in the amount of $500.00 US.
E-Mailing denotes the acceptance of these terms
-----------------------------------------------------------------------






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

Date: 6 Oct 2000 06:29:23 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: Re: Problem: Line terminator for localhost sockets
Message-Id: <8rjrg3$ev5$0@206.230.71.54>

Just FYI:

Hmm i seem to have fixed the problem. It wasnt the line terminator, but the
flushing. I had $|=1 at the top of the client script, but that didnt work
(can anyone explain why? Am i right in guessing that $|=1 just applies to
STDIO or is it supposed to apply to print in general? curious...). So all i
did was use IO::Handle and call "autoflush SERVER 1;" after the print
statement to the server. It now words great. just fyi.

--
Josiah Bryan
jdb@wcoil.com

-----------------------------------------------------------------------
Pursuant to US Code, Title 47, Chapter 5, Subchapter II, ¢227,
Any and all nonsolicited commercial E-mail sent to this address
is subject to a download and archival fee in the amount of $500.00 US.
E-Mailing denotes the acceptance of these terms
-----------------------------------------------------------------------


Josiah <jdb@wcoil.com> wrote in message news:8rjmco$4ot$0@206.230.71.54...
> greets perlfolk
>
> i am having trouble with a simple test client/server script, ripped
directly
> from perlipc. The server runs fine and produces the expected results with
my
> telnet client. However, when trying to access the server port from my
second
> client script, the server always gets stuck waiting on a "$_ = <CLIENT>;"
> line. It would appear to me that the server isnt finding the expected line
> terminator from the client, although, as you can see in the code below, i
> use the EOL combination of \015\012 as exampled in perlipc. I have also
> replaced them with \r\n, just \n, just \r, and nothing seems to work. The
> client prints the expected string with line terminators (i have even
> trippled line terminators such as printing "\r\n\r\n\r\n" and it sill
doesnt
> work)...the client prints the string then it waits for the servers
response
> with "print <SERVER>". But the server never sends anything because it is
> still waiting on the end of the clients line at the "$_=<CLIENT>;" line.
>
> My question is: does anybody have any idea as to what the correct line
> terminator i need to send is? Any help would be immensly appreciated.
>
> __DATA__
<snip/>
<comment>see previous msg for __DATA__</comment>




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

Date: Fri, 6 Oct 2000 11:48:24 +0200
From: "Bas Welvering" <kpn_bw@hetnet.nl>
Subject: Reading textfiles from client?
Message-Id: <OSMglp3LAHA.319@net025s>

Hi,

I want to make a page, with an input field on it, where visitors can select
a textfile stored on their computer.
Then I want to process this textfile, without uploading it, I just want the
textfile to be stored in an array.
Does anyone know how to do this?

Thnx,
Bas




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

Date: Fri, 06 Oct 2000 04:16:33 GMT
From: Somniculosus <xs@korekom.com>
Subject: regex
Message-Id: <8rjjms$e5j$1@nnrp1.deja.com>

Howdy!

How would you compact the following CODE into a one line regex?
(assuming that $line = "Apple: {Apple of discord}, a subject of
contention and envy, so called from the mythological golden apple
etc..";)

--- CODE THAT INTERESTS ME
$line =~ s|{(.*?)}|<a href="$1">$1</a>|g;
($tmp =$1) =~ s/ /+/g;
$line =~ s|<a href="(.*?)"|<a href="http://smthg.com/$tmp"|g;
--- CODE END

Thank you for your help.

--
Cheers,

Peter
---
To know recursion, you must first know recursion.


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


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

Date: Thu, 05 Oct 2000 22:40:24 -0600
From: Bob Deemer <moondoggle1@yahoo.com>
Subject: Rookie Perl Programmer has a question!
Message-Id: <39DD57B8.8DF783D1@yahoo.com>

I am trying to write a Perl Script that will query a webpage and email
the result to me.  I can to the email part KO, but I am not sure how to
get the program to go out and query a given URL and put the result in a
variable.

I need to store the result in a variable first to run it through a
"filter" to manipulate the information received from the URL.

For example, if I execute this script, it would go out and grab a stock
quote from a given URL, manipulate what it receives, and then email the
result to a given email address.

AS stated, I can do the email and manipulation KO, I just need to know
how to get the script to query a given URL.

Please help!

Thank you

   -Bob


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

Date: Fri, 06 Oct 2000 08:30:26 GMT
From: Salva <salvador@my-deja.com>
Subject: Re: Rookie Perl Programmer has a question!
Message-Id: <8rk2j2$pg2$1@nnrp1.deja.com>

In article <39DD57B8.8DF783D1@yahoo.com>,
  Bob Deemer <moondoggle1@yahoo.com> wrote:
> ...
> AS stated, I can do the email and manipulation KO, I just need to know
> how to get the script to query a given URL.

get the LWP package from CPAN and use it!

- Salva


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


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

Date: Fri, 06 Oct 2000 10:59:48 +0100
From: Tim Cockle <T.Cockle@staffs.ac.uk>
Subject: Very simple question.
Message-Id: <39DDA294.FD30BDE6@staffs.ac.uk>

Can I call a perl script from another perl script?

Is so... how?

thanks in advance,

Tim



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

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


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