[7261] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 886 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 18 16:17:13 1997

Date: Mon, 18 Aug 97 13:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 18 Aug 1997     Volume: 8 Number: 886

Today's topics:
     about using CGI.pm <yinso@secure.global-sight.com>
     Re: Adding Modules for Distribution <ajohnson@gpu.srv.ualberta.ca>
     Re: Binary I/O: simple question? xewj@odin.sunquest.com
     Re: Broken pipes and Perl <psrc@corp.airmedia.com>
     Changing a URL from a perl script (Keith Sullivan)
     converting text records into a flatfile and indexes? (ShadowMAC Administrator)
     Cookie...... <devli002@gold.tc.umn.edu>
     Re: Database (Mike Stok)
     Re: emacs?  No thank you <jpm@iti-oh.com>
     GUI <jpm@iti-oh.com>
     help - MSAccess/PERL/OLE?? (Richard/Barbara Males)
     Help with Perl hooks on INN 1.5.1, please (Andrew Cormack - COMPG)
     Help with writing perl extension: perl bug or my bug? (Uwe Hollerbach)
     Re: How do I find the system date/time? (Marcantonio Fabra)
     Re: how to parse only the lines between <pre> and </pre <jpm@iti-oh.com>
     Re: NT Perl Sources and problem (Parillo)
     Re: Opening to Telnet without System() <jay@rgrs.com>
     Pattern repacement with variables question <vincent.busam@ngc.com>
     Re: Pattern repacement with variables question <rra@stanford.edu>
     Re: Perl 5.004 and dbmopen (Chris Nandor)
     Perl for Win32 and COM port calls (Dan Greenblatt)
     Re: perl5 regexes slower than perl4? (Andrew Dalke)
     pipe by line <ule@uni-muenster.de>
     Re: Q: assoc. arrays as subroutine argument <bsugars@sunpub.com>
     reading remote files <dmoss@instinet.com>
     Re: SelfLoader and -T (Randy J. Ray)
     Re: Telnet problems <jay@rgrs.com>
     Which versions of Oraperl and Perl??? dean.pompilio@cna.com
     Re: Which versions of Oraperl and Perl??? (Mike Stok)
     Win32 Perl & UNC names - Problem? (Clem Dye)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 18 Aug 1997 10:13:08 -0700
From: Car'a'carn <yinso@secure.global-sight.com>
Subject: about using CGI.pm
Message-Id: <33F882A4.41C6@secure.global-sight.com>

Hi, Dear Perl Gurus,

sorry to ask this seeminly silly questions, but if you are willing to
answer it, plz do, I appreciate any input you have.

I am trying out the OOP feature of perl5, and I start out with using the
CGI.pm.  Basically, I was trying to convert my old CGI scripts with the
CGI.pm, and I was hoping that when I invoke the script, it will
automatically send out a message that tell me the script is working. 
The script looks like this,

#!/usr/local/bin/perl5

use CGI;

$query = new CGI;

print $query->header;
print $query->start_html("Example Code");
print $query->startform;
print "<h1>Show me this script is working.</h1>\n";
print "<b>What's your name? </b> $query->textfield('name')\n";
print "<b>query->submit('action', 'submit');
print $query->endform;
print $query->end_html;

I thought this should be quite standard, so I try to run it, both on the
command prompt and the web server.  However, on the command prompt, I
got a line like this:

(waiting for standard input)

and on the web server, I got a server error that states "there has been
a misconfiguration so the server cannot complete your request... ". 
Now, if you can take look at the code and tell me if I have done
anything wrong with it.  The version of perl5 that I have is 5.002, and
the CGI.pm version is 2.16.  

Again, thanks for any input that you have :)

Sincerely,

Yin-So


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

Date: Mon, 18 Aug 1997 11:26:09 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Adding Modules for Distribution
Message-Id: <33F877A1.CBDA861@gpu.srv.ualberta.ca>

Tom Phoenix wrote:
> 
> On 18 Aug 1997, Clark Dorman wrote:
> 
> > Installing perl itself is pretty easy, since I just tell them to do the
> > ./configure, make, make install, and it works (at least in the one case
> > I have tried).
> 
> Don't forget to 'make test'! That only takes a moment, and it can save you
> a lot of trouble in the long run. (In fact, you can save even more time by
> simply replacing 'make' with 'make test' in your sequence above, rather
> than doing the tests as a separate step.)

However, the INSTALL file explicitly recommends doing a 'make' before doing
the 'make test'

   =head1 make test

   This will run the regression tests on the perl you just made (you
   should run plain 'make' before 'make test' otherwise you won't have a
   complete build).

and since installation is not likely to be a frequent event, I don't think
its worthwhile to try to take shortcuts to save a few minutes at that
stage of the game.

