[9233] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2828 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 10 09:08:54 1998

Date: Wed, 10 Jun 98 06:00:52 -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           Wed, 10 Jun 1998     Volume: 8 Number: 2828

Today's topics:
    Re: Capitalizing acronyms (Re: Is PERL case sensitive?) <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories (Xuming Wang)
    Re: Command line substitution thru subdirectories (Michael J Gebis)
    Re: Command line substitution thru subdirectories <wd@uebemc.siemens.de>
    Re: How to "protect" cgi-bin scripts from view? (I R A Aggie)
        LPW: Base64.pm (Vitali Chkebelski)
    Re: LPW: Base64.pm (Vitali Chkebelski)
    Re: LPW: Base64.pm <aas@sn.no>
    Re: McCabe complexity analysis <wd@uebemc.siemens.de>
    Re: McCabe complexity analysis (Michael Rubenstein)
    Re: McCabe complexity analysis <tchrist@mox.perl.com>
        MODERATION: Time to Vote <tchrist@mox.perl.com>
    Re: New module/pragma "enum.pm" (was "fields.pm") <zenin@bawdycaste.org>
    Re: New module/pragma "enum.pm" (was "fields.pm") (Mike Stok)
        Newbie : How to append one file to another? <r19610@email.sps.mot.com>
    Re: Newbie : How to append one file to another? <quednauf@nortel.co.uk>
    Re: Newbie : How to append one file to another? <irsan@tcf.nl>
    Re: Piping into telnet from Perl NT scott@softbase.com
    Re: sendmail on NT IIS4 scott@softbase.com
    Re: Socket when starting from inetd <ian.maloney@ubs.com>
    Re: strings.. (Mike Stok)
        Where is the robot? <quednauf@nortel.co.uk>
    Re: why does this work? <jdf@pobox.com>
    Re: Win32: File glob causes floppy to chatter <jdf@pobox.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 10 Jun 1998 11:45:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Capitalizing acronyms (Re: Is PERL case sensitive?)
Message-Id: <6llrle$24p$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, jimbo@soundimages.co.uk writes:
:acceptable form of usage but the form PERL is not incorrect or
:inaccurate within the acronym context under any circumstance.

You are assuming that the word is an acronym.  But the word
was invented before the supposed acronymic expansion, which
is just revisionist history.

--tom
-- 
    "Many folks want nothing more than to live and let learn." --Larry Wall


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

Date: Wed, 10 Jun 1998 11:10:19 GMT
From: xuming@email.unc.edu (Xuming Wang)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <357e64d3.20911441@152.2.25.74>

"Uwe Honekamp" <uwe.honekamp@etas.de> wrote:

>Abigail <abigail@fnx.com> wrote in <6lkjq2$7vj$1@client3.news.psi.net>...
>
>> $ find . -name '*.htm' | xargs perl -i.old -p -e "s/foo/bar/g"
>
>On win32, however, you have to install a proper working find and xargs.
>These (and more) can be found at www.cygnus.com/win32.
>
>Disclaimer: I'm running NT, never checked find and xargs on win95

Oh, see how mad Tom C. was when I posted my test result of his answer on
win95.  I was really dispointed.  I was going to buy the camel book but
now changed mind.  will still read his FAQ though, since it's free :-)

well, in another private mail, he changed from blaming me too lazy,
stupid, or rude to install an OS to blaming me not installing tools as a
programmer.  but I am a newbie in programming and no one (until you,
Uwe, thanks) told me where to get this non-Perl tool which is required
by his (and Abigail's) answer on a Perl news group to a Perl question
but none of them mentioned that their answer needs something else other
than perl.

well, I hope he just drank too much last night.

--
Xuming Wang


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

Date: 10 Jun 1998 04:03:41 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6ll0it$l5n@mozo.cc.purdue.edu>

Tom Christiansen <tchrist@mox.perl.com> writes:

}In comp.lang.perl.misc, 
}    xuming@email.unc.edu (Xuming Wang) writes:
}:C:\>find . -name '*.htm' | xargs perl -i.old -p -e "s/foo/bar/g"
}:FIND: Parameter format not correct
}:Bad command or file name

}Stop bitching about not having tools.  It's not our fault that you're
}too lazy, stupid, or rude to bother to install an operating system.
}You can't get any useful work done with your problem.  If you want
}to program, install a programming environment.  If you prefer to 
}watch MTV, you know where to find it.

