[6369] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 991 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 22 06:18:48 1997

Date: Sat, 22 Feb 97 03:00:22 -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, 22 Feb 1997     Volume: 7 Number: 991

Today's topics:
     Re: [Q] removing lines in a file.. <rootbeer@teleport.com>
     Re: `DATE` function for NT/95 <padenton@metronet.com>
     debugger question <bartolonem@med.ge.com>
     Email Problem (Pat Kolis)
     Re: futur de perl et java-script (ook!@ook.org)
     HELP: Sending control codes to printer <modenajr@centroin.com.br>
     How do I get a form feed into a document? <stats9@mail.idt.net>
     Re: How do I get a form feed into a document? (Tad McClellan)
     Re: How to spam - legitimately <tchrist@mox.perl.com>
     Mac port of Perl ftp site? (RedFox)
     Re: Named Pipes and Perl, anyone done this? <billc@tibinc.com>
     Re: NDBM limitation <tchrist@mox.perl.com>
     Re: NT and perl    Try using Sendmail (Neil S. Briscoe)
     Perl array passing S_Stefanis@msn.com
     Re: Perl in Win3.1 or MSDOS - I have questions <billc@tibinc.com>
     Re: Perl system function ahd HP-UX versions <rootbeer@teleport.com>
     Re: PERL/NT development environment/guru setup out ther <billc@tibinc.com>
     Re: PING and a little bit of GD too <R.J.Rainthorpe@gre.ac.uk>
     Re: POP3 modules <rootbeer@teleport.com>
     Re: POP3 modules (Neil S. Briscoe)
     Re: Quick technique to split a words into chars? (Premkumar Natarajan)
     really really Simple Question (Evan Wise)
     Re: Resolving IP <rootbeer@teleport.com>
     Re: simple new question! <rootbeer@teleport.com>
     Re: simple new question! (Tad McClellan)
     Re: Strange pack/unpack behavior <rootbeer@teleport.com>
     Re: undump <tchrist@mox.perl.com>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Fri, 21 Feb 1997 19:00:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Eric D. Carter" <ecarter@a-lincoln.hnet.uci.edu>
Subject: Re: [Q] removing lines in a file..
Message-Id: <Pine.GSO.3.95q.970221185448.23547M-100000@kelly.teleport.com>

On 21 Feb 1997, Eric D. Carter wrote:

> Is it possible to simply open a file and
> remove a $_ (entire line..) without using a second file?  

Yes, if the line you want to remove is the last line in the file. :-)

But if you want to let perl do most of the work, try something like this. 

    {
        local($^I, @ARGV) = (".bak", qw!file1 another_file!);
        while (<>) {
            print unless /skip me/;
        }
    }

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 21 Feb 1997 21:00:42 -0600
From: "Paul A. Denton" <padenton@metronet.com>
Subject: Re: `DATE` function for NT/95
Message-Id: <330E615A.2736@metronet.com>

It seems to me that this thread primarily concerned and involved
James E. Colyer and Nathan V. Patwardhan.  I wonder why Tad McClellan
allowed his testosterone levels to overwhelm him via private E-mail. 
His missive is at the end of my reply:

Tad:
How refreshing to receive this type of reply to an attempt to help
someone out with a problem.  How wonderful to know that there are people
like you with such serious emotional/personal problems that would take
the time to generate garbage such as this.

I would appear that it is YOU who should control the 'MIME crap' because
in your 'reply' you are 'MIME-ing' (ie, mimicking) the other
self-centered, self-serving, egotistical ass-holes in the world.  It
would  seem to me that your reply is possibly comensurate with your
success at SGML Consulting.  What caliber of people could possibly use
the services of a 'Tag and Document Consulting' service?

Now, in keeping with your request, since '> MIME is for _mail_.' enjoy
yourself.

Oh, and by the way, go fuck-off and go to hell

Paul

Tad McClellan wrote:
 
 In article <330D65C3.765D@metronet.com> you wrote:
 : This is a multi-part message in MIME format.
 Please knock it off with the MIME crap.
 MIME is for _mail_.
 Usenet is not mail...
 
 : --------------6DF358695DA9
 : Content-Type: text/plain; charset=us-ascii
 : Content-Transfer-Encoding: 7bit
 
 : Nathan,
   ^^^^^^
 
 Nathan didn't ask the question.
 
 JColyer asked the question...
 
 : If I understand you correctly, this was a problem I ran into.
 : Try this attachement, 'ctime.pl'
 
 : Paul Dentn
 : Nathan V. Patwardhan wrote:
 : >
 : > JColyer@PrioritySearch.com wrote:
     ^^^^^^^

     Tad McClellan                          SGML Consulting
     Tag And Document Consulting            Perl programming
     tadmc@flash.net


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