regards
andrew


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

Date: 18 Aug 1997 17:13:34 GMT
From: xewj@odin.sunquest.com
Subject: Re: Binary I/O: simple question?
Message-Id: <5t9vru$4vp$1@iggy.sunquest.com>

In article <yat90y34jaq.fsf@ppdpi4.nrl.navy.mil>,
Peter E. Pulsifer <pulsifer@ppdpi4.ppd.nrl.navy.mil> wrote:
>As part of my intro to perl, I'm writing a Base64 decoder.  The decoding
>is easy, but now how do I get the results out?  When I print, perl writes
>the ASCII representation of the character, not the actual binary number.
>That is, if the number I decode is 65, it writes '65', not 'A' as it ought.
>I tried syswrite, but this does the same thing.

this is what it's supposed to do.

>In desperation, I've tried masking each byte and concatenating into a string
>using chr($num) - which I would think would be pretty slow.  And perl 4
>doesn't seem to recognize chr().  Is there a better/more universal way to
>write in binary????

(1) get perl5

(2) pack() the data



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

Date: Mon, 18 Aug 1997 13:54:56 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
Subject: Re: Broken pipes and Perl
Message-Id: <33F88C70.3208@corp.airmedia.com>

Arielle Sumits <arielle@mit.edu> wrote:
> What defect in a perl cgi script could cause a broken pipe error?

Writing to a pipe, or socket, or command (open(FD, "| command")) that
gets closed on the other side before you stop writing to it.

Your Web server might (for some reason) prematurely close its connection
to your CGI scripts, in which case your CGI scripts could get a "broken
pipe" writing to STDOUT.

You can stop broken pipes from being a fatal error by catching the PIPE
signal. You don't have to do anything in the catch routine. (I've heard
that ignoring PIPE doesn't do the trick.) If you catch PIPE, your calls
to "print" and "syswrite" (and maybe "close") and such will fail and
return undef; it would be a very good idea to start checking the return
codes of those functions. I would tend to use syswrite, so buffering
wouldn't mask exactly when the error occurred. Your milage may vary.
--
Paul S. R. Chisholm, AirMedia, Inc.     (formerly Ex Machina)
mailto:psrc@corp.airmedia.com  http://corp.airmedia.com/~psrc
 I'm not speaking for the company, I'm just speaking my mind


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

Date: 18 Aug 1997 19:03:52 GMT
From: sull@au8.ecn.purdue.edu (Keith Sullivan)
Subject: Changing a URL from a perl script
Message-Id: <5ta6ao$r7e@mozo.cc.purdue.edu>

I am having trouble changing the URL from a perl script.  What I want to 
happen is the following: a user answers a question, and they are taken
to one of two locations.  The new location depends on the answer to the
question.  The question is a simple form which utilizes two radio buttons.  In other words, go here if answer one is checked, else go there.  Currently, all that happens is a error 500: Sever Error.  The code will parse when I use perl -c.  Here is the code: 

#! /usr/local/bin/perl 

require 'cgi-bin.pl';
&ReadParse (*in);

MAIN: { 
	if ($in{'ferttype'} eq "dry") { 
		print "Location: http://pasture.ecn.purdue.edu/~sull/assess/fert/dry.htm\n\n";
		exit; } 

	else {
		print "Location: http://pasture.ecn.purdue.edu/~sull/assess/fert/liquid.htm\n\n";
		exit;}
		
}		

Any help would be appreciated.  

Thanks,
Keith Sullivan
sull@ecn.purdue.edu


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

Date: Mon, 18 Aug 1997 13:29:05 -0600
From: admin1@ShadowMAC.org (ShadowMAC Administrator)
Subject: converting text records into a flatfile and indexes?
Message-Id: <admin1-ya02408000R1808971329050001@news.winternet.com>

Looking for suggestions on how to convert or compile individual records
(which are one record = one textfile) into a flatfile containing all of the
records spread thru out our directory tree.

These textfiles are actually binaries encoded into a textfile format very
similar to the UUE format, with the top of each file containing the data
relating to that particular encoded file.

Each textfile has 50 fields of text, each field is seperated by the unix
EOL, and has no more than 75 characters per field.

These textfiles are spread out over a wide directory tree which is standard
for any filesite.

1st, I need to create directory index.tab files inside each dir, with one
index.tab containing tab delimited copies of those textfile's individual
records relating to the textfiles within the same dir as the index.tab is
in, and create one index.tab per dir.

2nd, I need to create a single master tab delimited index called
allfiles.tab which will be a compilation of all of those seperate index.tab
files, the only differences between the index.tab's spread out over the dir
tree and the allfiles.tab is that the allfiles.tab is to contain a copy of
all of the records over the whole dir tree AND have a field appended to the
beginning of each record which reflects the filepathing pointing towards
the respective individual textfile's location.