You know, there was a time when I used to auto-select your posts.

*plonk*

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 10 Jun 1998 12:29:12 GMT
From: Wolfgang Denk <wd@uebemc.siemens.de>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6llu6o$rq$1@galaxy.mchh.siemens.de>

xuming@email.unc.edu (Xuming Wang) writes:

>"Uwe Honekamp" <uwe.honekamp@etas.de> wrote:

>>On win32, however, you have to install a proper working find and xargs.
>>These (and more) can be found at www.cygnus.com/win32.
 ...
>programmer.  but I am a newbie in programming and no one (until you,
>Uwe, thanks) told me where to get this non-Perl tool which is required

It is not really "required". Life is just a LOT easier when you  have
the  right tools. This is a Perl group, so we won't discuss where you
can get all the other precious tools you may want to have.

However, feel free to ask...

Wolfgang Denk

-- 
Office:  (+49)-89-722-27328, Fax -36703  Wolfgang.Denk@oen.siemens.de
Private: (+49)-89-95720-110, Fax -112                  wd@denx.muc.de
The important thing about being a leader is not being right or wrong,
but being *certain*.                    - Terry Pratchett, _Truckers_


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

Date: Wed, 10 Jun 1998 08:34:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How to "protect" cgi-bin scripts from view?
Message-Id: <fl_aggie-1006980834340001@aggie.coaps.fsu.edu>

In article <357DBB78.2C173298@hotmail.com>, jr32@hotmail.com wrote:

This is appropriate to one of the 
comp.infosystems.www.servers.(mac|misc|ms-windows|unix) newsgroups.