Date: Fri, 21 Feb 1997 10:30:39 -0600
From: Mike Bartolone 5-4266 <bartolonem@med.ge.com>
Subject: debugger question
Message-Id: <330DCDAF.2781@med.ge.com>

If any of you use the built-in perl debugger, can you tell me if
there is a command to list the current values of all of the currently
defined variables?


-- 
bartolonem@med.ge.com | 'Close eyes..Think tree...
bartolon@execpc.com   | In your mind, make picture..
                      | now open eyes..make like picture...'
                      | paraphrased from 'The Karate Kid'


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

Date: 22 Feb 1997 04:43:47 GMT
From: kolis@fast.net (Pat Kolis)
Subject: Email Problem
Message-Id: <5elti3$rjs@news1.fast.net>

Hi,

I created a relatively simple form to capture information and then send an 
email to somebody.  The form and CGI/Perl program work fine with one exception. 
When the email is sent and ultimately received, it lacks a subject and a from 
address.

Does anyone know how to set these parameters?  Code listed below.  Thank you.

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

	open (MAIL, "|mail jones\@nuwave.com");
		
		print MAIL <<EOM;
		
			   Name: $input{'name'}
			Address: $input{'address'}
			Address: $input{'address2'}
			   City: $input{'city'}
			  State: $input{'state'}
			    Zip: $input{'zip'}
			  Phone: $input{'phone'}
			    Fax: $input{'fax'}
			  Email: $input{'email'}
			  
		   Comments: $input{'comments'}
	
EOM



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

Date: Fri, 21 Feb 1997 10:36:35 -0800
From: ook!@ook.org (ook!@ook.org)
Subject: Re: futur de perl et java-script
Message-Id: <ook!-ya02408000R2102971036350001@snews.zippo.com>

      They compliment each other wonderfully. There's absolutely no way I
can imagine one will supersede the other. I'm on my third site integrating
the two, and like pairing them all the more each time I use them together. 

     For example, JavaScript is great at generating  pages and verifying