3rd and lastly, I need to create a file exactly like the allfiles.tab
called newfiles.tab which will only contain records of files uploaded
during the current month, there is a field which states the upload date in
each record so this should not be a big deal.


Ideas?  Pointers?  Suggestions?

-- 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
|        Mac file archives, you want Mac archives?        |
|        Then stop by ShadowMAC for a look around!        |
|                                                         |
|        anonymous ftp in via:  ftp.ShadowMAC.org /pub    |
|  or set your web browser to:  http://www.ShadowMAC.org  |
|   ShadowMAC's IP address is:  198.174.169.112           |
| Questions or Problems Email:  admin@ShadowMAC.org       |
|                                                         |
|   Supporting the Mac in all its incarnations;           |
| Mac (680x0), Newton, PowerBook, PowerBook,              |
| PowerMac (PPC Mac), and Mac clones!                     |
|                                                         |
|        Freely supporting the Mac thru donations!        |
|                                                         |
|                    S h a d o w M A C                    |
|               Twin Cities, Minnesota  USA               |
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+


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

Date: Mon, 18 Aug 1997 14:24:54 -0700
From: John Devlin <devli002@gold.tc.umn.edu>
Subject: Cookie......
Message-Id: <33F8BDA6.ADD@gold.tc.umn.edu>

How do I get the cookie in Perl?

Thnaks......JOHN


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

Date: 18 Aug 1997 19:08:56 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Database
Message-Id: <5ta6k8$j10@news-central.tiac.net>

In article <33F872C4.D9D@bentley.com>,
Ed Vander Bush  <temp.ed.vanderbush@bentley.com> wrote:
>I need to construct a database in perl that I can use to search one
>column and then select a row from. Any resources I can go to or
>examples???/

http://www.perl.com/CPAN/modules/by-category/07_Database_Interfaces/ 

might be a place to look, Sprite is relatively simple and the readme file
tells you where to foind some examples, if you want to move up a notch
then using DBI (database interface) and DBD (database driver) modules on
top of a free or not so free SQL database might be worthwhile, see
http://www.hermetica.com/technologia/perl/DBI/

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Mon, 18 Aug 1997 13:08:08 -0400
From: Joshua Marotti <jpm@iti-oh.com>
Subject: Re: emacs?  No thank you
Message-Id: <33F88178.60D9CE8D@iti-oh.com>

Actually, an xemacs emulater called Jed has a win32 port.  It's
(cleverly) called w95jed.  I forgot where I got it, but search and ye
shall find...
I also have a friend who uses Zeus, which is a win32 based (like has
smart buttons and such like word), which also has a Perl mode with
syntactical coloration, and other features.
Hope this helps,
Josh Marotti




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

Date: Mon, 18 Aug 1997 13:20:54 -0400
From: Joshua Marotti <jpm@iti-oh.com>
Subject: GUI
Message-Id: <33F88476.CB3B26CF@iti-oh.com>

Here is a question that is probably in the FAQ, or has already been
asked, so I will apologize ahead of time, but here goes :
Is there any way to create some type of menuing system (win32, or even
command line that recognizes the arrow keys) within Perl.  The best way
(I was told) was to create a GUI in Visual BASIC, or Visual C++, and
have a perl batch file for each command, and each time something was
selected in the GUI, have the GUI run the command line Perl script.
This is very unprofessional, and rather tedious...
Any help is much appreciated,
Thanks ahead of time,
---------------------------------------------
Joshua Marotti
"PERL and Doughnuts are my life!"
---------------------------------------------




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

Date: 18 Aug 1997 18:47:18 GMT
From: males@iac.net (Richard/Barbara Males)
Subject: help - MSAccess/PERL/OLE??
Message-Id: <5ta5bm$u4$1@ocoee.iac.net>

Have searched faq's, dejanews, admit my ignorance - I know some PERL, 
some Access, no OLE, but gather that adding records to an MDB is
supposed to be straightforward via OLE.  Tried the following, no luck.

When I run this script (put together from previous suggestions/examples
on this group), I get the error about 'cannot call method openrecordset
without package or object reference'

Would appreciate any advice as to the nature of the problem.  All I really
want to do is add records to a table from a perl script, via OLE.


use OLE;
$application = CreateObject OLE  'Access.Application'
               or warn "Couldn't create new instance of Access95!!";
$application->{'Visible'} = 1;
$dbEngine = $application->DBEngine;
$db = $dbEngine->OpenDatabase("perltst1.mdb");
print "ok to open database\n";
$rsTableTest = $db->OpenRecordset("tblTest1", 2);
print "ok to open recordset\n";
#$rsTableTest->AddNew;
#$rsTableTest->{SampleID} = 1;
#$rsTableTest->{SampleText} = "bubba";
#$rsTableTest->Update;
#$application->Quit();

