[11286] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4886 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 13 04:07:20 1999

Date: Sat, 13 Feb 99 01:00:20 -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           Sat, 13 Feb 1999     Volume: 8 Number: 4886

Today's topics:
        bug? 5.004 v. 5.005 <karlon@nortelnetworks.com>
    Re: bugs in dbmopen? <mc@whoever.com>
    Re: change column of nmbers to 2 dim array <rra@stanford.edu>
    Re: Comments in Perl code <rra@stanford.edu>
        General  sort question <corlando@NOTpop.phnx.uswest.net>
    Re: IP Address of Client Machine <stevenhenderson@prodigy.net>
        LWP installation fail .. hup@my-dejanews.com
    Re: newbie Q: subrt in a here doc (Tad McClellan)
        Perl and Solaris 7 for Intel problem <bdensch@ameritech.net>
    Re: perl password example (Randal L. Schwartz)
    Re: PFR: mkpath (Was: Re: How to create a directory usi <dgris@moiraine.dimensional.com>
    Re: PFR: UTC_to_Epoch (Ken Pizzini)
        process groups <a9307048@unet.univie.ac.at>
        Q: ActiveState ppm install failure john_j_willey@my-dejanews.com
    Re: reference problem <ebohlman@netcom.com>
    Re: reference problem (Tad McClellan)
        Search a exemple of script that use Serial Port of Linu (The Cameleon)
    Re: Simple question for a complex PERLie (Tad McClellan)
        Socket timeout not working (Curtis Cameron)
    Re: sockets pault12@postoffice.pacbell.net
        SOLN!: solaris pkg MUST live where it "wants" to! (David Combs)
    Re: Split string (Tad McClellan)
    Re: String Terminator (Tad McClellan)
    Re: String Terminator (Tad McClellan)
        Why does this script hang? <stats9@idt.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 12 Feb 1999 23:47:49 GMT
From: "Karlon West" <karlon@nortelnetworks.com>
Subject: bug? 5.004 v. 5.005
Message-Id: <7a2ej5$6th$1@crchh14.us.nortel.com>


Okay, first a question.  Where can I (or can I) find a list of reported
bugs for a given version of perl?  The list on CPAN says it is no longer
maintained, so I tried a search on dejanews to see if I am reporting a
bug that's already been found.  Oh well, just a question.

Now, in 5.004, the code does what I expect, even though it's poorly
written.  It outputs "1 - 2 - 3 - 4 - " for each letter in the '$_'
string.

In 5.005, it goes into an infinite loop, continuously printing 
"1 - 2 - 3 - 4 - " against the letter "a".

Here's the code:
============================
#!/usr/bin/perl -w
use strict;
$_='a b c d';
my @b=qw/1 2 3 4/;
 
while(m/(\w)\s*/g)
{
   print "$1:";  
   for(@b)
   {
      print "$_ - ";
   }
   print "\n";
}
============================

So, basically, in 5.004, the "m//g" in the while loop is working on the
"global" $_ variable, and the print is printing a "local" $_ variable.

Now, I'm not really sure about 5.005, but I'm guessing that the for(@b)
is perhaps using the same $_ as the "m//g" in the while, so the "/g"
get's confused at it's position, and starts over.

Now, this is all part of a much bigger program, and I just boiled it
down to a small example.  Also, it is rather easily fixed to work in
both 5.004 and 5.005, so, the question:  is everyone aware of this, and
is it fixed (or going to be), or was it a bug in 5.004 that is now
fixed?

Curious,
Karlon


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

Date: Sat, 13 Feb 1999 07:01:49 +0000
From: Martin C Brown <mc@whoever.com>
Subject: Re: bugs in dbmopen?
Message-Id: <36C5235D.7632F793@whoever.com>



Amay Champaneria wrote:

> Has anyone found bugs in the dbmfile implementation found in Perl
> 5.004_04 (for dec alpha)?  I'm using dbmopen and dbmclose in CGI
> scripts, and every now and then a script hangs.

I'm not aware of a problem, but why are you using dbmopen/dbmclose under
Perl 5?

The tie method is preferred, and may be more successful.

--
Martin C Brown
Author, Perl Annotated Archives; BeOS: Porting Unix Applications
mc@whoever.com, mc@mcslp.com, mc@mcwords.com
http://www.mcslp.com, http://www.mcwords.com




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

Date: 12 Feb 1999 23:55:06 -0800
From: Russ Allbery <rra@stanford.edu>
To: perl5-porters@perl.org
Subject: Re: change column of nmbers to 2 dim array
Message-Id: <ylogmyd9gl.fsf@windlord.stanford.edu>

cc'd to perl5-porters

Bart Lateur <bart.lateur@skynet.be> writes:

> "map" is a looping construct. But to stay absolutely clean, you may not
> depend on it being executed in sequence. So the next is bad form too:

> 	my $i = 0;
> 	%map = map { $_ => $i++ } @ary;

> because the phrase "$i++" has a side effect, and you may not depend on
> map applying the block to each array element *in turn*. That may always
> be the case now, but it's not part of the function specification. A
> highly parallel machine might give a few array elements to several
> processors to apply the BLOCK to, (in principle, map allows that), in
> which case the previous code will break.

I think it's safe to say that there is sufficient existing Perl code that
depends on map traversing the array in order that a note that it does so
should probably be added to perlfunc, precisely so that down the road
someone doesn't get the impression that's a valid optimization.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 12 Feb 1999 23:50:58 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Comments in Perl code
Message-Id: <ylr9rud9nh.fsf@windlord.stanford.edu>

Matthew O Persico <mpersico@erols.com> writes:

> I'm using cperl-mode 4.19 and I almost cannot break it. Lord knows I've
> tried. But every time I think it's messed up the indenting or font
> coloring it has turned out to be a typo or a construct that didn't make
> it through perl -c.

> Except for one tiny thing that drives me nuts.

> Pod.

> No let me rephrase that.

> Possessives in pod. As in:

> 	this function's arguments.

> cperl 4.19 reads that as a string start and I get all green text until
> the next random possessive in my pod.

What version of emacs are you using?  I think this is one of the things
that supposed to be fixed by the improved character scanning support in
20.3 (I have the same problem, and even more annoyingly have it with
possessives in heredocs, which make cperl-mode think everything after that
is still in a string, but that's because I'm still using an unpatched
19.34 because I don't want to apply patches to it and because I utterly
detest MULE).

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 12 Feb 1999 23:04:27 -0700
From: "AWKYOU" <corlando@NOTpop.phnx.uswest.net>
Subject: General  sort question
Message-Id: <36c515dc.0@news2.uswest.net>

Given the following as input from a text file:

20555    red    green      1000  250
4678      blue   yellow      500    10004
20555    red    green       850    200
etc         etc      etc           etc       etc

How do I  sum the last 2 fields  by the first 3?

in other words I want the  end report to display

20555  red   green      1850    450

I've manged to accomplish this but I don't trust my hack and any help would
be appreciated.

Thx  In Advance.

P.S. I intentionallly did not post my script  because I'm looking for a true
guru's approach and did not want their mind clouded by my gibberish.














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

Date: Fri, 12 Feb 1999 22:14:23 -0600
From: "Steven T. Henderson" <stevenhenderson@prodigy.net>
Subject: Re: IP Address of Client Machine
Message-Id: <QK8x2.53392$641.87699@news.san.rr.com>

none that i could find. and to make matters worse, providers like AOL change
this number after every request. i would suggest you do whatever it is your
doing another way.



yyy wrote in message <36C4A9E8.83662A8@hotmail.com>...
>I am currently facing a problem in obtaining IP address of a client
>machine that is sending a request to my server. I am using
>$ENV{REMOTE_ADDR} to obtain the IP address of the client. But what I am
>getting is the IP address of the proxy server to which the client is
>connected.
>
>Could anyone please suggest if there is a way out to get the actual IP
>address of the client.
>
>If possible pls reply at rjsing@hotmail.com
>




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

Date: Sat, 13 Feb 1999 08:41:35 GMT
From: hup@my-dejanews.com
Subject: LWP installation fail ..
Message-Id: <7a3dru$tht$1@nnrp1.dejanews.com>

I get a "robot/ua............HTTP Server terminated" at make test when
I try to install it in my RedHat 5.2 box. My perl is:

# perl -v
This is perl, version 5.005 built for i686-linux

I tried both libwww-perl-5.36 and libwww-perl-5.41, get the same error at
robot/ua.

Any help will be appreciated.

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


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

Date: Sat, 13 Feb 1999 01:59:35 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: newbie Q: subrt in a here doc
Message-Id: <7db3a7.4t.ln@magna.metronet.com>

M. Morgan (mmorgan@gladstone.uoregon.edu) wrote:
: I need to have a subroutine or array in a here document.  How is this done?
: I can't find it in the Perl manual.

: print <<HERE;
: some text...
: &show_msg
: more text...
: HERE


   Here docs are double quoted strings (unless you change it), 
   so you get subroutines or arrays interpolated the same way
   you would with a normal double quoted string.

   Arrays are interpolated with the string from the special
   variable $" between each element.

   Subroutines can be interopolated by using a trick that is so
   ugly that I cannot suggest that you use it.

   For subs, you can either put the return value into a scalar
   variable before the here doc, and then interpolate the scalar:


$show_msg = &show_msg;
print <<HERE;
some text...
$show_msg
more text...
HERE


   or, stop and restart the here doc:


print <<HERE;
some text...
HERE

print &show_msg;

print <<HERE;
more text...
HERE


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 12 Feb 1999 23:59:45 -0600
From: "Barry Scott Densch" <bdensch@ameritech.net>
Subject: Perl and Solaris 7 for Intel problem
Message-Id: <fA8x2.45831$ZP5.50347955@nntp0.detroit.mi.ameritech.net>

Howdy,

I am trying to install Perl onto Solaris 7 for Intel. Everything goes just
fine until I do a make...then I get this error message after make runs for a
while:

******************************************************

rm -f libperl.a

ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o dump.o
util.o mg.o byterun.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o
pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o globals.o
perlio.o

make: ar: Command not found

make: *** [libperl.a] Error 127

******************************************************

I've tried everything this newbie can think of. Please help.  I am using
GNUgcc 2.8.1 and GNUmake 3.77.  Both were compiled for i86 pc.

Thanks,

Barry





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

Date: 12 Feb 1999 21:08:45 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: perl password example
Message-Id: <m1zp6idh5u.fsf@halfdome.holdit.com>

>>>>> "Pavel" == Pavel Aubuchon-Mendoza <paubucho@aug.edu> writes:

Bob> Paul, the salt value is chosen randomly.  There are two printable
Bob> characters in the salt, for 4096 possible salt values.
>> I presume you mean "Two characters from the set of [a-zA-Z0-9/.]",
>> but you didn't say that, and I want to make sure that everyone playing
>> along at home knows what you mean too.

Pavel> I don't think that's right... the range [a-zA-Z0-9] is only 62
Pavel> characters, and the square root 4096 is 64...

You're missing two characters there. :) Look closer.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 13 Feb 1999 01:31:10 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: PFR: mkpath (Was: Re: How to create a directory using perl on linux?)
Message-Id: <m3lni24sdt.fsf@moiraine.dimensional.com>

lr@hpl.hp.com (Larry Rosler) writes:

> OK, so here once again (it is already in DejaNews, of course) is my 
> function mkpath, this *last* time for the Perl Function Repository.

I did a little more with it to make it a little more general
while remaining lightweight.  It now accepts a list as argument
and behaves like a builtin.  It returns the number of _paths_
(not directories) created in scalar context and a list of the
created paths in list context.

sub mkpath (@) {
    my @paths = @_;
    my @success;

    for (@paths) {
	m%(.*)/[^/]*$% and mkpath $1 or next until -d || mkdir $_, 0755;
	push @success, $_;
    }

    if (wantarray()) { return @success }
    return scalar @success;
}

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


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

Date: 13 Feb 1999 05:26:37 GMT
From: ken@halcyon.com (Ken Pizzini)
Subject: Re: PFR: UTC_to_Epoch
Message-Id: <slrn7ca34b.803.ken@pulsar.halcyon.com>

On 12 Feb 1999 17:52:07 +0200,
Jari Aalto+mail.emacs <jari.aalto@poboxes.com> wrote:
>    my (@time)    = localtime(time);
>    my $YY        = 1900 + $time[5];
>    my ($DD, $MM) = @time[3..4];
 ...
>    #   I don't know why Month(MM) is one less that the number month
>    #   in my calendar. That's why +1. Does it count from zero?

Yes.  Partially to make it more convenient to index into an array
of month name (or abbreviation) strings, and partially because it
is (trivially) more natural to the localtime() internals.

		--Ken Pizzini


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

Date: Sat, 13 Feb 1999 07:46:06 GMT
From: zeroG <a9307048@unet.univie.ac.at>
Subject: process groups
Message-Id: <7a3ajt$qaq$1@nnrp1.dejanews.com>

Yo,

How do I get the pgid of a process in Perl?
Do all cgi-s spawned by a web server belong to the same process group?

10q

zeroG
*****daviebamikite******

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


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

Date: Sat, 13 Feb 1999 05:51:06 GMT
From: john_j_willey@my-dejanews.com
Subject: Q: ActiveState ppm install failure
Message-Id: <7a33s8$l49$1@nnrp1.dejanews.com>

Several attempts to employ ActivePerl Build 509 ppm 'install' elicit a "Could
not locate a PPD file for ..." failure message.  Since it seems unlikely that
a printer definition file would appear in this context, can someone tell me
what a PPD file denotes?

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


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

Date: Sat, 13 Feb 1999 06:03:57 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: reference problem
Message-Id: <ebohlmanF72wuL.IIA@netcom.com>

Jay Glascoe <jglascoe@giss.nasa.gov> wrote:
: > additionally, I think
: > 
: > ${$node}{$node} = [@name];
: > 
: > is what you're after.

: yeah, right.  Self-proclaimed guru Jay screws it up again...
: It should read like this:

: ${$node}{$node} = \@name;

: the difference is that "[@name]" will actually copy the entire
: list "@name" prior to stuffing it into a reference.

But copying is exactly what you want here, because the contents of @name
change on each pass through the loop.  Your "correction" will store a
whole bunch of references to the *last* things read into @name, which is
surely not what you want. 



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

Date: Sat, 13 Feb 1999 02:05:41 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: reference problem
Message-Id: <lob3a7.4t.ln@magna.metronet.com>

Albert W. Dorrington (awdorrin@mail.delcoelect.com) wrote:


: 	$$node{$node} = @name;

: evaluates @name as a scalar, not an array.  So you aren't
: storing the array into the hash, but the size of the array.
: Your array contains two elements, hence the value of 2 you 
: are seeing in the print statement.

: In order to see the output you are expecting, you would need
: to rewrite the line to store the actual array:
                                   ^^^^^^^^^^^^

: 	$$node{$node} = [ @name ];


   That does not store the actual array.

   That stores a reference to an anonymous copy of the actual array.

   To store a reference to the actual array:

      $$node{$node} = \@name;


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 13 Feb 1999 08:17:45 GMT
From: cameleon@editions-paradyse.com (The Cameleon)
Subject: Search a exemple of script that use Serial Port of Linux => Help Me
Message-Id: <7a3cf9$hfl$1@jaydee.iway.fr>

Hi

I am search a little script Perl on Linux for :

Open a Com Port (exemple cua1)
At a 7E1 (not 8 N 1) 
At 1200 bauds
Sent "atz" and Enter
Wait the answer of the modem
save the answer at one TXT File
close the port

If you can help me thanks ......

(I am new user of Perl)

Bye 

CC by email please



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

Date: Sat, 13 Feb 1999 02:42:50 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Simple question for a complex PERLie
Message-Id: <aud3a7.a71.ln@magna.metronet.com>

Gregg Yows (gyows@globeset.com) wrote:

: Need to replace:

: <tr>
:                 <td>I.F.49</td>
:                 <td>&nbsp;</td>
:                 <td>&nbsp;</td>
:                 <td>Use SSL channel from e-link POS:</td>
:                 <td>&nbsp;</td> <--THIS HERE
:                 <td>&nbsp;</td>
:                 <td>&nbsp;</td>
:                 <td>&nbsp;</td>
:                 <td>&nbsp;</td>
:  </tr>


: Here is what I have. I can't get anything to write to my logfile. 


   You don't have any output statements in that code, so that
   is what you _should_ be seeing for output.

   :-)