data before its transmitted, while Perl is great for painless (OK, not
painless, but it doesn't suck) database access and covering some of the
other gotchas involved in using JavaScript, such as document object
callbacks (Yeah, I know there's a workaround in JavaScript, but sometimes
frame juggling is not appropriate.).

     I can think of a dozen other ways they cover up for each other off the
top of my head, but no need to belabor a point probably best made in
another newsgroup.

-- 
Ook's a jerk. This is his evil twin telling you to ignore him while you
still can.


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

Date: Fri, 21 Feb 1997 19:40:27 -0300
From: Modena Jr <modenajr@centroin.com.br>
Subject: HELP: Sending control codes to printer
Message-Id: <330E245B.3502D12D@centroin.com.br>

I'm writing a simple script to fill out a preprinted form using the
FORMAT and WRITE commands. 

Embeded into the variables used in the FORMAT template I've inserted
some ESC like control codes to change the printer font and style, but to
my suprise the ESC character is being changed for a space character.

Does someone know what's wrong and how I can send control codes to the
printer?

Thanks in advance for any help.


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

Date: Fri, 21 Feb 1997 21:26:40 -0500
From: Chris Plachta <stats9@mail.idt.net>
Subject: How do I get a form feed into a document?
Message-Id: <330E5960.5E3A590C@mail.idt.net>

Does anyone know how I print a formfeed character (new page) into a
text document using perl?  I am writing out text reports and I want
to put new page indicators in it so my printer recognizes it.  I am
running Perl 5 on a Linux machine, using nenscript to print my text
files.  
Thanks.


Chris


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

Date: Fri, 21 Feb 1997 21:42:12 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How do I get a form feed into a document?
Message-Id: <kuple5.8s4.ln@localhost>

Chris Plachta (stats9@mail.idt.net) wrote:
: Does anyone know how I print a formfeed character (new page) into a
: text document using perl?  I am writing out text reports and I want
: to put new page indicators in it so my printer recognizes it.  I am
: running Perl 5 on a Linux machine, using nenscript to print my text
: files.  

(There are a bunch of funny files with a '.pod' filename extension
 that are included with the perl distribution. You should find out
 where they are on your system [/usr/lib/perl5/pod on RedHat 4.0
 installation] and consult them first when you have a perl question)


grep formfeed *.pod
   three hits. One tells the code for adding a formfeed


grep 'form feed' *pod
   four hits. Three of them tell the code for adding a formfeed


: Thanks.

Uh huh.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 22 Feb 1997 05:09:42 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to spam - legitimately
Message-Id: <5elv2m$64o$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Valdis Kletnieks <valdis.kletnieks@vt.edu> writes:
:> All of these emails will be different based on user preferences.
:Well.. if you have 18,000 different emails, 

Why does this sound wrong to my ear?  The postman doesn't deliver 18
mails.  Whether it be email or postal mail, mail is a mass noun, not
a count noun.  Perhaps we're not dealing with native English speakers,
though.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    Just don't create a file called -rf.  :-)
            --Larry Wall in <11393@jpl-devvax.JPL.NASA.GOV>


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

Date: Fri, 21 Feb 1997 18:10:55 -0800
From: dehanks@bigfoot.com (RedFox)
Subject: Mac port of Perl ftp site?
Message-Id: <dehanks-2102971810550001@nntp.loop.com>

Need I say more?

Thanks

--me


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

Date: Fri, 21 Feb 1997 20:30:29 -0500
From: Bill Cowan <billc@tibinc.com>
To: usagi@ibm.net
Subject: Re: Named Pipes and Perl, anyone done this?
Message-Id: <330E4C35.27EC@tibinc.com>

Craig Humphrey wrote:
> 
> Hi People,
>         in the never ending quest for info on Perl and the various ways to use
> it as the goo between our Netscape Communications WWW server and our MS
> SQL Server (6.5), I was wondering if anyone had any ideas on how to to
> use named pipes in Perl (I have 5.something).
> 
> I'd heard that it was possible.  Has anyone managed it?  If so, care to
> give me some pointers, even if it's just to online docos.
> 
> Thanks.
> 
> Later'ish
> Craig
> 
> --

Assuming you are running on NT, you may want to check out:

	ftp://ftp.roth.net/pub/ntperl/

for Dave Roth's set of module extension for Win32.  There appears to
module for pipes you may want to check (just a guess). 

Of more interest would be the Win32::ODBC module as possible means to
develop Perl CGI scripts with SQL Server access via ODBC.

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: 22 Feb 1997 07:27:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: NDBM limitation
Message-Id: <5em74b$942$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    pdcawley@aladdin.net (Piers Cawley) writes:
:Another argument in favour of GDBM methinks. It doesn't build sparse
:files. I don't believe that Berkeley's DB does either, but I'm more
:than prepared to be corrected on that.

No, Berkeley's does not either.  Furthermore, B. DB is byte-order
independent, and perhaps even more interesting, has a facility for
defining traversal order of your hash.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


There's going to be no serious problem after this.  --Ken Thompson


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

Date: 22 Feb 1997 09:06:15 GMT
From: neilb@zetnet.co.uk (Neil S. Briscoe)
Subject: Re: NT and perl    Try using Sendmail
Message-Id: <memo.970222090449.13527E@zetnet.co.uk>

In article <330C4A92.73FC@powersim.no>, stemo@powersim.no (Steinar Moen)
wrote:

> Iqbal Gandham wrote:
> >
> > Hi
> >
> > I am not very familiar with NT server, but can write effectively in
> > perl
> > Now I have asimple mailing scripts which works perfectly on a apache
> > server. How can I adopt this so that it will run on a NT server.
> >
> > In unix I can just use th Mail command, is there something similar in
> > NT
> >

The Metainfo sendmail program is a straight port from Unix and it works
just as well.  No hesitation recommending it (esp. as in my working life
its one of the programs I resell) which means, of course, that it costs
money.

Blat - well - lots of people say it should work - lots of other people,
myself included - say it doesn't.

If you still have Unix machines to hand, but are running your script on an
NT server, then why not just - er - blat out some SMTP over your LAN (or,
if needs be, to any SMTP server) to your Unix box and let it do the
mailing, whilst your NT server takes the strain of servicing the web?  Oh,
you don't know how to talk SMTP?  Never mind, neither did I until I found
Graham Barr's excellent Net::SMTP module.  Sadly, that won't run under NT,
so I butchered it into an smtp.pl which is free for use, and if you mail
me, I'll send it to you.  It, along with the cgi scripts that call it,
process all of our web forms on our NT based servers.

Regards
Neil
 


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

Date: Sat, 22 Feb 1997 00:51:08 -0600
From: S_Stefanis@msn.com
To: S_Stefanis@msn.com
Subject: Perl array passing
Message-Id: <856537918.12757@dejanews.com>

Could someone post a clear example of passing an entire array
 into a subroutine for a rookie?

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


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

Date: Fri, 21 Feb 1997 21:17:28 -0500
From: Bill Cowan <billc@tibinc.com>
To: Idaho Central Reservations <idaho@mtnhigh.com>
Subject: Re: Perl in Win3.1 or MSDOS - I have questions
Message-Id: <330E5738.4F3@tibinc.com>

Idaho Central Reservations wrote:
> 
> I have a win3.1 machine.  Perl looks very interesting to me, but I
> don't have a server and only win3.1 & dos.
> 
> Haven't seen a port to win3.1 but I have to dos.  Anyone working on
> a dos port or win3.1 port willing to answer a few start up questions?
> 
> Thanks in advance.
> 
> Mark Cook
> http://www.mtnhigh.com/

Did you check out http://www.perl.com/CPAN/ports, e.g. "msdos" and
"win31" entries?

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Fri, 21 Feb 1997 19:36:50 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Jairo A. Medina" <phillip.green@citicorp.com>
Subject: Re: Perl system function ahd HP-UX versions
Message-Id: <Pine.GSO.3.95q.970221193134.23547P-100000@kelly.teleport.com>

On Fri, 21 Feb 1997, Jairo A. Medina wrote:

> 	I have this perl code:
> 
> $result = system("ls");
> print $result;
> 
> 	inside a big program.
> 
> 	If I execute it in 
> HP-UX mahogany A.09.04 E 9000/816
> 
> 	it works great. I got $result = 0
> 
> 	if I execute the same program in 
> HP-UX cherry B.10.10 A 9000/811
> 
> 	I got $result = -1 but if I make a program with only those 2 lines it
> works fine.

Does the big program set the PATH environment variable, or change
directories? You may want to put a diagnostic print before that system
call, so you can check those things. (And why start another process for
'ls' when it's so easy to emulate directly in Perl?) 

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 21 Feb 1997 21:03:49 -0500
From: Bill Cowan <billc@tibinc.com>
Subject: Re: PERL/NT development environment/guru setup out there ?
Message-Id: <330E5405.515D@tibinc.com>

Dave Thomas wrote:
> 
> On Fri, 21 Feb 1997 03:45:19 GMT, Gary <gniemcew@dti.net> wrote:
> > Hi !
> >
> > It's probably a "dream on!" type of question, but here it goes anyway:
> > is there an integrated development environment for PERL/NT4/Win95 ? I
> > am thinking a nice (color coding) editor in one window, interpreter
> > stdout in another, and still a script's output in yet another ? PERL
> > debugger with variable trace ?
> 
> well, emacs comes close. But it ain't what you'd call a drag'n'drop user
> interface!
> 
> I use it daily on NT
> 
> Dave
> 
> --

Hopefully -- without being killed by emacs users -- I like using editor
called Multi-Edit (http://www.amcyber.com/ for eval copy).

Perl support is included such syntax highlighting and templates. Most
Perl support is easy to configure via dialogs boxes (macro changes not
required). You would need to add compiler command line via dialog box. 
I added Perl templates, e.g. generate "while each()" loop for specific
hash name. Also has interfaces to several source control systems.

I edit Perl in one window, hit compile button, and see result in another
editor window.  Using same editor to view output text files from Perl is
also useful.  The editor environment is my Perl development environment
(and SQL IDE too)!

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: 19 Feb 1997 11:24:39 GMT
From: "Robert Rainthorpe" <R.J.Rainthorpe@gre.ac.uk>
Subject: Re: PING and a little bit of GD too
Message-Id: <01bc1e57$92844020$3a3a3cc1@ratbag>

I think the replies you've got so far correctly identify a problem with
&timeout.

Incidentally, running the Ping script (corrected) on my machine gives the
following error:

The Unsupported function alarm function is unimplemented at
F:\perl\lib/Net/Ping
 .pm line 51.


However, I get the same message "Error: Parse exception" when I run the
following scripts

1. test.pl from the GD library
2. "use GD;" by itself

I'm running:

[
	Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
		All rights reserved.
	Developed by ActiveWare Internet Corp., http://www.ActiveWare.com

Perl for Win32 Build 303 - Built 14:27:31 Jan 29 1997

This is perl, version 5.003_07

Copyright 1987-1996, Larry Wall

	+ suidperl security patch
Perl may be copied only under the terms of either the Artistic License or
the
GNU General Public License, which may be found in the Perl 5.0 source kit.

]

My version of GD is: ftp://ftp.roth.net/pub/NTPerl/Win32_gd_v961030.zip 

I'm running NT 4 1381 on the Intel platform with 64Mb RAM.

I get the same message by running the scripts with -w.

Rob.

Robert Rainthorpe
System Admin
the University of Greenwich



Paul Downing <enc@pobox.com> wrote in article
<3303d031.838032@207.126.101.80>...
> I am trying to get a simple little Perl script to work. In fact it is
> the example out of the "Programming Perl" book. 
> 
> >#!/usr/local/bin/perl
> 
> >use Net::Ping;
> 
> >$hostname = 'mail.premier.net';
> >$timeout = 10;
> >print ("Mail.premier.net is alive.\n") if pingecho($hostname, &timeout);
> 
> This is the script. I am working on a 486 DX/133 (AMD), 16 MB, and
> Win95 OSR2. I have also tried it on NT 3.51 and 4.0 to no avail. I
> keep getting this message:  "Error: Parse exception". Yes, the address
> exists :)
> 
> Can someone please help me?
> 
> 
> 
> Paul Downing
> ------------------------------------------------------------
> Enterprise Network Consulting / owner	
> Baker, Louisiana			
> E-mail: enc@pobox.com   
> -------------------------------------------------------------  
> 


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

Date: Fri, 21 Feb 1997 20:15:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John Olsen <J.Olsen@btinternet.com>
Subject: Re: POP3 modules
Message-Id: <Pine.GSO.3.95q.970221201433.23547R-100000@kelly.teleport.com>

On 21 Feb 1997, John Olsen wrote:

> I want to use perl to read mail. I know there is Mail::POP3Client and 
> there is also Net::Pop3. 
> 
> Which should I use or doesn't make any difference?

Don't the readme files tell you what the difference is? :-)

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 22 Feb 1997 09:06:17 GMT
From: neilb@zetnet.co.uk (Neil S. Briscoe)
Subject: Re: POP3 modules
Message-Id: <memo.970222090453.13527F@zetnet.co.uk>

In article <5el17t$69m@neon.btinternet.com>, J.Olsen@btinternet.com (John
Olsen) wrote:

> I want to use perl to read mail. I know there is Mail::POP3Client and
> there is also Net::Pop3.
>
> Which should I use or doesn't make any difference?
>
>

I used Net::POP3 yesterday to extract the contents of a POP3 mailbox (and
Net::SMTP to redistribute them to a local SMTP server).  Havn't used the
Mail::POP3client yet, but from the wording, I'd say thats what you want to
use to "read" mail.  The former is much more for automating some
processing you want to do on the mailbox.

Regards
Neil



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

Date: 22 Feb 1997 01:06:34 GMT
From: pnataraj@emerald.tufts.edu (Premkumar Natarajan)
Subject: Re: Quick technique to split a words into chars?
Message-Id: <5elgqq$9gp@d2.tufts.edu>

Thanks for your responses. The method suggested did work as
desired.

Prem


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

Date: 22 Feb 1997 02:50:29 GMT
From: ewise@uvic.ca (Evan Wise)
Subject: really really Simple Question
Message-Id: <5elmtl$jhc@uvaix3e1.comp.UVic.CA>

Howdy, this is a little problem I am having with a PERL script I am doing right 
now. It is a little matter of just not matching the correct text and it is 
driving me up the wall. There probably exists a really simple solution to this 
that I am just blind to it after staring at this too long.

here is the line that I am trying to search and replace :

<!--- e3 ---><TD bgcolor = 00,00,00><image border = 0 src = blacksq.gif></TD>

I am trying to replace the blacksq.gif (not always blacksq.gif can be other 
 .gif files...) with some other text.  I just cant get the proper replace 
line.....!

I am also looking to try and match the blacksq.gif (again not always 
blacksq.gif) and put it into a variable. All my attempts have failed thus far.

If you can help me just post the answer here or mail me.
tanks.
E/.
ewise@uvic.ca



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

Date: Fri, 21 Feb 1997 18:51:39 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Steve Vandiver <buxx@buxx.com>
Subject: Re: Resolving IP
Message-Id: <Pine.GSO.3.95q.970221182031.23547L-100000@kelly.teleport.com>

On Fri, 21 Feb 1997, Steve Vandiver wrote:

> Need to resolve my currnet IP address

Answer #1: localhost [127.0.0.1].

Answer #2: Ask your system administrator.

Answer #3: It's possible (and even frequent) for a machine to have more
than one address. You could use the ifconfig command, if your machine has
one. See its manpage for more info.

Answer #4: If you're writing a CGI script, your server may pass its name
(such as www.foo.com) in an environment variable. See the server's docs to
find out. (Of course, there's no guarantee that the server is telling the
truth. Some intentionally fib.)

Answer #5: Why do you need your IP address? Are you having an identity
crisis? :-)

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 21 Feb 1997 19:26:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jonas Bofjall <m9418@abc.se>
Subject: Re: simple new question!
Message-Id: <Pine.GSO.3.95q.970221192125.23547O-100000@kelly.teleport.com>

On 21 Feb 1997, Jonas Bofjall wrote:

> 1. how do I change all occurences of "a" to "b", all "c" to "de" and
>    all "g" to "ijkl" in a string? 

The s/// operator will do it, in separate passes. Beware changing a change
you've already made, though. 

> 2. this code, shouldn't it work??:
>    $abc = TRUE;
>    if (abc) { print "this won't print!" }

You've left the dollar sign off of abc in the second line. Also, TRUE is a
bareword on the first line; generally, that's not a good idea. I'd
recommend 'TRUE' instead - except that then you might think that 'FALSE'
was false! Maybe you want to use 0 for false and 1 for true? 

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Sat, 22 Feb 1997 00:44:44 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: simple new question!
Message-Id: <sk4me5.4o5.ln@localhost>

Tom Phoenix (rootbeer@teleport.com) wrote:
: On 21 Feb 1997, Jonas Bofjall wrote:

: > 1. how do I change all occurences of "a" to "b", all "c" to "de" and
: >    all "g" to "ijkl" in a string? 

: The s/// operator will do it, in separate passes. Beware changing a change
: you've already made, though. 

: > 2. this code, shouldn't it work??:
: >    $abc = TRUE;
: >    if (abc) { print "this won't print!" }

: You've left the dollar sign off of abc in the second line. 
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You (Jonas) should use the -w compiler switch to enable warnings,
_especially_ when something appears to be wrong.

#!/usr/bin/perl -w
                ^^

If you had, then the compiler would have told you about abc...

[snip]


: Hope this helps!

Using -w will most definitely help  ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 21 Feb 1997 19:19:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Craig Votava <craig@lucent.com>
Subject: Re: Strange pack/unpack behavior
Message-Id: <Pine.GSO.3.95q.970221190443.23547N-100000@kelly.teleport.com>

On Fri, 21 Feb 1997, Craig Votava wrote:

> perl -e 'print "ret=", unpack("H1",pack("B2","10")), "\n";'
> 
> The returned value is 8, the correct value is 2. 

For some ideas of "correct", I suppose. :-)