output is:

C:\NPLIM\perl>perl access1.pl
ok to open database
Can't call method "OpenRecordset" without a package or object reference at acces
s1.pl line 8.


Thanks in advance.

Dick Males
Cincinnati, Ohio, USA



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

Date: Mon, 18 Aug 1997 13:52:46 GMT
From: cormack@cf.ac.uk (Andrew Cormack - COMPG)
Subject: Help with Perl hooks on INN 1.5.1, please
Message-Id: <EF43vy.5D7@cf.ac.uk>

I'm trying to write a Perl filter_nnrpd.pl program which will check
that the headers on locally posted news articles contain valid return
mail addresses. This is working fine, except when I try to attach to
the DBM file which contains the list of valid addresses, the following
appears in the news.notice log file:

nnrpd[6075]: Perl function filter_post died: AnyDBM_File doesn't define \
	a TIEHASH method at /usr/news/bin/control/filter_nnrpd.pl line 120
nnrpd[6075]: peth.comp.cf.ac.uk perl filtering disabled

The offending code seems to be a call to dbmopen(), since the filter works
fine if I comment that out. However if I write a main program to call the
filtering routine, and run that on its own on the same machine, it works
fine, even with the dbmopen() call.

I'd be very grateful for any suggestion what the difference might be
between running my routine stand-alone and as a INN subroutine,
especially if someone can suggest what I need to add to my program to
make it work. This is Perl 5.004, by the way.

Thanks,
Andrew
--
       +-----------------------------------------------------------------+
       | Andrew Cormack               | email: cormack@cardiff.ac.uk     |
       | Information Systems Support, | snail: 40/41 Park Place, Cardiff |
       |    postmaster and webmaster  |        CF1 3BB                   |
       | University of Wales, Cardiff |                                  |
       +-----------------------------------------------------------------+



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

Date: 18 Aug 1997 17:21:58 GMT
From: uweh@bu.edu (Uwe Hollerbach)
Subject: Help with writing perl extension: perl bug or my bug?
Message-Id: <5ta0bm$stk$1@news1.bu.edu>

G'day, folks, I have a question for your collective wisdom. Let me
first describe the background very briefly... I have a perl
application which needs a tiny bit of rather specialized data
compression, which needs to go fast. Rather than do it directly in
perl, I thought I'd write a small perl extension --- I've done that
once or twice before, it's not a great big deal. I did that, and I
think I got it pretty much correct, but on one or two machines I'm
encountering an error I can't explain. On my Linux machines
(2.1.<mumble> kernel, recent libraries) and on an SGI machine (Irix
5.3), one particular test fails, but not as far as I can tell in any
of my code; on an HP machine (HPUX 9.05) and on an ultrasparc running
Solaris 2.5.1, the same particular test succeeds. I enclose a small
uuencoded gzipped tar file which contains a shortened version of my
extension. Rather than bore you with the exact compression/expansion
code, which is moderately large, I've put in stubs which just copy
every other character for a compression ratio of 2. In the file NFC.xs
there is a comment showing where things go wrong. It's in one
particular case in the routine expand_into. I have verified that *at
the location of that comment*, all is well with the expanded string (I
checked this by writing the output data to a file at that point); but
in the perl test routine NFC_test.pl, expand_into test 2 fails.  Oh
yes, I should mention that this was uniformly perl 5.003_95 on all the
machines I tested. I would be grateful if someone who knows more than
I do about perl's internals could take a look and see if this is my
mistake (and if so, what my mistake is), or if this is a bug, or ...?

To run things, unpack the tar file; then

	perl Makefile.PL
	make
	perl -w -Iblib/arch NFC_test.pl		# no need to install *this*
						# extension!

and compare the output you get with that in the file sample_output.

Thanks!

Best,
Uwe Hollerbach