: The
: program just hangs.


   I dunno what could be causing that...


: Help me Obi-wan Kenobi-you're my only hope.

   You never told us how to _identify_ which line to change.

   So we will guess. 

   We'll probably guess wrong.

   Better if you just tell us up front...



   The 5th data cell?

   The 5th from the _end_ of the table?

   A cell with non-breaking space followed by 4 identical cells?

   The cell following a cell containing "Use SSL channel from e-link POS:"?

   ...???

   My guess is the last one.


   How's this?

-------------------
#!/usr/bin/perl -w
use strict;

while (<DATA>) {
   if ( m#<td>Use SSL channel from e-link POS:</td># ) {
      print;
      print "<img src=u.jpg>\n";
      <DATA>;                     # discard the next line
      next;
   }

   print;
}

__DATA__
<tr>
                <td>I.F.49</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>Use SSL channel from e-link POS:</td>
                <td>&nbsp;</td> <--THIS HERE
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
 </tr>
-------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 13 Feb 1999 05:38:58 GMT
From: curtisc1@cyberramp.net (Curtis Cameron)
Subject: Socket timeout not working
Message-Id: <36cc0ea1.6801043@newshost.cyberramp.net>

Hi All,

One of the things my web page does is to open a socket connection to
another computer. I would like the "connect" to timeout after 10 or 15
seconds, since that's enough time to determine that the other computer
isn't there, and I don't want a user waiting three or four minutes to
see the results on his web request.