When you say 'pack("B2", "10")', you're asking perl to return to you a bit
vector with the first two bits set to 1 and 0. When you ask to unpack with
"H1", you're asking to unpack four bits, so two extra (zero) bits are
added, to fill the gap. So, unpack is working on binary 1000, and gets 8. 

Another way to look at this is that you're trying to unpack more than
you packed. This leads directly to the correct solution of putting 
padding bits in at the beginning of the bitstring, if that's what you
need. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 22 Feb 1997 01:56:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: undump
Message-Id: <5eljp7$2s1$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    dedens <dedens@pi.net> writes:
:i was reading about undump, i want to download it to
:make exe files from my perl scripts.
:why? i got a cutsomer and i dont want him to
:check out the script.
:do you know where i can find it (undump)

give up; it'll never work.  undump is ancient beyond belief.  simply
tell the customer he's not allowed to steal, give away, or divulge
your unpublished proprietary source code.  in short, use the law,
not subterfuge.

and besides, you're acting like a some peecee bbs kid instead of an
internet participant.  source hiding is for tots and tyrants.  how would
you like it if we perl and internet developers had always kept everything
secret?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    That means I'll have to use $ans to suppress newlines now.  
    Life is ridiculous. 
        --Larry Wall in Configure from the perl distribution


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

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

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 V7 Issue 991
*************************************

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