begin 600 ext_test.tar.gz
M'XL("!6#^#,"`V-O;7!T97-T+G1A<@#M&FM3VTB2K]:OZ"7D+(.Q)3]W\;(5
M8IP]#HPIVV1S=;E2"7ELJR)+CC3"N+;X[]<S(\GR`W!R"=SFI@L8J:>[I[MG
MNJ=G4/OD\NQ=J]??^8Z@:UI-TV`'`,IZC;=ZI<);#GJI#%`KUVM:O5Y'`M"U
M<KV\`]K.,T`84-,'V`EGY`DZX@<[/QRTH_E7VN8G,K0=4KBZ4"[?-0O3"6_N
M`M88E`2T,'44RYM,?1($!6OQ.%8"<S)UB.&%=!I294?"7VC^%]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NS-TGU6(2TC(?UJ[\#;7+:EFX2Z?/;3RXO:J5+U9U9>34J6QEQ3VU)OC2
MC89H/"9772S+AP9X>CVL+N^TQ_GXB4H/KH<EE5(N?E2S\C?4+*MMM1B^2L_*
M%^KY,O7?XH..E_O_7[U:3>I_7==X_2_O_Y_[_G_I&I\MZ62#73E3XXD;BZ\\
MOP>.+X962-@M`-+D%%'2<LJX2L6HBB[.#J.'UZ6E:MY.JO58SL$!,D7C'ASP
M$EV\L!H6#H^A%!=>[&_,Q>+[(_M/'[]%)C3T7;5I]*Z;S5;KU&B];UUBU-T+
M6Z.M_K^V=+G7LB*C8\NXC,/#Q$#+6C%LR6+&OHY9-Y1W;6/J8_$_?KGX+U<K
MR?<_U5J9QW]5?O_W3/$_9.<7:';:5]U6KV?\77DESC-IU`+'KVHS&2V%B9=9
MY_0THV_`L^67*3V>4WB,K047+MJ'@_-!%N45<0=X(BWNITQ@]Z'R:Y]U6/IT
M\V7B'[=\+=G_:[4J^R!8U^3W?\]:_T7'BDQFY:ZG6L\LW]\H2Z??-7I=KZPR
M;#[2:LKF4VCI:0TV'Q"_CK&R%>.F\Y>F;#HTE1YSR/*]EJ(#;GRDHI18.R1*
M&6J_@/:+4F%M15.J4-)8?XVUV%^'>IGU_\Q:[-=U?#6A_C,^5=B3MD&G\A,Z
M/61A93L^F4$E2)`@08($"1(D2)`@08($"1(D2)`@08($"1(D2)`@08*$EX?_
)``JT#"8`4```
`
end

-- 
Uwe Hollerbach, Ph.D.                                 uweh@bu.edu
Simulation of Semiconductor Device                    uh@alumni.caltech.edu
Manufacturing & Performance
Dept. of Manufacturing Engineering, Boston University, Boston, Mass.


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

Date: Mon, 18 Aug 1997 14:43:06 -0200
From: fabra@ax.apc.org (Marcantonio Fabra)
Subject: Re: How do I find the system date/time?
Message-Id: <5ta1df$dnm@ax.apc.org>

David Anderson <IMS@wwwebspace.co.uk> wrote:

>I'm writing a CGI script but don't know any commands to find the system
>date/time. Can anyone help?

>    David Anderson

Hello,

I use a script that takes the date/time system and show me it in html format.
Here's it :

#!/usr/local/bin/perl
# time.pl
 
@months = ("January","February","March","April","May","June","July","August",
           "September","October","November","December" );
 
print "Content-type: text/html\n\n";
 
print "<HTML><HEAD>\n";
print "<TITLE>The Current Date and Time</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<H1>The Current Date and Time</H1>\n";
 
print "<HR>\n";
 
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
 
print "Today's date is: <B>$months[$mon] $mday, 19$year</B><BR>\n";
print "The Current time is: <B>$hour:$min:$sec</B>\n";
 
print "</BODY></HTML>";

Hope it can help you.

Regards,

            Marcantonio Fabra



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

Date: Mon, 18 Aug 1997 13:11:43 -0400
From: Joshua Marotti <jpm@iti-oh.com>
Subject: Re: how to parse only the lines between <pre> and </pre>
Message-Id: <33F8824F.AB2FD40E@iti-oh.com>

Geez... I would simply do this :
while ($line = <FILEHANDLE>)
{
    if ($line =~ /<pre>/)
    {
        while ($line !~ /<\\pre>/)
        {
            #do your work here...
            $line = <FILEHANDLE>;
        }
    }
}




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

Date: 18 Aug 1997 18:39:48 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: NT Perl Sources and problem
Message-Id: <5ta4tl$36d$1@news01.li.net>

There is a gethostbyaddr function.
It does not return the username, but you can get the host name.
Unfortunately for me, only about 10% of the time.

lparillo at suffolk dot lib dot ny dot us

Kitty Smith (smith@twsuvm.uc.twsu.edu) wrote:
: I am looking for NT Perl sources on the Web.  In particular, I am
: looking for some way to determine the username of the person accessing
: the page, as opposed to their IP address.  Is this possible?  There
: are all kinds of ENV variables for the server, but I didn't see
: anything for the client apart from their IP.

: Thanks for any help you can provide.

: Kitty Smith



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

Date: 18 Aug 1997 14:13:46 -0400
From: Jay Rogers <jay@rgrs.com>
To: drop@presence.lglobal.com (Colin P. Ryan)
Subject: Re: Opening to Telnet without System()
Message-Id: <82iux3xsth.fsf@shell2.shore.net>

drop@presence.lglobal.com (Colin P. Ryan) writes:
> I an looking for a solution to a problem with Perl5.003 in the NT
> 4.0 environment.  I want to telnet to port 80 of a server issue a
> GET and close the connection via a perl program. Normally I would do
> something like
> 
> open(TNET,"|telnet xxx.xxx.com");
> print TNET "GET http://xxx.xxx.com");
> close (TNET);
> 
> However this is in NT environ and there is no command line telnet.
> Anyone have any suggestions.

You can use the module Net::Telnet.  On a Windows NT machine, it works
with the latest 5.004 version or with ActiveWare's 5.003 port.

Since you're connecting to an http port, you should look at the LWP
modules.  I believe they only work with the latest 5.004 version on an
NT machine.

Here's how you'd use Net::Telnet to read from an http port:

    use Net::Telnet ();
    $obj = new Net::Telnet (Timeout => 20);
    $obj->open(Host => "www.perl.org", Port => 80);
    
    $obj->print("GET /");

    while (! $obj->eof) {
        push @lines, $obj->getline;
    }
    
    print @lines;

--
Jay Rogers
jay@rgrs.com


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

Date: Mon, 18 Aug 1997 11:48:26 -0700
From: Vince Busam <vincent.busam@ngc.com>
Subject: Pattern repacement with variables question
Message-Id: <33F898FA.231731EC@ngc.com>

I want to perform pattern replacement based on variables which contain
backreferences.  Similar to :
$test = "one two";
$match = '^([^ ]+) +([^ ]+)';
$replace = '$2 $1';
$test =~ s/$match/$replace/;
print "$test\n";

The output is:
$2 $1

instead I'd like to see:
two one

Any suggestions?

Vincent Busam
vincent.busam@ngc.com




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

Date: 18 Aug 1997 12:18:06 -0700
From: Russ Allbery <rra@stanford.edu>
To: Vince Busam <vincent.busam@ngc.com>
Subject: Re: Pattern repacement with variables question
Message-Id: <m3d8nbb8r5.fsf@windlord.Stanford.EDU>

[ Posted and mailed. ]

Vince Busam <vincent.busam@ngc.com> writes:

> $test = "one two";
> $match = '^([^ ]+) +([^ ]+)';
> $replace = '$2 $1';
> $test =~ s/$match/$replace/;
> print "$test\n";

> The output is:
> $2 $1

> instead I'd like to see:
> two one

Change the substitution line to:

        $test =~ s/$match/$replace/ee;

-- 
#!/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: Mon, 18 Aug 1997 14:08:52 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl 5.004 and dbmopen
Message-Id: <pudge-ya02408000R1808971408520001@news.idt.net>

In article <5t58du$gm9$1@darla.visi.com>, Marvin Malkowski Jr.
<marv@home.dwave.net> wrote:

# I was writing this program under perl 5.004 and was forced to updrade to
5.004.
# Now my scripts when I do the dbmopen creates two files links.dbm.dir and
links.dbm.pag
# and I have no clue why.
# Listed below is my code:
# 
# $database="/home/halogen/scripts/links.dbm";
# $textfile="/home/halogen/scripts/database";
# 
#
#///////////////////////////////////////////////////////////////////////////
////////
# sub createdatabase 
# {
#  #//Assign variables names
# 
#  open(FILEHANDLE, $textfile);
#  dbmopen (%links, $database, 0666) or die;
#  $count=1;
# 
#  while(<FILEHANDLE>)
#  {
#   ($sitename,$linkname,$desc,$name,$emailcontact,$location,$valid) =
split(/\|/, $_);
#   print "$sitename,$linkname,$desc,$name$emailcontact,$location,$valid\n";
#   $links{$count} =
"${sitename}|${linkname}|${desc}|${name}|${emailcontact}|${location}|${valid}
";
#   $count++;
#  }
# 
#  close %links;
# }
# 
# Anyone have a clue, what I should do different or what is wrong?
# 
# Please respond to marv@dwave.net, thanks

I see nothing wrong.  The two files .dir and .pag together comprise the DBM
links.dbm.  When you open "links.dbm", the interface knows to look for
those two files.  No problems.

--
Chris Nandor             pudge@pobox.com             http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])


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

Date: Mon, 18 Aug 1997 11:41:01 -0700
From: danielg@ea.com (Dan Greenblatt)
Subject: Perl for Win32 and COM port calls
Message-Id: <danielg-ya02408000R1808971141010001@nntp2.ba.best.com>

I'm pretty decent with standard UN*X perl, but now I'm currently checking
out Perl for Win32's ability to listen to COM ports.  Right now I have a
simple script (with help from the Win32 for Perl FAQ, thankyouverymuch)
that should listen to my COM1 port and spit out material as it comes in. 
Currently, a modem is receiving data constantly and piping it directly into
my serial port.

Problem is, it's grabbing the port OK (when I run the script I can't go in
through HyperTerminal and access the port again) but it just sits and
hangs, producing no output.

Here's the script:

open (PORT, "<COM1:") || die "Can't open COM1: $!";
while (1)
{
    read (PORT, $buffer, 1) || die "COM port error: $!";
    print "$buffer";
}

I have to ctrl-C out of this, even in debug mode.
Any suggestions from Win32 Perl hackers out there who've successfully
listened to a serial port?

-- 
Dan Greenblatt                               danielg@ea.com
Lord of the Snow Monkeys                     Electronic Arts
These are MY opinions, not my employer's.  Capiche?


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

Date: 18 Aug 1997 19:12:04 GMT
From: dalke@ks.uiuc.edu (Andrew Dalke)
Subject: Re: perl5 regexes slower than perl4?
Message-Id: <5ta6q4$hob$1@vixen.cso.uiuc.edu>

Ilya Zakharevich <ilya@math.ohio-state.edu> said:
> This change happened between 5.003_07 and 5.003_09.

I'm glad I was able to help you to track it down to a specific
set of changes and hope the performance improvements are easy
to implement.
  Could you drop me a note when this happens?

Thanks,
						Andrew Dalke
						dalke@ks.uiuc.edu


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

Date: Mon, 18 Aug 1997 20:49:40 +0200
From: "Tylman Ule" <ule@uni-muenster.de>
Subject: pipe by line
Message-Id: <Pine.A41.3.96.970818194439.72386J-100000@asterix.uni-muenster.de>

Hi All! 

I have written a backup script that calls ufsdump on Solaris. I would like
to analyse, log (no problem so far) and react to the ufsdump output
immediately.

This is a problem as 
open(LOG, "remsh $client /usr/sbin/ufsdump $level$options $host:$tape\
$devmnt 2>&1 | ");  
continues only after the dump command has finished. 

Next comes: 
foreach(<LOG>) { analyse, log & react } 

My question is: Is there a way to let the pipe transport single lines
while the command is in process? I heard there was some notation involving
the dollar sign??


Sorry if this is a newbie question - I spent quite a while searching FAQs,
newsgroups and WWW.

Thanks for your patience, 
Tylman 



----------------------------------------------------------------------------
 Tylman Ule                        
     SysAdmin
     Arbeitsbereich Linguistik, Westfaelische Wilhelms-Universitaet
     Huefferstr. 27, 48149 Muenster
     Germany

  Tel ++49 251/83-39147, Fax ++49 251/83-38343
  http://santana.uni-muenster.de/Linguistik/user/ule.html






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

Date: Mon, 18 Aug 1997 14:09:29 -0400
From: Benjamin Sugars <bsugars@sunpub.com>
Subject: Re: Q: assoc. arrays as subroutine argument
Message-Id: <33F88FD9.7799@sunpub.com>

Simon Fairey wrote:

> Try looking at the perlref man page. Essentially what you want is
> something like the following:
> 
> sub ascii2html {
>   my $hashref = shift;
> 
>   foreach $wert ( %$hashref ) {
>     print "Key = $wert, Value = $$hashref{$wert}\n";
>   }
>   return;
> }
> 
> ascii2html(\%data);

Except that in your example you're iterating through both the keys and
values of the hash.  Presumably you meant to write something like this:
    ...
    foreach $wert (keys %$hashref) {
        ...
    }

-Ben

--
Ben Sugars <bsugars@canoe.ca>
Senior Webmaster,
CANOE Canadian Online Explorer,
http://www.canoe.ca/


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

Date: Mon, 18 Aug 1997 14:47:23 -0400
From: David Mossakowski <dmoss@instinet.com>
Subject: reading remote files
Message-Id: <33F898BB.B04AA5D5@instinet.com>

I'm trying to read a file from a remote web server.

Such as :  http://internalserver/doc.txt

If I know the file's name and location can I grab it from within perl
and store it into a variable?

dave.

--
David Mossakowski
Instinet Corporation
212-310-7275
dmoss@instinet.com

"I don't sit idly by, I'm planning a big surprise"   FUGAZI




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

Date: 18 Aug 1997 11:57:51 -0600
From: rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray)
Subject: Re: SelfLoader and -T
Message-Id: <uowwwljqsps.fsf@tremere.ecte.uswc.uswest.com>

>>>>> "Tom" == Tom Phoenix <rootbeer@teleport.com>
>>>>> wrote the following on Tue, 12 Aug 1997 23:12:08 -0700

  Tom> On Tue, 12 Aug 1997, Chris Schoenfeld wrote:
  >> As following in the preaching of Tom Christiansen, et al, I
  >> religiously use -Tw in all my scripts. However, I get insecure
  >> dependancies within the SelfLoader module when I run with this
  >> option. Hence, none of my big CGI scripts can use SelfLoader.
  >> 
  >> Has this been fixed?

  Tom> I haven't heard of this being fixed. Unless you hear otherwise,
  Tom> it sounds like it's worth a bug report. It may not be fixed
  Tom> soon (unless you fix it yourself :-) but it should at least be
  Tom> put on the list. Thanks!

Chris did not say what version of Perl he was using, but this has been fixed.
Perl's I/O flags now include a tainted/clean flag, and the core marks __DATA__
as clean when running under -T/suid conditions. I had similar problems with
CGI scripts that used SelfLoader, and I wrote the patch that added the flag and
the untaint() method to IO::File (if you use IO::File to open a file, and are
*certain* that the file is secure, you can do $fh->untaint to mark the fh as
clean, and avoid having to wash each line as you read them). This was mid- to
late-5.003, and is definately in 5.004.

Randy
-- 
===============================================================================
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS         Phone: (303)595-2869
                Denver, CO                                     rjray@uswest.com
"It's not denial. I'm just very selective about the reality I accept." --Calvin


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

Date: 18 Aug 1997 14:26:28 -0400
From: Jay Rogers <jay@rgrs.com>
To: "Breda Strasheim" <fullung@ilink.nis.za>
Subject: Re: Telnet problems
Message-Id: <82g1s7xs8b.fsf@shell2.shore.net>

"Breda Strasheim" <fullung@ilink.nis.za> writes:
> I want to use a perl script to send certain commands over a telnet
> connection to another system. For some weird reason telnet keeps on
> disconnecting.

Most likely the telnet program you're using only reads its input from
tty and not stdin (I'm assuming you're trying to feed it commands via
stdin).  Without any input it'll just connect and then disconnect on
exit.

Try the module Net::Telnet.  You can find it on CPAN.

--
Jay Rogers
jay@rgrs.com


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

Date: Mon, 18 Aug 1997 13:22:16 -0600
From: dean.pompilio@cna.com
Subject: Which versions of Oraperl and Perl???
Message-Id: <871917350.19806@dejanews.com>

Can anyone tell me if Oraperl is compatible with Perl 5.003 (or higher)?
I can't seem to find this info on the Web so far...  Hopefully someone
knows exactly which versions of Oraperl and Perl are the latest and
stable. Thanx!!!

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 18 Aug 1997 19:21:20 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Which versions of Oraperl and Perl???
Message-Id: <5ta7bg$jtu@news-central.tiac.net>

In article <871917350.19806@dejanews.com>,  <dean.pompilio@cna.com> wrote:
>Can anyone tell me if Oraperl is compatible with Perl 5.003 (or higher)?
>I can't seem to find this info on the Web so far...  Hopefully someone
>knows exactly which versions of Oraperl and Perl are the latest and
>stable. Thanx!!!

You might want to follow the DBI link to be found at
http://www.hermetica.com as the latest & greatest oracle and perl
combination seems to be the DBI (database interface) module with an Oracle
DBD (database driver)

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 18 Aug 1997 20:12:16 +0100
From: clem@bastet.dircon.co.uk (Clem Dye)
Subject: Win32 Perl & UNC names - Problem?
Message-Id: <1.5.4.32.19970818201247.002fc030@popmail.dircon.co.uk>

My apologies in advance if this issue has been aired before, but I wonder if
someone could offer a Win32 Perl newbie a little assistance?

I've recently prepared a Win32 Perl script (release 5.001m) which undertakes
the following basic functions:

1) Accepts input from $ARGV[0], which is assumed to be a directory name.
2) Checks to see if the directory applied in (1) exists.
3) Does some processing, if the check in step (2) passes.

If I execute the script in the format: PERL script.pl c:\temp (for example)
the script executes as expected. However, if I execute the script in the
format PERL script.pl \\<servername>\<sharename>, the test for directory
existence in step (2) fails. (A straight DIR \\<servername>\<sharename>
works fine.)

The share (on a Windows NT server) has a Full Control permission for the
Everyone group, both at a share and directory level, and is configured as a
NullSession share, to permit LocalSystem built-in account access across the
wire.

The problem is, as far as I can tell, an issue regarding share
access/behaviour. If, as an Administrator (local workstation and domain) I
execute the script in the format: PERL script.pl
\\<servername>\c$\<directoryname>, everything is OK (ie: file access).

Can anyone shred any light on how I might use Perl to access an NT share
_without_ mapping a drive?

Any help would be greatly appreciated.

TIA


Clem



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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