So I've tried two different methods which I learned from the perl
newsgroups. I've tested them successfully on an HP-UX system running
NCSA/1.2 (both work great). However, it needs to be on another server,
a Sun running Apache/1.2.6 and Perl 5.004_04, and neither technique
will timeout after just 10 seconds on that system. The scripts both
work, except that if they timeout, they do so after a few minutes
instead of the 10 seconds I want.

Is there a limitation of this Apache version?

Posted below are the perl programs.

thanks,

Curtis Cameron

# ----------------- perl technique #1 - $SIG{"ALRM"}
my ($timeout,$connect);

sub connectserver
  {
  $SIG{"ALRM"} = 'sig_alrm_connect';
  alarm 10; $timeout = 0;              # timeout after 10 sec
  $connect = connect(SOCK, $_[0]) ? 1 : 0;
  $SIG{"ALRM"} = ''; alarm 0;          # reset ALRM trap
  ($connect,$timeout);
  }

sub sig_alrm_connect { $timeout = 1;}

$port = 3634;
$iaddr = inet_aton($ip)  || seterror("Computer not found: $ip");
$paddr = sockaddr_in($port, $iaddr); 
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto); 
connectserver($paddr); 
close(SOCK); 
if ($connect == 0)  {  if ($timeout == 1) { seterror("The socket
timed out before a connection to the computer was made.") }  
else { seterror("Socket error: $!") }



# ----------------- perl technique #2 - IO::Socket
use IO::Socket;

$sock = new IO::Socket(
    PeerAddr => $ip,
    PeerPort => 3634,
    Timeout  => 10,      # seconds
    Domain => AF_INET,
    Proto => 'tcp'
) or die "$@";
print "I guess we connected!\n";



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

Date: Fri, 12 Feb 1999 23:22:22 -0800
From: pault12@postoffice.pacbell.net
Subject: Re: sockets
Message-Id: <36C5282E.81074CD5@postoffice.pacbell.net>

Hi,

 0. Consider installing ODBC drivers on UNIX box. If not:

  1. http://www.pault.com/ -> Perl Application Server -> Docs -> Pictures
      I have added 'Unix / Windows example'.  just a couple of hours ago ;-)

  2. Download PAS Build 2.

  3. Be sure both UNIX and NT boxes have perl executables ;-)

  4. Hack pas.pl in 1 (one) place to allow incoming connections not
      only from 127.0.0.1  'hack' means - disable appropriate 'if ;-)

  5. Place Pas.pm to UNIX box and start pas.pl on NT box..

  6. In case of troubles - check latest PAS code - it's always available
  online on www.pault.com  - or write me about your problem.

  Perl behaviour with sockets is _strongly_ platform / build dependent and
  sometimes looks crazy (not talking about simple cases).  But it's possible to
make
  perl sockets work.

Rgds.Paul.

chrisNOSPAMPLEASE@atg-design.co.uk wrote:

> Hi,
>
> Firstly I have never used sockets before...I have read the perldocs, which
> have shedded *some* light but am still no nearer to solving my problem.
> (btw..remember..you must have been in this position once????)
>
> What I'm wanting to do is use sockets to execute a perl/ODBC script on NT4,
> which connects to an Oracle8 database (this script is already written and
> works), and pass the results back to UNIX.
>
> ...but I have no idea where to start..what port I need to use..in fact how to
> go about it...
>
> does anyone know any URL's that explain how to achieve this scenario, or can
> anyone point me in the right direction who has done this before?
>
> Even a script to connect up to NT4 and print the system time would be a start
> and would help me...
>
> Many TIA
>
> Chris
> -=-=-
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own





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

Date: Sat, 13 Feb 1999 05:02:40 GMT
From: dkcombs@netcom.com (David Combs)
Subject: SOLN!: solaris pkg MUST live where it "wants" to!
Message-Id: <dkcombsF72u0G.47v@netcom.com>

Thanks for that response.

Yes, it was pkgadded wrong, via a "-a admin" file.


You evidently MUST look at the first 100 or so lines
of a "package" and discover where the builder of the
package wanted it to go, and then install it THERE.

Otherwise, won't work, won't find things -- as replies
suggested.

I didn't want to put it into /usr/local/, because there
wasn't a whole bunch of disk space.

So, finally getting some brains in my head, I made a
symbolic of /usr/local, to a place that DID have a
whole bunch of space.

Works fine.

(not so speedy starting up, that 5.00502)

David



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

Date: Sat, 13 Feb 1999 00:10:52 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Split string
Message-Id: <c153a7.e6.ln@magna.metronet.com>

Professeur Alfred (ughridk@bbbhotmail.com) wrote:
: I'm a novice in Perl programming. I would to know how to split a string on
: the '?' character.
: I tried to do it this statement but it doesn't work:
: ($address,$search) = split (/?/, $variable);

: I think the problem is that Perl interprets the '?' as a wild card and not
: as a character.


   You think correctly.


      ($address,$search) = split (/\?/, $variable);


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 13 Feb 1999 00:55:01 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: String Terminator
Message-Id: <5k73a7.nf.ln@magna.metronet.com>

Gala Grant (gala@sonic.net) wrote:
: I have a script with this in it:

: print <<"_END_";
: </BODY>
: </HTML>
: _END_

: when I compile the program it says that the string terminator _END_ couldn't
: be found before the end of the program.  Obviously it is there, so I figure
: it is some other problem with the script.  

: I seem to remember seeing
: something like this once before.  Does anyone have any idea what I am doing
: wrong?


   I think what you are doing wrong is not checking what the docs
   that came with your perl say about the message that perl is
   giving you  :-)

   The 'perldiag.pod' man pages describes all of the messages that
   perl might issue.

   For your message it says:

---------------------------
=item Can't find string terminator %s anywhere before EOF

(F) Perl strings can stretch over multiple lines.  This message means that
the closing delimiter was omitted.  Because bracketed quotes count nesting
levels, the following is missing its final parenthesis:

    print q(The character '(' starts a side comment.);

If you're getting this error from a here-document, you may have
included unseen whitespace before or after your closing tag. A good
programmer's editor will have a way to help you find these characters.
---------------------------


   You often get this message when you have transferred program files
   between different Operating Systems without changing the line
   endings to match the target OS.

   FTP has "ASCII" (or "text") mode for if you want it to fix the
   line endings for you.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 13 Feb 1999 02:03:00 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: String Terminator
Message-Id: <kjb3a7.4t.ln@magna.metronet.com>

Tony Curtis (Tony.Curtis+usenet@vcpc.univie.ac.at) wrote:
: Re: String Terminator, Gala <gala@sonic.net> said:

: Gala> I have a script with this in it: print
: Gala> <<"_END_"; </BODY> </HTML> _END_


   Something screwed up the quoted code there...


: Gala> when I compile the program it says that the
: Gala> string terminator _END_ couldn't be found

: try it as

:     print <<_EOT_;
:     ...
:     _EOT_


   That has semantics identical to the original.

   So that can't be it...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 12 Feb 1999 23:47:54 -0800
From: Chris Plachta <stats9@idt.net>
Subject: Why does this script hang?
Message-Id: <36C52E2A.59B694C@idt.net>

Hello,

I am having an unusal problem with a script that I use to start my ppp
connection in linux.

The script is called "ppp-go".

I have created a group called "pppusers" that I want to change to before
initiating the ppp connection,  but when I do this in the script, the
script hangs:

# This line gets printed
($db{'Debug'} <= 2) && print STDOUT "Changing group to pppusers...";
# HANGS HERE
``/usr/bin/newgrp pppusers`;
($db{'Debug'} <= 2) && print STDOUT "Changed group to pppusers...";

If I run "ppp-go" directly, or even "ppp-go&", it hangs.

However, if I create a shell script called "connect", that contains:

#!/bin/sh
 ./ppp-go &

It works fine.

WHY?

Thanks!

Chris



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

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

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