+ So my question is: How can I keep my scripts safe, so people can't pull
+ up the contents of the cgi-bin in the browser window (eg: Open Location:
+ http://www.mydomain.com/cgi-bin), look at the scripts and know such
+ things as the locations of data files, password files and the like?

The short answer: they shouldn't be able to _read_ anything in /cgi-bin/
the way you worry about. If they can, then your server is misconfigured,
and your scripts won't run.

Followups.

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>


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

Date: 9 Jun 1998 06:47:41 GMT
From: v.chkebelski@t-online.de (Vitali Chkebelski)
Subject: LPW: Base64.pm
Message-Id: <6lilqd$1lt$1@news02.btx.dtag.de>

I'm using the function encode_base64() from LPW for encoding mail
attachments.
The result seems sometimes (depends on content?) different to the same
created by Netscape mail client.
(This is probably the reason why aren't understood such attachments by
other mail clients.)

for example: file foo.gif

open(GIF, "foo.gif");
open(ENCODED, "> outputfile");
while(<GIF>){
	print ENCODED encode_base64($_);
}
close(ENCODED);

results in
******************************************************************************
R0lGODlhMAApANdUAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQo=
Cg==
Cg==
CwsLDAwMDQ0NDg4ODw8PEBAQEREREhISExMTFBQUFRUVFhYWFxcXGBgYGRkZGhoaGxsbHBwcHR0d
******************************************************************************

while the same file sent from Netscape:
******************************************************************************
R0lGODlhMAApANdUAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoKCgsLCwwMDA0N
DQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZGRoaGhsbGxwcHB0dHR4eHh8f
******************************************************************************

Can anybody give me an advise on using Base64.pm (any parameters or
special characters, padding(?), may be file reading wrong)?
Thanks in advance

Vitali Chkebelski
Chemnitz, Germany


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

Date: 9 Jun 1998 06:52:46 GMT
From: v.chkebelski@t-online.de (Vitali Chkebelski)
Subject: Re: LPW: Base64.pm
Message-Id: <6lim3u$1nm$1@news02.btx.dtag.de>

Sorry, LWP. It was a type mistake.

Vitali Chkebelski
v.chkebelski@t-online.de


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

Date: 10 Jun 1998 13:31:52 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: LPW: Base64.pm
Message-Id: <m3vhq9ze53.fsf@furu.g.aas.no>

v.chkebelski@t-online.de (Vitali Chkebelski) writes:

> The result seems sometimes (depends on content?) different to the same
> created by Netscape mail client.
> (This is probably the reason why aren't understood such attachments by
> other mail clients.)
> 
> for example: file foo.gif
> 
> open(GIF, "foo.gif");
> open(ENCODED, "> outputfile");
> while(<GIF>){
> 	print ENCODED encode_base64($_);
> }
> close(ENCODED);
> 
> results in
> ******************************************************************************
> R0lGODlhMAApANdUAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQo=
> Cg==
> Cg==
> CwsLDAwMDQ0NDg4ODw8PEBAQEREREhISExMTFBQUFRUVFhYWFxcXGBgYGRkZGhoaGxsbHBwcHR0d
> ******************************************************************************

The documentation of newer versions of the MIME::Base64 says:

       If you want to encode a large file, you should encode it
       in chunks that are a multiple of 57 bytes.  This ensures
       that the base64 lines line up and that you do not end up
       with padding in the middle. 57 bytes of data fills one
       complete base64 line (76 == 57*4/3):

          use MIME::Base64 qw(encode_base64);
          open(FILE, "/var/log/wtmp") or die "$!";
          while (read(FILE, $buf, 60*57)) {
              print encode_base64($buf);
          }

       or if you know you have enough memory

          use MIME::Base64 qw(encode_base64);
          local($/) = undef;  # slurp
          print encode_base64(<STDIN>);


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

Date: 10 Jun 1998 11:05:02 GMT
From: Wolfgang Denk <wd@uebemc.siemens.de>
Subject: Re: McCabe complexity analysis
Message-Id: <6llp8u$qk8$1@galaxy.mchh.siemens.de>

Tom Christiansen <tchrist@mox.perl.com> writes:

>I wonder why these allegedly respected authors seem
>to thing there's some different between 
>    if (p) 
>and 
>    if (p == NULL)
>When of course, there isn't.

Am I missing something? Did you mean to write `if (!p)' in the  first
line? Or `if (p != NULL)' in the second?

Confused,

Wolfgang Denk

-- 
Office:  (+49)-89-722-27328, Fax -36703  Wolfgang.Denk@oen.siemens.de
Private: (+49)-89-95720-110, Fax -112                  wd@denx.muc.de
The only way to get rid of a temptation is to yield to it.
                                                        - Oscar Wilde


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

Date: Wed, 10 Jun 1998 11:21:24 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: McCabe complexity analysis
Message-Id: <357f69f9.164651526@nntp.ix.netcom.com>

On 9 Jun 1998 22:58:50 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

>I wonder why these allegedly respected authors seem
>to thing there's some different between 
>
>    if (p) 
>
>and 
>
>    if (p == NULL)
>
>When of course, there isn't.

Perhaps because some people get confused on this.  I've been
programming in C for over 20 years and I still get confused and think
that

	if (p)

and

	if (p == NULL)

mean different things.  In fact, I often get so confused that I think
that they are exact opposites.

I think your question not only answers itself, but also answers the
question you probably meant to ask as to why some authors think there
is a difference between

	if (p)

and

	if (p != NULL)

--
Michael M Rubenstein


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

Date: 10 Jun 1998 11:46:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: McCabe complexity analysis
Message-Id: <6llrmv$24p$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Wolfgang Denk <wd@uebemc.siemens.de> writes:
:Am I missing something? Did you mean to write `if (!p)' in the  first
:line? Or `if (p != NULL)' in the second?

Yes.

--tom
-- 
An elephant is a mouse with an Microsoft operating system


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

Date: 10 Jun 1998 12:23:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: MODERATION: Time to Vote
Message-Id: <6lltsk$4bm$1@csnews.cs.colorado.edu>

There's a vote going on at news.groups for a moderated
Perl newsgroup going on.  Please find the article that says
CFV on it and do as it says.

thanks,

--tom
-- 
Like Dennis' love note about rk05s, early Berkeley tapes cane with a
suggestion from Bill Joy that "this is a tape of bits," meaning there was no
guarantee of anything, and that complaints should be directed to /dev/null.
 --Andy Tannenbaum, "Politics of UNIX," Washington, DC USENIX Conference, 1984


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

Date: 10 Jun 1998 12:28:07 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: New module/pragma "enum.pm" (was "fields.pm")
Message-Id: <897482176.993603@thrush.omix.com>

[posted & mailed]

Zenin <zenin@bawdycaste.org> wrote:
	>snip<

	Benjamin Holzman has bought to my attention a spec designed
	by Tom Phoenix for an almost identical interface and pragma
	name for which Benjamin already had a first version of an
	enum.pm that implemented it.

	Extending and modifying slightly this spec I've folded Benjamin's
	code into my module to come up with what should be a better overall
	interface for enum.pm.

	This version is available at:

		http://thrush.omix.com/pub/perl/modules/enum-1.007.tar.gz

	Please let me know what you think.

	Here's the perldoc:

NAME
    enum - C style enumerated types in Perl

SYNOPSIS
      use enum qw(One Two Three Four);
      # One == 1, Two == 2, etc

      use enum qw(Forty=40 FortyOne Five=5 Six Seven);
      # Yes, you can change the start indexs at any time as in C

      use enum qw(Sun Mon Tue Wed Thu Fri Sat);
      # Sun == 0, Mon == 2 etc

      use enum qw(:Prefix_ One Two Three);
      ## Creates Prefix_One, Prefix_Two, etc

      use enum qw(:Letters_ A..Z);
      ## Creates Letters_A, Letters_B, etc

      use enum qw(
          :Months_=0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
          :Days_=0   Sun Mon Tue Wed Thu Fri Sat
          :Letters_=20 A..Z
      );
      ## Prefixes can be changed mid list and can have index changes too

DESCRIPTION
    Defines a set of symbolic constants with ordered numeric values ala C
    enum types.

    What are they good for? Typical uses would be for giving mnemonic names
    to indexes of arrays. Such arrays might be a list of months, days, or
    return value index from localtime():

      use enum qw(
          :Months_=0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
          :Days_=0   Sun Mon Tue Wed Thu Fri Sat
          :LC_=0     Sec Min Hour MDay Mon Year WDay YDay Isdst
      );

      if ((localtime)[LC_Mon] == Months_Jan) {
          print "It's January!\n";
      }
      if ((localtime)[LC_WDay] == Days_Fri) {
          print "It's Friday!\n";
      }

    Another useful use of enum array index names is when using an array ref
    instead of a hash ref for building objects:

      package My::Class;
      use strict;

      use enum qw(Field Names You Want To Use);
      sub new {
          my $class = shift;
          my $self  = [];

          $self->[Field] = 'value'; # Field is '0'
          $self->[Names] = 'value'; # Names is '1'
          $self->[You]   = 'value'; # etc...
          $self->[Want]  = 'value';
          $self->[To]    = ['some', 'list'];
          $self->[Use]   = 'value';
          return bless $self, $class;
      }

    This has a couple of advantages over using a hash ref and keys:

    Speed
        Using an array ref for an object yields much faster access times
        then a hash ref. Because the symbolic constants this module defines
        will be inlined by the perl interpreter there is no run time over
        head for name look up as there is when using a hash style object.

    Error Checking
        Because these names are used as bare words, when use strict is
        applied it will cause compile time errors if you misspell a field
        name. Conversely traditional hash value lookups are very prone to
        this type of error and will never cause a compile time error or
        warning, and in some cases no warning at all.

        This module is very similar to the constant module. In fact, these
        statements are the same:

          use constant Foo => 0; use constant Bar => 1;
          use enum qw(Foo Bar);

        Using -w will cause compile time warnings to be produced if you
        accidently override a field with a method name or vis-versa.

BUGS
    Enum names can not be the same as method, function, or constant names.
    This is probably a Good Thing[tm].

    No way to cause compile time errors when one of these enum names get
    redefined. IMHO, there is absolutely no time when redefining a sub is a
    Good Thing[tm], and should be taken out of the language.

    Enumerated types are package scoped just like constants, not block
    scoped as some other pragma modules are.

HISTORY
     $Log: enum.pm,v $
     Revision 1.7  1998/06/10 12:25:04  byron
            -Changed interface to match original design by Tom Phoenix
             as implemented in an early version of enum.pm by Benjamin Holzman.
            -Changed tag syntax to not require the 'PREFIX' string of Tom's
             interface.
            -Allow multiple prefix tags to be used at any point.
            -Allowed index value changes from tags.

     Revision 1.6  1998/06/10 03:37:57  byron
            -Fixed superfulous -w warning

     Revision 1.5  1998/06/10 01:31:12  byron
            -Fixed typo in docs

     Revision 1.4  1998/06/10 01:07:03  byron
            -Changed behaver to closer resemble C enum types
            -Changed docs to match new behaver

     Revision 1.3  1998/06/08 16:28:58  byron
            -Changed name from fields to enum

     Revision 1.1  1998/06/01 18:02:06  byron
     Initial revision

AUTHOR
    Zenin <zenin@archive.rhps.org>

    aka Byron Brummer <byron@thrush.omix.com>.

    Based off of the constant module by Tom Phoenix.

    Original implementation of an interface of Tom Phoenix's design by
    Benjamin Holzman, for which we borrow the basic parse algorithm layout.

SEE ALSO
    constant(3), perl(1).



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

Date: 10 Jun 1998 12:56:18 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: New module/pragma "enum.pm" (was "fields.pm")
Message-Id: <6llvpi$96j@news-central.tiac.net>

In article <897482176.993603@thrush.omix.com>,
Zenin  <zenin@bawdycaste.org> wrote:

>	This version is available at:
>
>		http://thrush.omix.com/pub/perl/modules/enum-1.007.tar.gz
>
>	Please let me know what you think.
>
>	Here's the perldoc:


>      use enum qw(One Two Three Four);
>      # One == 1, Two == 2, etc

>      use enum qw(Sun Mon Tue Wed Thu Fri Sat);
>      # Sun == 0, Mon == 2 etc

How does it know that One is 1 yet Sun is 0 or is it a doc bug?

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@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 10 Jun 1998 04:30:53 +0800
From: Dayang Lily <r19610@email.sps.mot.com>
Subject: Newbie : How to append one file to another?
Message-Id: <357D9B7D.3A52CFDE@email.sps.mot.com>

This is a multi-part message in MIME format.
--------------E4804697BB1D6B338FE94061
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I'm new to Perl.  I need to know how I can append two files together?
For example, I have FILE1 and I want to append the contents of FILE1 to
another file, FILE2.  How can I do that?

Thanks.

Regards,
Lily.

--------------E4804697BB1D6B338FE94061
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Dayang Lily
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Dayang Lily
n:              Lily;Dayang
org:            Motorola Malaysia Sdn Bhd
email;internet: r19610@email.sps.mot.com
title:          Test Development Engineer
tel;work:       6037734523
x-mozilla-cpt:  ;-11312
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------E4804697BB1D6B338FE94061--



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

Date: Wed, 10 Jun 1998 12:44:02 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Newbie : How to append one file to another?
Message-Id: <357E7182.3C870595@nortel.co.uk>

Dayang Lily wrote:

> I'm new to Perl.  I need to know how I can append two files together?
> For example, I have FILE1 and I want to append the contents of FILE1 to
> another file, FILE2.  How can I do that?
> 

open (FILE1, "< $file1") or die "Cannot open $file1: $!";
open(FILE2, ">> $file2") or die "Cannot open $file2: $!";

print FILE2 <FILE1>;

close (FILE1);
close(FILE2);

That should work. Important is >> which opens a file for appending. However,
wait for smaller solutions!
-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Wed, 10 Jun 1998 13:52:57 +0200
From: "Irsan Widarto" <irsan@tcf.nl>
Subject: Re: Newbie : How to append one file to another?
Message-Id: <6lls47$bp4$1@news2.xs4all.nl>

Dayang Lily wrote in message <357D9B7D.3A52CFDE@email.sps.mot.com>...
>Hi,
>
>I'm new to Perl.  I need to know how I can append two files together?
>For example, I have FILE1 and I want to append the contents of FILE1 to
>another file, FILE2.  How can I do that?

open(FILE1, "FILE1");
open(FILE2, ">>FILE2");
print FILE2 <FILE1>;
close(FILE1);
close(FILE2);

>Thanks.


no worries,


Irsan.

--
#-- irsantcf.nl
#-- The Connection Factory b.v.
#-- http://www.tcf.nl




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

Date: 10 Jun 1998 10:32:31 GMT
From: scott@softbase.com
Subject: Re: Piping into telnet from Perl NT
Message-Id: <6llnbv$kbq$2@mainsrv.main.nc.us>

"Walter Klomp" <walter@swiftech.REMOVE.THIS.net.sg> writes:
> I am trying to write a small script which opens a telnet session and sends
> some commands. With the
> 
> open (TELNET,"| telnet hostname port") || die "Cannot Fork!\n";
> 
> I am not very successful. It opens the telnet program, but successively
> doesn't pipe into it the commands I want to send to it.
> 
> Anybody did this already successfully on a WinNT box or Win95 box ?

This doesn't even work on UNIX, I don't think. It certainly won't work
on Windows where the telnet program will not be reading standard input,
if it even has one. What you're going to have to do is use the telnet
protocol via sockets in your program. I'm sure someone has already
written this as a module, and I'm equally sure it likely won't work on
Windows. You'll probably wind up writing the raw socket code
yourself.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 10 Jun 1998 10:34:40 GMT
From: scott@softbase.com
Subject: Re: sendmail on NT IIS4
Message-Id: <6llng0$kbq$3@mainsrv.main.nc.us>

Don Bayless wrote:
> 
> Just what would one put in place of this on an NT box running IIS4??
> 
> #!/usr/local/bin/perl
> $mail_prog = '/usr/lib/sendmail' ;

I use a function called smtpmail which I wrote that works with
both UNIX-based sendmail mailers and Exchange servers. I posted
this function just a few days ago, so it should be easy to find.

E-mail is a total loss on NT. The only thing you can really do
reliably is use an SMTP server.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Wed, 10 Jun 1998 12:18:59 +0200
From: Ian Maloney <ian.maloney@ubs.com>
Subject: Re: Socket when starting from inetd
Message-Id: <357E5D93.6BCB73F1@ubs.com>

Tom Christiansen wrote:

> :I want to start a perl program from inetd on a UDP port and read from the socket.
> 
> One does not read() UDP packets.
> 
> --tom

I was not clear on my first posting, so ...

I have a socket program which runs perfectly when started manually or from initd. The
program is too big to list, but it contains stuff like:

my $skt = IO::File->new();			# Because I use lots of sockets!
socket($skt,PF_INET,SOCK_DGRAM,getprotobyname("udp"));	# Create a socket
bind($skt,$skin);				# Bind it to the interface
my $rdy = select(my $rout=$rin,undef,undef,undef);	# Wait for something
my $srcSin = recv($skt,my $udpBuf,512,0);	# Read a packet

But when the program is initiated from inetd the bind call fails with
an $! of 'Address already in use'.

This is because inetd has forked, opened a socket using fd 0, and exec'ed my program
(i.e. the perl binary). And the socket that inetd opened is still open when my program
runs. I'm sure it's open in my process because when I kill my process I can bind to
that interface again. But it's not on STDIN, which I've closed anyway, and I'm
clueless to where it might be open.

One dirty solution I tried was to 'exec' myself again hoping the socket would get
closed, but that didn't work.

Anyone got a clue how I can close this socket gently or by brute force?

Thanks
Ian

 ------------------------------
Ian Maloney UBS +41 1 236 1629


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

Date: 10 Jun 1998 12:46:49 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: strings..
Message-Id: <6llv7p$96j@news-central.tiac.net>

In article <6ll9qj$18f$1@baker.cc.tut.fi>,
Antti-Jussi Korjonen <Antti-Jussi.Korjonen@sonera.fi> wrote:
>How would I easily determine, if a string contains only digits or
>alphabets and nothing else?

The place to look for more information on this would be in the perlre man
page.

A character class which just matches alphabetic characters and digits
might be written as:

  [^\W_]

as \w matches alphabetic, numeric and _ characters and \W matches anything
that isn't \w then negating the class [\W_] gets you all of \w *except*
the _ (and it should be locale aware too, but I haven't tested that.)

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@colltech.com                  |            Collective Technologies (work)


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

Date: Wed, 10 Jun 1998 12:51:57 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Where is the robot?
Message-Id: <357E735D.5153A2C@nortel.co.uk>

If I'd say to you:

open (THEBOTTLE, "< $with_a_screwdriver"); #!!!

Would you really do it?

-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: 10 Jun 1998 08:20:46 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: abhidon@hotmail.com
Subject: Re: why does this work?
Message-Id: <k96pz93l.fsf@mailhost.panix.com>

abhidon@hotmail.com writes:

> 	Suppose my file has the following characters only : "acbjvfdh"
> this file has nothing else in it. If I run this with perl, I get no
> error message!  Whereas, if I append a ";" to the same string I
> start getting errors!

A bareword that isn't a keyword becomes a string constant during
compilation.  If you were to run that "program" under the -w switch,
you'd be warned about the use of a constant in a void context.  Adding
the semicolon makes no difference in my version of perl.  What version
are you using, and what difference does it make?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: 10 Jun 1998 08:16:41 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: mburr@halcyon.com
Subject: Re: Win32: File glob causes floppy to chatter
Message-Id: <ogw1z9ae.fsf@mailhost.panix.com>

Michael Burr <mburr@halcyon.com> writes:

> I'm using the ActiveWare port of 5.003_07

Erk!  Throw it away, and get the much more up-to-date "standard
distribution" for Win32, which you'll find on the CPAN:

   http://www.perl.com/CPAN-local/ports/nt/Standard/

> I've noticed that every file glob causes the "A" drive to chatter as
> if a seek is being done on it - only problem is I'm reading the C
> drive!

  Patient:  Doctor, it hurts when I do this.
  Doctor:   Don't do that!

Don't use globs on a box with a broken OS; use
opendir/readdir/closedir.

> foreach $dir (qw(/windows /windows/system)) {
> 
> 	#--- each file glob here will cause the "A" drive to buzz
> 	chdir $dir;
> 	foreach $fn (<*.*>) {
> 		print $fn, "\n";
> 	}

   foreach my $dir (qw( /windoze /windoze/system )) {
      opendir DIR, $dir or die "opendir $dir: $!";
      my @files = map {"$dir/$_"} grep {!/^\.\.?/} readdir DIR;
      closedir DIR;
      print "@files\n";
   }

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

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

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